Skip to Content.
Sympa Menu

freetds - [freetds] UTF-8 / iconv issues

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Matthew Hillebrand" <mxhillebrand AT convera.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] UTF-8 / iconv issues
  • Date: Tue, 11 Oct 2005 21:57:33 -0700

Hello. I've got a weird situation. We have a linux web server, which I
just upgraded to PHP 5. This server talks to a Windows box with SQL
Server 2000 on it. Before I showed up on the job, PHP 4 was installed,
and everything worked.

This web app lets users translate English words into eleven other
languages. In the PHP code, the iconv library is used to convert
incoming UTF-8 text from the user's browser into various character sets
because SQL Server uses UCS-2 instead of UTF-8. I didn't set this up,
but I must deal with it. For example, for Japanese, the incoming UTF-8
text is converted into the SHIFT_JIS encoding before being stored into
SQL Server. Then when it's retrieved, it's converted back into UTF-8
before being displayed on the screen. A different encoding is used for
almost all of the eleven other languages.

Anyway, things were working fine out of the box. PHP 4 was communicating
with MS SQL just fine. I don't know if it used FreeTDS or not. I had to
upgrade to PHP 5 for its XML features, among others. I had to install
FreeTDS to talk to MS SQL, which is working. However, the iconv
conversions performed by FreeTDS are messing up the data. I've tried
specifying version 7.0 rather than 8.0. I've tried specifying client
charset = UTF-8. I know the conf file is being read...because different
errors occurr depending on what I change.

Is there a way to tell FreeTDS not to perform iconv charset conversions?
Will that even solve this issue?

Thank you!!

Matt




Archive powered by MHonArc 2.6.24.

Top of Page