Modify

Opened 13 years ago

Last modified 13 years ago

#8741 assigned defect

UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc'

Reported by: didley@… Owned by: ethanole
Priority: normal Component: DailyReminderScriptForTracScript
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Hello,

I'm using german umlauts for description and summary field. If I have german umlaut I got the error above.

I changed code in, see below,

if mysql:
    import MySQLdb
if pgsql:
    import psycopg2
if sqlite:
#    from pysqlite2 import dbapi2 as sqlite
     import sqlite3 as sqlite

because pysqlite2 wouldn't found. Without any german umlaut it works fine.

I'm using Trac 0.12.2 Is it possible to change the code in a short way for using german umlaut?

Attachments (0)

Change History (2)

comment:1 Changed 13 years ago by didley@…

Now I have seen I have to use python 2.6. I'm using Python 2.5. Is this the reason why I got this error?

comment:2 Changed 13 years ago by anonymous

Status: newassigned

Hello Didley,

hm... strange problem. I'm using hungarian localisation, and we have also umlaut-like charachters, some are in the german abc too: 'á', 'é', 'í', 'ó', 'ö', 'ő', 'ú', 'ü', 'ű', but not using a-umlaut: 'ä' und keine 'ß' ;)

I think it is python related and pysqlite related. Python 3 has solved any unicode errors, but I did not test the script on that. Python 2.5 and 2.6 are having so much difference that I cannot state surely: thats the root of the problem. Python versions 2.x are aware of unicode, but they are using internal ascii codepage and they have to translate between unicode-ascii-unicode. Python 3.x is handling every string as a unicode string (as far as I know).

Of course if pysqlite is not fully compatible with python 2.5, then this could be a reason, too.

If it works well with sqlite3 module on python 2.5 feel free to use it :)

Anyway I have this problem in another script what is an email filter (so every characters in the world might be existing during the process).

eth

Modify Ticket

Change Properties
Set your email in Preferences
Action
as assigned The owner will remain ethanole.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.