473,513 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with unicode and sqlobject/pysqlite2

qvx
I really can't seem to make sqlobject/pysqlite2 save my local Easter
European characters.

I am a Windows-1250 user and I have sys.setdefaultencoding('dbcs') in
my sitecustomize.

How can I save data like "šdccž"?
This is equivalent to '\x9a\xf0\xe8\xe6\x9e'

I'm using the latest version of sqlobject from SVN.

qvx

Sep 28 '05 #1
1 1624
qvx wrote:
I really can't seem to make sqlobject/pysqlite2 save my local Easter
European characters.

I am a Windows-1250 user and I have sys.setdefaultencoding('dbcs') in
my sitecustomize.

How can I save data like "šdccž"?
This is equivalent to '\x9a\xf0\xe8\xe6\x9e'

I'm using the latest version of sqlobject from SVN.


I can't speak for SQLObject (yet), but if you want to insert text data
using pysqlite, you have to either encode them to UTF-8 or use unicode
strings.

You can convert to unicode strings using
unicode('\x9a\xf0\xe8\xe6\x9e', 'dbcs'). As your system default encoding
is 'dbcs', even unicode('\x9a\xf0\xe8\xe6\x9e') would be enough.

HTH,

-- Gerhard

Sep 28 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1617
by: Robin Munn | last post by:
I've been loving SQLObject. The ability to set up a database connection and then completely *forget* about it and just manipulate Python objects has been great. But I'm running into a problem, and...
24
8993
by: ChaosKCW | last post by:
Hi I am reading from an oracle database using cx_Oracle. I am writing to a SQLite database using apsw. The oracle database is returning utf-8 characters for euopean item names, ie special...
0
1160
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.8.0b1 release of SQLObject. This is the first beta of the new branch. Taking into account that it is a result of rather large job the beta period will be...
0
1045
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.8.0b3 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as...
0
996
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.7.4 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as classes,...
2
1394
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.8.1 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as...
0
865
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.8.2 release of SQLObject. What is SQLObject ================= SQLObject is an object-relational mapper. Your database tables are described as...
4
1473
by: petr.jakes.tpc | last post by:
Hi, inspired by the article written by Tarek Ziade in the February 07 issue of the "Linux +" magazine I am experimenting with the doctest module. I have two files, "displeje_pokus.py" and...
0
1096
by: Oleg Broytmann | last post by:
Hello! I'm pleased to announce the 0.10.0b1, the first beta release of a new SQLObject branch, 0.10. What is SQLObject ================= SQLObject is an object-relational mapper. Your...
0
7265
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
7545
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...
0
7539
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5095
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.