Skip to Content.
Sympa Menu

freetds - Re: [freetds] Sybase: Charset conversion

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Sybase: Charset conversion
  • Date: Thu, 26 Nov 2009 07:17:48 +0100

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






Archive powered by MHonArc 2.6.24.

Top of Page