DBI::errstr : SvUTF8 flag not set

Vincent Veyron <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
Hi,

I use DBD::Pg with the pg_enable_utf8 flag set; server locales, perl scripts and databases are all UTF8 encoded.

When using this construct in mod_perl context :

eval { $dbh->do($sql) } ;

if ( $@ ) { $content .= $@ }

I get garbled accented characters in the error message : 

DBD::Pg::st execute failed: ERREUR: syntaxe en entrée invalide pour l'entier : « €20 » at <....>.pm line 103.

Messages are correctly displayed from the command line and in Apache and Postgresql logs, just not in my web pages. It seems the SvUTF8 flag is not set on errstr.

I can solve it with $content .= decode_utf8( $@ ), but was wondering if there is another solution?



-- 
					Salutations, Vincent Veyron 

https://legalcase.libremen.com/ 
Legal case, contract and insurance claim management software
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.