Skip to Content.
Sympa Menu

freetds - Re: [freetds] Non western language

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Non western language
  • Date: Fri, 11 Nov 2005 01:15:34 -0500

Horacio Sanson wrote:
> The problem is that I cannot select records from the server as all text
> data gets converted to "?" chars. I changed the configuration in all
> ways I could think of using diferent char encodings with no luck. Can
> someone help me find a way to read japanese text/varchar fields from
> the database??
>
> Here is my configuration:
>
> # freetds.conf
> [TEST]
> host = 192.168.0.210
> port = 1433
> tds version = 8.0
> client charset = SJIS
...
> I connect using isql and my system is set to Shift_JIS encoding. I can
> send data to the SQL server and it is stored ok at the server but I
> cannot later retrieve it.
>
> I tried several charsets like UTF-8, Shift-JIS, EUC-JP etc and all of
> them give me "?" chars instead of the japanese characters.

The string you provide in "client charset" is passed verbatim to iconv(3).
For that reason, the name must match what iconv expects. On my system,
that would be something like:

$ iconv -l |grep -i jis
jis_c6220-1969-ro
jis_c6229-1984-b
shift_jis
sjis

Note: "shift_jis", not "shift-jis". What does your system say? Also, it
might be case-sensitive (I don't know).

If you're not specifying a correct name, TDSDUMP will tell you at the top
of the log file. But if your weren't, I wouldn't expect inserts to work,
either.

You say your "system is set to Shift_JIS encoding". Is that reflected in
your locale? What does tsql say when you connect?

I don't have any experience setting up a Japanese environment. I just
know the iconv name, the locale, and the fonts all have to line up for it
to work.

HTH.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page