[Cgi-session-user] utf8 problem
Brought to you by:
sherzodr
From: Thomas G. <tho...@pi...> - 2015-07-09 12:36:47
|
Hi, I'm having problems getting CGI::Session to work with utf8. I read the "A Warning about UTF8" section but I couldn't find the following issue anywhere: In my session I have utf8 encoded strings like 'jörg'. The session data gets serialized by default serializer Data::Dumper into a MySQL data column (mediumtext, charset utf8, collation utf8_unicode_ci) as expected with utf8 characters escaped like this: 'j\x{f6}rg' Now, the problem is that when this session data get's thawed, the resulting string 'jörg' is missing perls utf8 flag. Which causes Data::Dumper to just cut the data at the utf8 character 'ö' during next freeze. Result: the dump is stored corrupted in the data column and Data::Dumper crashes of course when trying to thaw that next time. I already posted this problem incl more details and code snippets at stackoverflow to no avail: http://stackoverflow.com/questions/31049125/perl-cgisession-mysql-thaw-utf-8-data It looks like a bug to me but since I don't think that I'm the only one trying to use CGI::Session with utf8 characters I guess that I rather must be missing something here. I'd be really grateful for any hints on this. Best regards, Thomas |