Saving Chinese to mongodb 2.4.8 cause unreadable string
java, mongodb, playframework
Solution
From what you have posted I suspect that this may be an artefact of the Play Framework, as both these characters can be stored directly in MongoDB.
> db.test1.insert({x:" and "})
> db.test1.find();
{ "_id" : ObjectId("52a12237e7c9d6190f6feb95"), "x" : " and " }
Assuming that the characters you posted as 发 and 生 above are really meant to be and then I would suspect that the Play Framework is converting them into a representation of their extended unicode values. In this case those two characters would be from the "CJK Unified Ideographs Extension B" section.
You can view the whole set of characters here: http://codepoints.net/cjk_unified_ideographs_extension_b
This looks to be a similar issue as here in the play-framework google group.
Problem
Before I used Mongodb 2.0.6, everything is fine. recently I started to use Mongodb 2.4.8 with Java Play framework, and I found that when I tried to save Chinese to mongodb, mongodb actually stored as some unreadable string, such as `&\#21457;&\#29983;`, what is show on web is the same string, does anything know why? what should I do? how to convert it to readable Chinese?