We developed a specific exporter for them which allows the position based product to provide a type of portfolio snapshot - both for equities and fixed income portfolios.
We developed a specific exporter for them which allows the position based product to provide a type of portfolio snapshot – both for equities and fixed income portfolios.
The 1st text is what I copy from Jira, the second is what gets printed in Cognity. I get the text from Jira in a JSON format via the REST API and format it with a string builder and finally return a normal String as the output. All the symbols like " ' -
etc. don't get printed right and I get a lot of –
in the output text. How can I fix that? I was thinking if there was some way I could change the encoding of the output String, maybe that might work?
EDIT: This is what I use to get the information from Jira after which I extract what I want from the JSON returned.
String usercreds = "?os_username=user&os_password=password";
try {
url = new URL("http://jira/rest/api/2/issue/" + issuekey + usercreds);
URLConnection urlConnection = url.openConnection();
if (url.getUserInfo() != null) {
String basicAuth = "Basic " + new String(new Base64().encode(url.getUserInfo().getBytes()));
urlConnection.setRequestProperty("Authorization", basicAuth);
}
InputStream inputStream = urlConnection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
while ((s = reader.readLine()) != null) {
temp.append(s);
s = "";
}
issue = new JSONObject(temp.toString());
temp.setLength(0);
} catch (IOException e) {
e.printStackTrace();
} catch (JSONException e) {
e.printStackTrace();
}
If I understood correctly, there should be a way for me to specify that I want the output to be ("application/json;charset=utf-8")
somewhere in this code and that might solve my prolbem?