beloglazov/couchdb-scala

character encoding issue

Closed this issue · 2 comments

Hi,

I seem to run into a character encoding issue when putting an UTF-8 encoded value in couch and then retrieving it.

If I use de Document api to write a case class instance with a property like "Oekra\u00EFne" it is written correctly and is also shown correctly when retrieving the value using the Couch console.
But when I subsequently get this value from couch using the Document api, the UTF-8 character is not correct.

It should read 'Oekraïene' (dutch for 'Ukraine') but comes out as 'Oekraïne'.

---------- Update -------------

Might be an issue with the http4s lib, see ticket ...
http4s/http4s#279

updated issue description; possibly an issue with the underlying http4s lib?

http4s 0.8.1 has been released and now the EntityDecoder.decodeString method can be fed a default charset when decoding a body to a String. I think we can now change how JSON bodies are being decoded into strings here in couchdb-scala to fix the encoding issue.

Let me know if I can help.