Automatic character encoding handling in Perl / DBI / DBD::ODBC
问题 I'm using Perl with DBI / DBD::ODBC to retrieve data from an SQL Server database, and have some issues with character encoding. The database has a default collation of SQL_Latin1_General_CP1_CI_AS , so data in varchar columns is encoded in Microsoft's version of Latin-1, AKA windows-1252. There doesn't seem to be a way to handle this transparently in DBI/DBD::ODBC. I get data back still encoded as windows-1252 , for instance, € “ ” are encoded as bytes 0x80, 0x93 and 0x94. When I write those