Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

using redis-node (nodejs) with utf-8/16 (russian, chinese, japanese characters)

using redis-node (nodejs) with utf-8/16 (russian, chinese, japanese characters)

Problem

Has anyone successuflly used Russian/Chinese/Japanese characters with redis-node or any other redis library (using nodejs) to store/receive messages to & from Redis (2.0 and above)? I believe encoding/decoding of these messages is upto the client, not Redis. If so, do any of the libraries provide this encoding/decoding or is there another library one can use for this purpose? Any working code examples would be greatly appreciated.

Problem courtesy of: ali haider

Solution

using utf-8 with redis works - if you use redis-cli, make sure that you pass in raw as the parameter to read the russian/chinese/japanese characters (otherwise those characters will not appear correctly in redis-cli). You can retrieve them correctly using an API like Jedis/redis-node etc. Hope this helps!

Solution courtesy of: ali haider

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

using redis-node (nodejs) with utf-8/16 (russian, chinese, japanese characters)

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×