'Character ' getting encoded to ��� in Java
The desired response that I need to return from my API is (I’m) but instead of this I am getting I���m. Basically ' is getting encoded as ���. The response of the API is coming from a JSON file. When I run the API on my localhost it is giving desired response, but on an open-shift cluster where it is deployed I am getting ���.
To be clear:
- My desired output is
I’m - My actual output is
I���m
In my Spring Boot Application, for this API I have made the HTTP Headers as
httpHeaders.add(HttpHeaders.CONTENT_TYPE, "application/json; charset=UTF-8");
but still the encoding is not resolved.
Any suggestions on how to make this work?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
