473,672 Members | 2,641 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.setdefaulte ncoding('dbcs') in
my sitecustomize.

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

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

qvx

Sep 28 '05 #1
1 1637
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.setdefaulte ncoding('dbcs') in
my sitecustomize.

How can I save data like "šdccž"?
This is equivalent to '\x9a\xf0\xe8\x e6\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\x f0\xe8\xe6\x9e' , 'dbcs'). As your system default encoding
is 'dbcs', even unicode('\x9a\x f0\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
1628
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 I'd like some advice. I'm writing an app using SQLite as the database backend, and interfacing to it via SQLObject. I have all my SQL table definitions (classes inheriting from SQLObject) in one module, and for simplicity's sake I'm using a...
24
9047
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 charcaters from an ASCII perspective. I get the following error: > SQLiteCur.execute(sql, row)
0
1167
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 prolonged. Meanwhile the stable 0.7 branch will be maintained, and there will be at least 0.7.3 release. What is SQLObject =================
0
1057
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 classes, and rows are instances of those classes. SQLObject is meant to be
0
1005
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, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started with.
2
1403
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 classes, and rows are instances of those classes. SQLObject is meant to be
0
871
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 classes, and rows are instances of those classes. SQLObject is meant to be
4
1478
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 "displeje_pokus.txt" (you can see the simplified contents of the files bellow). When I run "python displeje_pokus.py" I am getting an error (see
0
1105
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 database tables are described
0
8486
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8931
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8828
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8608
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6238
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4418
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
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 we have to send another system
2
2063
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.