Issue 304: access chinese filename connect?
Status:  Investigating
Owner: ----
Reported by south...@gmail.com, Dec 23, 2012
What steps will reproduce the problem?
1.how to connect when connect string having chinese?

Mar 28, 2013
Project Member #1 mkleehammer
The connect method is designed to handle Unicode strings, so the problem is probably related to the driver's character set settings.

In particular, ODBC is supposed to support ASCII and UCS2, but most drivers do not do this correctly.  (I am going to add a charset option to pyodbc to handle this...)  Try setting your driver's charset to something UCS2LE compatible and see if that helped.

If not, can you provide the OS version, driver and driver version?  Also, an ODBC trace would really help.
Status: Investigating
Sep 26, 2014
#2 fatcam...@gmail.com
solution:
assume you have a connect string 'connect_str' with chinese characters,the following example should work.

import locale, pyodbc
connection = pyodbc.connect(connect_str.decode(locale.getpreferredencoding()))
Sep 26, 2014
#3 fatcam...@gmail.com
or you can try:

import locale, sys
connection = pyodbc.connect(connect_str.decode(sys.getfilesystemencoding()))