By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,630 Members | 1,252 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,630 IT Pros & Developers. It's quick & easy.

python, mssql and unicode

P: n/a
Hello,

I am using pymssql (http://pymssql.sourceforge.net/) to insert data
from a web-frontend (encoded in utf-8) into fields of type nvarchar of
an MS-SQL Server 2000.

The problem is, ms-sql server uses ucs-2 and not utf-8. I have looked
around a bit but found no suitable solution to this problem so far
except converting the utf-8 into latin-1 which will restrict the
characters to western europe languages.

Does any one have some suggestions?

Thank you for your help!

Simon

Nov 3 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ri**@zem.uni-bonn.de wrote:
Hello,

I am using pymssql (http://pymssql.sourceforge.net/) to insert data
from a web-frontend (encoded in utf-8) into fields of type nvarchar of
an MS-SQL Server 2000.

The problem is, ms-sql server uses ucs-2 and not utf-8. I have looked
around a bit but found no suitable solution to this problem so far
except converting the utf-8 into latin-1 which will restrict the
characters to western europe languages.

Does any one have some suggestions?

Thank you for your help!


Hey Simnon,

cool dich hier zu lesen :)

AFAIK you should be able to use utf-16 as encoding for most practical
pusrposes.

http://www.python.org/peps/pep-0100.html

Alternatively, it might be possible to have the mysql connection deliver
and expect the string values in a different encoding from the one the
data is stored in - at least with oracle that's possible.

Regards,

Diez B. Roggisch
Nov 3 '05 #2

P: n/a
Hi Diez :)

I tried converting the query string to utf-16 but only got weird
results. The problem might lie with the _mssql module (which pymssql is
using, it's just a wrap around _mssql) that I am using...

I'll post what I get from converting to utf-16 later, maybe you have an
idea...

Nov 4 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.