[Catalyst] utf8 / pg double encoding problem

Daniel McBrearty danielmcbrearty at gmail.com
Sun Jan 6 12:22:29 GMT 2008


I don't follow this. The way I understand it, C::P::Unicode should
have already gotten the input into Perl's internal format, which is
utf8. So, for us to see a sequence of chars encoded as utf8, with the
flag on, here, is what I expect.

What am I misunderstanding?

On Jan 6, 2008 12:28 AM, Andrew Rodland <arodland at comcast.net> wrote:
> On Saturday 05 January 2008 04:54:59 pm Daniel McBrearty wrote:
> > well I'm damned, I thought I had this stuff working squeaky clean. But
> > I was wrong. I actually had two bugs cancelling each other out -
> > usually.
> > [snip]
> >--' [debug] abçöeü
> > [debug] $VAR1 = "ab\x{c3}\x{a7}\x{c3}\x{b6}e\x{c3}\x{bc}";
> > [debug] it's UTF8!
> >
> Looks like the problem is here... the utf8 flag is on, indicating that $edit
> is a string of characters, rather than bytes -- but the dumper output seems
> to show that these "characters" correspond to UTF-8 encoded bytes, instead of
> the actual characters of the data -- meaning that the bytes actually stored
> in the string are along the lines of "ab\x{c3}\x{83}\x{c2}\x{a7}"... not
> good. Somewhere, your data got the utf8 flag set "by assumption" instead of
> by decoding. $edit = decode("UTF-8", $edit) should clear it up, although
> finding the original problem is probably a better idea. :)
>
> Andrew
>
> _______________________________________________
> 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/
>



-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
http://www.engoi.com
http://danmcb.vox.com
http://danmcb.blogger.com
find me on linkedin and facebook
BTW : 0873928131


More information about the Catalyst mailing list