I am trying to insert a .NET serialized JSON document to CouchBase but get gibberish with non-English characters.
I’ve tried to put:
name = " الفورية مترجم نصوص مجاني إلى "
But I get:
"name": " ״§„ˆ״±״© …״×״±״¬… †״µˆ״µ …״¬״§† ״¥„‰ ",
When viewing it in CouchBase administration page.
Any solution?
I am using ASP.NET 4.5 and latest CouchBase API with CouchBase 2.0 beta.
Also noted on http://www.couchbase.com/forums/thread/gibrish-non-english-characters-using-c-client-and-coucbase-2-0-beta, but copied here for reference:
Hi Idanm
The .NET client stores strings using UTF-8. Are you seeing the data coming out of the client correctly, or are the mixed up strings in the admin console?
Also, you can try the new extension methods that use Newtonsoft.JSON for Json serialization. In the .NET Couchbase Client Beta, you’ll find Couchbase.Extensions with the following class:
It seems possible that the Encoding.Default.GetBytes in the extensions you’re using might be at fault here…