473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

python, mssql and unicode

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
2 3587
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: francisl | last post by:
We have to build some script were I work to make a dynamic server inventory. But, the project team, a windows crew, start it all in vbscript and on mssql. Note, due to political reason, we can...
13
by: Graham | last post by:
I need a SQL Server or ODBC package for Python. Can anyone help please? Have search the Python packages under Database and there is no reference to either SQL Server or ODBC. Thanks Graham
8
by: eugenio | last post by:
Hi...not sure if this is the right group for this posting, but i'm don't know where else to post. I've got a simple problem...I have a linux box running apache 2.0 and php5. I'm trying to use the...
3
by: Shawn Beasley | last post by:
Hi List, I am searching franticly for a solution (or the procedure) to setting the coding of a new DB to UTF-8. I can find no setting in the Server Manager, during creation of the DB, to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.