Fork me on GitHub
#yada
<
2016-12-06
>
kurt-yagram13:12:20

encoding question: I've got some strings stored in datomic and I've got an api (yada) to fetch them. The string contains some accented characters. When I try locally, all seems to work fine. However, remote, it doesn't: 1. fetching the data via the api returns a string with a bunch of ? (where the accented characters should be), also if I curl them 'locally on the remote server'. 2. when I query the database from the repl (ssh to server, run emacs, cider connect), than I do see the accented characters as expected. Where exactly is it going wrong here?

kurt-yagram13:12:28

updated locales on remote, seems to be ok now.

malcolmsparks13:12:37

In your produces decls, always add charset.

malcolmsparks13:12:47

:produces {:media-type "text/html" :charset "utf-8"}

malcolmsparks13:12:29

Otherwise it's assumed to be any your jvm can produce

dominicm14:12:01

I really want to know why yada works locally in that case, it bit me too the other day!

kurt-yagram14:12:33

I don't really know, but when I did set the locales of both systems the same, it magically worked 🙂. Local is en_GB.utf-8. Remote was C.UTF-8. It worked when I changed it to en_GB.utf-8 (or en_US.utf-8, or probably any other en_XX.utf-8 - I didn't try something like nl_XX.utf-8, though)

mccraigmccraig17:12:52

default JVM locale maybe ? all my vms have :jvm-opts ["-Dfile.encoding=UTF-8"] after having similar dev-machine / production-server problems in the past