I test redis and jedis API for encoding ISO-8859-5:
String S = new String("Привет мир".getBytes(), "ISO-8859-5");
redis.lpush("test", S);
System.out.println(redis.lpop("test"));
In result, I have: а�б�аИаВаЕб� аМаИб�
Then I try to use SafeEncoder:
String S = new String("Привет мир".getBytes(), "ISO-8859-5");
redis.lpush("test", S);
byte[] Result = SafeEncoder.encode(redis.lpop("test"));
System.out.println(new String(Result));
Result: аАТаБТаАааАааАааБТ аАааАааБТ
What I do wrong? Is it me or redis, or jedis?
You can use the binary form directly