[AOLSERVER] Nsmemcache and utf-8 characters

10 views
Skip to first unread message

Levy Bajamundi

unread,
Nov 16, 2010, 5:34:57 AM11/16/10
to AOLS...@listserv.aol.com
Hi,

We're having some issues with the nsmemcache module. It works perfectly fine if the string we're trying to store is regular alphabet characters, but once we try to store utf-8 chars, things starts to go awry. Has anyone had this issue before?


Thanks,

Levy Bajamundi
Systems Developer
ACSPropel

-- AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <list...@listserv.aol.com> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.

Majid Khan

unread,
Nov 16, 2010, 7:09:26 AM11/16/10
to AOLS...@listserv.aol.com
Hi Levy,

For UTF-8 you need to encode first and then need to pass to the memcache module. e.g.

In order to set the value in Memcache Server:

set value {some chinese here :)}
set encoded_value [encoding convertto utf-8 $value]

ns_memcache set key $encoded_value 120

To get:

set value ""
ns_memcache get key value
set decoded_value [encoding convertfrom utf-8 $value]

HTH.

Regards,

Majid.

Levy Bajamundi

unread,
Nov 16, 2010, 9:29:04 AM11/16/10
to AOLS...@listserv.aol.com
It works! Thanks so much for your help on this Majid!


Levy
Reply all
Reply to author
Forward
0 new messages