teranius at mail.ru
Sat Apr 22 16:02:01 EDT 2006
On 22/04/2006 06:10 Pm, James K. Lowden wrote:
> Tera wrote:
>> Does FreeTDS support translation
>> between charsets?
> Yes, for Microsoft servers using version 7.0 or 8.0 of the TDS protocol.
>> In our particular situation client is on Mac OS with
>> french localization (app encoding is MacRoman) and server
>> localization is Latin 1 (Windows 1252).
> If you iconv library supports those two encodings, it should work. In your
> freetds.conf, try:
> client charset = MACROMAN
> (assuming you're using Apple's iconv library). FreeTDS will detect the
> server's charset and convert between them. You can confirm what it's
> doing by setting TDSDUMP; the encodings are recorded at the beginning of
> the log file.
Thanks. I'll try this method on Monday.
However. I found this info in the doc:
"TDS 7.0 for Nonwestern Languages"
"To learn what character set the client is using, FreeTDS examines
the freetds.conf entry. If it finds nothing there, it assumes the
client is using ISO-8859-1. That is generally a safe assumption for
western languages such as English or French, but produces garbage
for other languages."
Strangely, it specifically talks about _nonwestern_ languages and
claims that everything should work ok for French right of the box,
which is not the case for us.
Then. Currently we use "ODBC-only" configuration and optionally
"DSN-less" configuration (in the latter case we specify all the
settings in the connect string to SQLDriverConnect bypassing
freetds.conf file). Is there a way to specify client charset in
these configurations, e.g. ODBC-only? By analogy, I can specify
"tds version" setting in odbc.ini file (just in slightly different
form as "tds_version") why not the same with "client charset"
setting? What if I use DSN-less configuration and bypass
freetds.conf file all-together specifying all the settings in
the connect string to SQLDriverConnect? Maybe some explicit
SQLSetConnectAttr attribute exists to specify client charset?
More information about the FreeTDS