Closed jcheron closed 7 years ago
Hi @jcheron
just tried but it worked for me, it must be your http client that mess ups the strings...are you on windows terminal?
$ (master) http -a a:a 127.0.0.1:8080/test/coll/58dcb924ab36667a54a57efc
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Location, ETag, Auth-Token, Auth-Token-Valid-Until, Auth-Token-Location, X-Powered-By
Auth-Token: 0b3c7498-b660-4cab-b593-51d88c19f6cd
Auth-Token-Location: /_authtokens/a
Auth-Token-Valid-Until: 2017-03-30T11:46:23.497Z
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 155
Content-Type: application/json
Date: Thu, 30 Mar 2017 11:31:23 GMT
X-Powered-By: restheart.org
{
"_id": {
"$oid": "58dcb924ab36667a54a57efc"
},
"code": "Beer1",
"descriptif": "affichage de la liste des bières /beers (L'affichage de la bière n'affiche pas le brasseur associé)"
}
Hi @ujibang Did you see that I changed the initial message of the issue. This also works for me on some computers
You mentioned different computers: which operating systems?
I tried on debian 8 and windows 10 => no problems
I have the problem on windows 7
Which does not mean that the problem is related to the operating system...
Is there a way to force the encoding in the configuration file ?
To me this sounds like a Java configuration issue on Windows 7, maybe you can try to force the JVM to use the UTF-8 file encoding by passing the following JVM parameter when starting RESTHeart:
-Dfile.encoding=UTF-8
.
On Windows, you can also set a global environment variable for that, but beware it will affect all of your JVM processes:
By setting the (Windows) environment variable JAVA_TOOL_OPTIONS to -Dfile.encoding=UTF8, the (Java) System property will be set automatically every time a JVM is started. You will know that the parameter has been picked up because the following message will be posted to System.err:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
Indeed, it depends on the jvm.
Launching with -Dfile.encoding = UTF-8
solves the problem.
Thank you !
It may be a parameter that could be included in the configuration file..
Hi @jcheron Indeed adding that parameter in the configuration file could be a good idea, I'll have a look into this.
I added "-Dfile.encoding=UTF-8" parameter to bin/start.sh
This is what is called "be responsive". "être réactif" in French and with accents. I will test this (on my old win 7) Thank you @mkjsix
With this datas in MongoDb :
The Http response given by restHeart does not seem to be interpreted as UTF-8 :
This is not a RestHeart bug, since on another computer, there is no encoding problem.
Would the RestHeart server use the default encoding of the java virtual machine?
Configuration :