Skip Menu |

This queue is for tickets about the CGI-Simple CPAN distribution.

Report information
The Basics
Id: 49671
Status: new
Priority: 0/
Queue: CGI-Simple

Owner: Nobody in particular
Requestors: tomas.znamenacek [...]

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)

Subject: Unicode strings not saved correctly
Download (untitled) / with headers
text/plain 577b
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 line 10. # got: 'KrFta' # expected: 'Krůta' # Looks like you failed 1 test of 1.
From: tomas.znamenacek [...]
Download (untitled) / with headers
text/plain 236b
For what it’s worth, the problem can be solved by encoding the string: use Encode qw/encode_utf8 decode_utf8/; use MIME::Base64; my $encoded = encode_base64(encode_utf8('Krůta')); my $decoded = decode_utf8(decode_base64($encoded));

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to