I have found that using DBI with the DBD::ODBC driver for Windows is corrupting Unicode characters in nvarchar defined columns.

I did a test using Win32::ODBC and I don't get the Unicode corruption.

Is there a switch or flag or parameter I need to use when utilising DBI on Windows to stop this Unicode corruption?

I have tried using {odbc_old_unicode => 1} but it has made no difference.

Why is DBD::ODBC corrupting UCS-2 from MS SQL2008 R2?