Re: Database encoding not recognized by DBD::Pg

Vincent Veyron <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
On Tue, 08 Apr 2014 08:40:45 +1000
Ron Savage <[email protected]> wrote:

Hi Ron,

> 
> AFAICT locales have no effect on my code.
> 
> I do have a policy of creating databases with:
> 
> create database $name owner $role encoding 'UTF8';
> 

Yes, I agree, it does work, just not on this backup server :-(


> See also:
> 
> http://savage.net.au/Perl/dbd.utf8.pl
> 

Thank you for that (and running tests); I copied it to add

use Encode;
print encode('UTF8', $content);

to my module, and then the faulty server displays accented characters properly.

The problem is that the other servers are now subject to double encoding (since they were correctly outputting UTF8 in the first place).

Strangely, all servers, good and bad, report 'UTF8 OFF, ASCII' for DBI->data_string_desc(). I would have expected 'UTF8 on', since the db is UTF8 encoded.

-- 
					Salutations, Vincent Veyron

http://vincentveyron.com
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.