Subject: | Unicode strings not saved correctly |
Test:
#!/usr/bin/perl
use utf8;
use CGI::Simple::Cookie;
use Test::More tests => 1;
my $string = 'Krůta';
my $cookie = new CGI::Simple::Cookie(-name => 'test', -value => $string);
my %thawed = parse CGI::Simple::Cookie($cookie->as_string);
is $thawed{'test'}->value, $string, 'Unicode value saved and parsed back correctly.';
Result:
1..1
not ok 1 - Unicode value saved and parsed back correctly.
# Failed test 'Unicode value saved and parsed back correctly.'
# at test.pl line 10.
# got: 'KrFta'
# expected: 'Krůta'
# Looks like you failed 1 test of 1.