When I set the 'LongTruncOk' parameter to true for a database handle and retrieve a long string it seems to insert null bytes between each character. For example, a string of '600' comes back as (in hex): 36 00 30 00 30
Looks like UTF-16.
I'm working with an MS SQL Server if it matters.
Yes, it does. Please show us the definition of the table you are reading from. Are you reading from an NVARCHAR (as opposed to a VARCHAR)?
Could you try running the tests 40UnicodeRoundTrip.t, 41Unicode.t, and perhaps also 45_unicode_varchar.t from DBD::ODBC? (You will also need UChelp.pm from the same directory.)
Alexander
In reply to Re: DBI Adding Null Bytes to String
by afoken
in thread DBI Adding Null Bytes to String
by Stringer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |