Le mardi 31 mai 2005 à 15:37 +0200, Eduardo Garcia-Mádico Portabella a
écrit :
> There's a perl script that inserts data in mysql tables (charset latin1,
> both, tables and data for insertion). From last update to Sarge all
> non-ascii characters that we try to insert become as if the perl script
> would interpreted it as utf8. If we put a Ñ (ntilde) we get two chars
> like this Ã\u2018 into the database.
Perl 5.8 in sarge now has full UTF-8 support ... you may need to adjust
your script to make sure that you convert any UTF-8 input in something
else if needed.
> If we insert into de database with mysql command prompt it works right.
>
> The insertion SQL sentence is something like this:
>
> ###########################################################################
> $query = "insert into kitz_serv_certif values (0,\'$cabecera{'cliente'}\',
> \'$cabecera{'orden'}\', \'$cabecera{'entrega'}\',\'$cabecera{'posicion'}\',
> \'$cabecera{'fecha'}\', null, \'$cabecera{'refclte'}\',
> \'$cabecera{'articulo'}\',\'$cabecera{'artclte'}\')";
Check if you don't feed UTF-8 to Mysql :
print "string is UTF8" if utf8::is_utf8($query);
You can also try adding a call to :
utf8::decode($query)
> We do not really know the exact momento that this code has stopped
> working, but we suspect it was when we updated libdbd-perl-mysql from
> woody to sarge.
You bug report doesn't look like a "bug". Your script stopped working
but it may well be that you have to enhance your script to handle UTF-8
support...
Please check the result of the various advice given above and come back
to me to tell me what happened.
Cheers,
--
Raphaël Hertzog -+- http://www.ouaza.com
Formation Linux et logiciel libre : http://www.logidee.com
Earn money with free software: http://www.geniustrader.org