I've recently had an rt posted (http://rt.cpan.org/Public/Bug/Display.html?id=67994) after a discussion on stackoverflow (http://stackoverflow.com/questions/5912082/automatic-character-encoding-handling-in-perl-dbi-dbdodbc).

In this case the Perl script is binding the columns but the data returned is windows-1252 and the user is having to manually Encode::decode all bound columns. DBD::ODBC already had a odbc_utf8_on flag (http://search.cpan.org/~mjevans/DBD-ODBC-1.29/ODBC.pm#odbc_utf8_on) for a derivative of Postgres which returns bound data UTF-8 encoded but in that case I can just call sv_utf8_decode (in the XS) and it is converted in place. Initially I thought I could combine odbc_utf8_on into a new flag saying my data is returned as xxx and just call Encode::decode with xxx (then eventually I could drop odbc_utf8_on).

However, Encode::decode converts a scalar returning a new scalar (not converted in place). Just wondered if anyone else has had to do this. I've never called a module method from XS so I got some pointers at http://www.perlmonks.org/?node_id=903729 which are useful but I'm still wondering how anyone else has solved this before I try and implement something.

Thanks

Martin

Reply via email to