Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Unicode characters in reconciliation API #476

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package edu.cornell.mannlib.vitro.webapp.controller.grefine;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
Expand Down Expand Up @@ -70,6 +71,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
super.doGet(req, resp);
resp.setContentType("application/json");
resp.setCharacterEncoding("UTF-8");
VitroRequest vreq = new VitroRequest(req);

try {
Expand All @@ -81,7 +83,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
.toString() : vreq.getParameter("callback") + "("
+ qJson.toString() + ")";
// System.out.println("JSONReconcileServlet result: " + responseStr);
ServletOutputStream out = resp.getOutputStream();
PrintWriter out = resp.getWriter();
out.print(responseStr);
} else { // metadata
String defaultNamespace = null;
Expand All @@ -97,7 +99,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
ObjectNode metaJson = getMetadata(req, resp, defaultNamespace, defaultTypeList, serverName, serverPort);
String callbackStr = (vreq.getParameter("callback") == null) ? ""
: vreq.getParameter("callback");
ServletOutputStream out = resp.getOutputStream();
PrintWriter out = resp.getWriter();
out.print(callbackStr + "(" + metaJson.toString() + ")");
}
} catch (Exception ex) {
Expand Down
Loading