I have some problem with Mojo::Exception. It generates a lot of trash
on stderr, like this
utf8 "\xE2" does not map to Unicode at /usr/local/share/perl/5.10.0/
Mojo/Exception.pm line 86, <GEN256> line 9
utf8 "\xEB" does not map to Unicode at /usr/local/share/perl/5.10.0/
Mojo/Exception.pm line 86, <GEN212> line 53.
utf8 "\xCE" does not map to Unicode at /usr/local/share/perl/5.10.0/
Mojo/Exception.pm line 86, <GEN212> line 65.
utf8 "\xE4" does not map to Unicode at /usr/local/share/perl/5.10.0/
Mojo/Exception.pm line 86, <GEN212> line 110.
utf8 "\xE5" does not map to Unicode at /usr/local/share/perl/5.10.0/
Mojo/Exception.pm line 86, <GEN212> line 139.
I think, It happens because Mojo::Exception opens file with
flag :utf8, but my files have non-utf8 encoding:
> My personal opinion is that utf8 and ascii are the only valid encodings
> for perl source code, and i don't see a good reason to use anything else.
agreed.
> If there's a simple solution for supporting all encodings i'm all ears,
> but otherwise i'm ok with expecting utf8.
Without looking at the respective code, the question is:
Is there a reason for decoding the incoming data at all?
If the code just does "decode incoming", then "encode outgoing", without
doing any string manipulation in between like sorting or length
checking, then it is better to save the (de|en)coding and take the data
as a byte stream.
The worst thing, that can happen is, that a browser might show strange
characters if the header's Content-Type encoding does not match the
actual encoding of the data that was send to the browser.
Bernhard
Without looking at the respective code, the question is:
Is there a reason for decoding the incoming data at all?