SOS - unicode problems...

kepes.krisztian kepes.krisztian at peto.hu
Tue Nov 23 09:50:46 EST 2004


Hi !

I use iso-8859-2 chrset (win1250), because I'm hungarian.

I create an audio tagger program in the past, but I found a problem in it.

I have the problem in the unicode string handling.

The error line is that:

nfn=track+\'/\'+alb+\'/\'+title+\'.mp3\'

It is concat the substrings for file rename.
Some of these string items are unicode, some of these not.
So I want to set unicode for all items before that line.
alb=unicode(alb)
# alb=\'Zörr\' (album value is 'Zörr', where ö is o: (/xf6), a hung. 
character).
# it is came from a filename !

But it is drop error !

See this example that show the problem:

s=\'Zörr\'
s=u\'x\'+s+u\'y\'
print s

or

s='Z\xf6rr'
s=u'x'+s+u'y'
print s


It is drop an error.
How to prevent this error, and convert (concat) the substrings to good 
unicode string.

Please help me !
Thanx for it:
KK



More information about the Python-list mailing list