[Catalyst] Re: utf8 / pg double encoding problem
Ash Berlin
ash_cpan at firemirror.com
Sun Jan 6 13:31:48 GMT 2008
Never trust dumper or printing to your terminal to tell if something
is in UTF8 or not. Terminals try to be too smart.
This is what Devel::Peek is for. Use it. Trust that.
On Jan 6, 2008, at 1:08 PM, Aristotle Pagaltzis wrote:
> * Daniel McBrearty <danielmcbrearty at gmail.com> [2008-01-06 13:30]:
>> On Jan 6, 2008 1:29 AM, Aristotle Pagaltzis <pagaltzis at gmx.de> wrote:
>>> * Daniel McBrearty <danielmcbrearty at gmail.com> [2008-01-06 00:00]:
>>>> [debug] abçöeü
>>>> [debug] $VAR1 = "ab\x{c3}\x{a7}\x{c3}\x{b6}e\x{c3}\x{bc}";
>>>> [debug] it's UTF8!
>>>
>>> Err, why doesn't Dumper say "ab\x{e7}\x{f6}e\x{fc}"? Strange
>>> that the first line looks correct, though.
>>
>> because it is utf8? shouldn't it be?
>
> What Dumper outputs is the UTF-8 byte sequence; but the next line
> says that the Unicode flag is set, so this is a character string,
> not a byte string. So it’s already double-encoded.
>
> I don’t understand why the first line looks correct though.
>
> In any case the raw HTTP request that leads to all this would be
> interesting.
>
> Regards,
> --
> Aristotle Pagaltzis // <http://plasmasturm.org/>
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
More information about the Catalyst
mailing list