Problems? Is your data what you think it is? | |
PerlMonks |
Re: DBI Adding Null Bytes to Stringby afoken (Chancellor) |
on May 25, 2016 at 22:16 UTC ( [id://1164146]=note: print w/replies, xml ) | Need Help?? |
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
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|