Cyrillic and Redis

608 views
Skip to first unread message

Елена Исаева

unread,
Jun 3, 2012, 3:30:08 PM6/3/12
to redi...@googlegroups.com
Hello, using redis and php-redis (client), you must use the Cyrillic field in the type of hashes and get the value for this field. In the console redis all requests go normally and are executed. But here are a client (php-redis) recording of the Cyrillic field works and here is his conclusion does not work. The problem is in the client, who may already have encountered the same problem? 
And one more question when the value of the key Cyrillic at the choice of the value of this key output any questions for example:���, changed the encoding of the browser to windows-1251 but turned out Cyrillic but it is not the value of which has been recorded in the key. 

Sergei Tulentsev

unread,
Jun 3, 2012, 4:11:42 PM6/3/12
to redi...@googlegroups.com
I'm not really sure what you are asking here. But there are many ways in which cyrillic text can be encoded. I guess, you encode in one format and try to decode in another.

Redis itself treats strings as byte streams, it doesn't care about language or encoding.

On Sun, Jun 3, 2012 at 11:30 PM, Елена Исаева <obla...@gmail.com> wrote:
Hello, using redis and php-redis (client), you must use the Cyrillic field in the type of hashes and get the value for this field. In the console redis all requests go normally and are executed. But here are a client (php-redis) recording of the Cyrillic field works and here is his conclusion does not work. The problem is in the client, who may already have encountered the same problem? 
And one more question when the value of the key Cyrillic at the choice of the value of this key output any questions for example:���, changed the encoding of the browser to windows-1251 but turned out Cyrillic but it is not the value of which has been recorded in the key. 

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To view this discussion on the web visit https://groups.google.com/d/msg/redis-db/-/xmqVj84--ssJ.
To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.



--
Best regards,
Sergei Tulentsev

Елена Исаева

unread,
Jun 3, 2012, 4:33:33 PM6/3/12
to redi...@googlegroups.com
I have thought about this, but here is a look if you want a simple string (set) with the value of the Cyrillic redis automatically converts the value in the form of u0430\u043d... But if I understand correctly, then this line in оперативке will occupy more space than the same text in Latin, that is, when the sample value with the Latin script, it will not be encrypted. Correct me if that is not true..

понедельник, 4 июня 2012 г., 0:11:42 UTC+4 пользователь Sergio Tulentsev написал:
To unsubscribe from this group, send email to redis-db+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.



--
Best regards,
Sergei Tulentsev

понедельник, 4 июня 2012 г., 0:11:42 UTC+4 пользователь Sergio Tulentsev написал:
To unsubscribe from this group, send email to redis-db+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.

Sergei Tulentsev

unread,
Jun 3, 2012, 4:59:44 PM6/3/12
to redi...@googlegroups.com
This looks like unicode escaping. Yes, in unicode it'll take more than one byte to store a single cyrillic character. You might want to use one-byte cyrillic encoding here (win-1251, for example).

To view this discussion on the web visit https://groups.google.com/d/msg/redis-db/-/44D-6hrr7ncJ.

To post to this group, send email to redi...@googlegroups.com.
To unsubscribe from this group, send email to redis-db+u...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/redis-db?hl=en.

Max Kamashev

unread,
Jun 3, 2012, 5:01:48 PM6/3/12
to redi...@googlegroups.com
That's right. Redis by default saves the text in a binary format. Therefore, converts text to UTF few characters.

To solve the problem with the client, write the authors in the bug tracker, this is usually quickly resolved.
https://github.com/nicolasff/phpredis/issues


2012/6/4 Sergei Tulentsev <sergei.t...@gmail.com>



--
С уважением, Максим Камашев
<max.ka...@gmail.com>

Елена Исаева

unread,
Jun 3, 2012, 5:08:56 PM6/3/12
to redi...@googlegroups.com
as this set, if redis himself so encodes the Cyrillic line? 

понедельник, 4 июня 2012 г., 0:59:44 UTC+4 пользователь Sergio Tulentsev написал:
Reply all
Reply to author
Forward
0 new messages