[ freetds-Patches-3298035 ] Expose client charset as an odbc connection parameter

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Patches item #3298035, was opened at 2011-05-05 21:35
Message generated for change (Comment added) made by freddy77
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=407808&aid=3298035&group_id=33106

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Out of Date
Priority: 5
Private: No
Submitted By: Brian Hawthorne ()
Assigned to: Nobody/Anonymous (nobody)
Summary: Expose client charset as an odbc connection parameter

Initial Comment:
We would like to develop against some mssql dbs from an ubuntu linux environment, but had a very hard time configuring unixodbc/freetds to acknowledge the freetds.conf file, which is the only way to configure client charset, which is necessary for proper unicode support.  The packaged ubuntu unixodbc and freetds binaries are configured by default with unixodbc as the driving configurator for freetds.  So rather than bending over backwards to set things up in a way that they don't want to be set up, I made a very small patch to expose the client charset configuration as an odbc connection parameter.  Seems like you would want it to be anyway.

This patch is made against freetds-0.82.1.dev.20110409.  I added the following four lines after line 175 in src/odbc/connectparams.c:

    tmp[0] = '\0';                                                                                                                                                                
    if (SQLGetPrivateProfileString(DSN, "Client_Charset", "", tmp, FILENAME_MAX, "odbc.ini") > 0) {                                                                               
        tds_dstr_copy(&connection->client_charset, tmp);                                                                                                                          
    }

Now you can put Client_Charset=UTF-8 in your odbc.ini or your connect string.


----------------------------------------------------------------------

>Comment By: Frediano Ziglio (freddy77)
Date: 2011-05-07 20:14

Message:
Hi Brian. Your feature is already in 0.91 (still in RC) so I won't add to a
old release. The new parameter is "ClientCharset".


----------------------------------------------------------------------

Comment By: Brian Hawthorne ()
Date: 2011-05-05 21:37

Message:
Looks like sourceforge didn't pick up my name from the google login.  I'm
Brian Hawthorne, email hawthorne at amyris dot com.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=407808&aid=3298035&group_id=33106
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.