perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Christophe Boggio <embp...@thefreecat.org>
Subject Getting mad with UTF-8
Date Wed, 12 Jun 2013 14:44:11 GMT
Hello,

Can someone help me understand what could cause this :

warn "\$content : ".(utf8::is_utf8($content) ? "utf8" : "not utf8");
warn "\$ticketdata[0]->[0] : ".(utf8::is_utf8($ticketdata[0]->[0]) ? "utf8" : "not utf8");
warn "content4=$content";
if ($ticketdata[0]->[0] ne $content) {
	warn "content5=$content";
	#
	warn "content6=$content stored=".$ticketdata[0]->[0];
	warn "content7=$content";
}

In apache2 error.log :

[Wed Jun 12 16:35:56 2013] [warn] [12504]ERR:  32:  Warning in Perl code: $content : not utf8
at /var/www/sites/recia/rtgi3/rtgilib.pm line 382, <GEN46> line 13.
[Wed Jun 12 16:35:56 2013] [warn] [12504]ERR:  32:  Warning in Perl code: $ticketdata[0]->[0]
: utf8 at /var/www/sites/recia/rtgi3/rtgilib.pm line 383, <GEN46> line 13.
[Wed Jun 12 16:29:13 2013] [warn] [10974]ERR:  32:  Warning in Perl code: content4=h\xc3\xa9
at /var/www/sites/recia/rtgi3/rtgilib.pm line 381, <GEN47> line 13.
[Wed Jun 12 16:29:13 2013] [warn] [10974]ERR:  32:  Warning in Perl code: content5=h\xc3\xa9
at /var/www/sites/recia/rtgi3/rtgilib.pm line 383, <GEN47> line 13.
[Wed Jun 12 16:29:13 2013] [warn] [10974]ERR:  32:  Warning in Perl code: content6=h\xc3\x83\xc2\xa9
stored=h\xc3\xa9 at /var/www/sites/recia/rtgi3/rtgilib.pm line 385, <GEN47> line 13.
[Wed Jun 12 16:29:13 2013] [warn] [10974]ERR:  32:  Warning in Perl code: content7=h\xc3\xa9
at /var/www/sites/recia/rtgi3/rtgilib.pm line 386, <GEN47> line 13.

As you see, the $content variable changes from one line to the other ?!?
$ticketdata[0]->[0] contains "hé" coming from a DB (configured as UTF-8) and the test
should not fail.

I guess the problem comes from the fact that on the same line I have one utf-8 variable and
one non-utf8 one.

$content comes from $fdat{content} (not marked as utf8 while the page encoding is declared
and recognized as utf-8).

What can I do to force embperl to always set the utf-8 flag on $fdat{...} ?

If you know a way of telling Apache/EmbPerl that no encoding other than UTF-8 exist in the
world, I'll take it. And it's not a problem if I'm incompatible with anything.

Thanks for your help,

(using libembperl-perl 2.5.0~rc3-1 on Debian/wheezy with apache2-mpm-prefork 2.2.22-13)

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message