Re: Unicode and Sybase univarchar

[email protected] (Dave Rolsky)
Newsgroups perl.dbi.users
Message-ID <[email protected]>
On Thu, 3 Jun 2010, Michael Peppler wrote:

>> 2010/06/03 14:08:11 unicode CRITICAL: FATAL: DBD::Sybase::db do failed: Server message number=2402 severity=16 state=1 line=1 server=HDATADEV1 text=Error converting characters into server's character set. Some character(s) could not be converted.
>>
>> I'm not sure what that means.
>
> Hmmm - is that on a query, or on an insert operation?

That was from an insert.

>> If I _don't_ set that, the data goes in and comes out as bytes, rather than the bizarro hex string. However, the data does have the utf8 flag set when it comes back from Sybase, so I have to run it through Encode::decode.
>>
>> I really don't think I can realistically tell the bazillion developers here "just run all the data through Encode".
>>
>> I'd really like see an end-to-end solution.
>
> I agree - I've just not had much opportunity (or requests) to ensure that this works 100%.
>
> Ideally if you could send me some sample code, and a simple table 
> structure and data that reproduces the problem for you I could try to 
> look at it and see if I can fix it.

See my previous email. I included some code, and there was a table 
definition after the __END__ marker.

As I said, my employer might be willing to pay to have this done. If 
that's something you're interested, let's talk off list and I can try to 
help coordinate that.

>> Also, it's not clear to me that the data is actually being stored as 
>> characters at the Sybase level. I'm not even sure how I'd figure this 
>> out. When I do a select from sqsh, I see the wacky hex string, but I 
>> can't tell if that's Sybase trying to present data to me in a format it 
>> thinks my environment can handle.
>
> When in doubt - use the Sybase tools (i.e. isql, and use -Jutf8 to force 
> conversion to/from utf8 when reading/writing the data).

Unfortunately, from the terminal on my work dev machine, this gives me the 
hex string. I think something is being "helpful" here ;)

I fiddled with -Jutf8 and setting LC_ALL, to no avail.


-dave

/*============================================================
http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)
============================================================*/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.