Skip to content
This repository has been archived by the owner on Jan 7, 2021. It is now read-only.

[FIX] Added charset UTF-8 in requestBuilder #186

Merged
merged 1 commit into from
Jun 6, 2018

Conversation

svenmalvik
Copy link

@svenmalvik svenmalvik commented Jun 4, 2018

We had an issue with sending a comment with special characters like the norwegian letter "ø" to stash. I added charset UTF-8 in requestBuilder.
Insight from Wikipedia about Json: JSON exchange in an open ecosystem must be encoded in UTF-8. (https://en.wikipedia.org/wiki/JSON)

@svenmalvik svenmalvik changed the title Feature/charset Added charset UTF-8 in requestBuilder Jun 4, 2018
@t-8ch
Copy link
Contributor

t-8ch commented Jun 4, 2018

Hi @svenmalvik, thanks for this!
Two points:

  • Please squash the commits into one.
  • Out of curiosity, how did the error manifest? Was there an exception, did it use the system encoding, or something else?

@svenmalvik
Copy link
Author

svenmalvik commented Jun 4, 2018

I have squashed all commits into one.
I got an exception saying that it cannot post 0xf8 (norwegian letter ø) to stash. An upgrade of json_simple to 3.0.2 didn't fix the problem.

12:22:44 [INFO] {"errors":[{"context":null,"message":"Invalid UTF-8 start byte 0xf8\n at [Source: com.atlassian.stash.internal.web.util.web.CountingServletInputStream@41be8846; line: 1, column: 788]","exceptionName":"org.codehaus.jackson.JsonParseException"}]} 12:22:44 [ERROR] Unable to push SonarQube analysis overview to Stash 12:22:44 org.sonar.plugins.stash.exceptions.StashClientException: Unable to post a comment to vl-foreldrepenger #587. Received 400: org.codehaus.jackson.JsonParseException: Invalid UTF-8 start byte 0xf8 12:22:44 at [Source: com.atlassian.stash.internal.web.util.web.CountingServletInputStream@41be8846; line: 1, column: 788] 12:22:44 at org.sonar.plugins.stash.client.StashClient.validateResponse(StashClient.java:383)

@svenmalvik svenmalvik changed the title Added charset UTF-8 in requestBuilder [FIX] Added charset UTF-8 in requestBuilder Jun 5, 2018
@svenmalvik
Copy link
Author

Done

@t-8ch t-8ch merged commit 0fc7f94 into AmadeusITGroup:master Jun 6, 2018
@t-8ch
Copy link
Contributor

t-8ch commented Jun 6, 2018

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants