Eugene
Eugene

Reputation: 689

Encode utf-8 from redis store

I use Redis for storing and managing my locale translations. But I have some trouble with russian words. The fact that the russian words are stored in the format like that: "\"\\u0441\\u043a\\u0430\\u043b\\u043e\\u043b\\u0430\\u0437\\u0430\\u043d\\u0438\\u0435\"" And I dont know how encode this string. Can someone help me?

Upvotes: 0

Views: 1511

Answers (1)

akonsu
akonsu

Reputation: 29536

unless I misunderstand the question, there is no problem:

irb(main):001:0> require 'redis'
=> true
irb(main):002:0> redis = Redis.new
=> #<Redis client v3.0.4 for redis://127.0.0.1:6379/0>
irb(main):003:0> redis.set 'test', 'Женя'
=> "OK"
irb(main):004:0> redis.get 'test'
=> "Женя"
irb(main):005:0> 

Upvotes: 1

Related Questions