Re: Sybase: Charset conversion
Frediano Ziglio <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <1259216268.5063.2.camel@freddy> |
Il giorno mer, 25/11/2009 alle 22.18 -0500, James K. Lowden ha scritto: > Sebastian Podjasek wrote: > > I'm trying to access Sybase DB from my Perl script and currently > > I have some problems with FreeTDS characters conversion. From > > what I've seen FreeTDS detects that server is using UCS-2LE and > > tries to convert from it to UTF-8. As a result it produces some > > strange "Chinese characters", but when I do convert that string > > back to UCS-2LE, and then convert it as UCS-2BE (instead of > > little endian) to UTF-8 - I get what I want. > > It could be broken. It sounds like it. > > Sybase has a server-makes-right policy for character conversion. In > theory, FreeTDS shouldn't have to do any conversion at all. It merely > needs to tell the server what encoding to use, and the sever will use that > encoding. In fact, I'm not sure we do that correctly. > > What does the top of your TDSDUMP log say about the conversions? What > encoding do you think the server expects, and what does the client want? > Which database server are you using? Sybase or MSSQL? Which version? Which platform? Which client platform are you using? Big endian or little endian? I suspect client is big endian and server send utf16 coded as big endian using UNIVARCHAR. Which database type are you using? Could you post a TDSDUMP? freddy77