I'm retrieving data from a PostgreSQL database, using Perl DBI.
The data is to be printed on mail labels, using Postscript::MailLabels, which is an excellent module, but apparently, it needs Latin1-encoded data to work.
Natively, data in the DB is UNICODE encoded, I assume that means UTF8. So, the problem is to reencode the data into Latin1.
There are, apparently, many modules to do this, Unicode::Map, Unicode::Map8, Unicode::MapUTF8 and Unicode::String, but if I use these, most of them apparently just strips off the Norwegian characters (which I'm interested in), or in some cases, I have lost the whole string.
Probably, I'm just using it wrongly.... Digesting the fine manuals have been attempted, for example, I have set
Unicode::String->stringify_as("utf8");
which is supposed to tell the module that the strings it gets are UTF8. But it doesn't hear my prayers...
Finally, I've tried to let PostgreSQL do the work, by going
$rv = $dbh->do("SET CLIENT_ENCODING TO 'LATIN1';");
but, apparently, the output I get is 7 bits, as ø is mapped to x (IIRC).
Wise ones, surely you have been in the same position when you were young, how do I do this right?
In reply to Encoding of DBI PostgreSQL output by Kjetil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |