Hi,

after the fight with Unicode, I want to share some stuff I and Gustavo
found out to help other people.

First: both str and unicode can handle encodings, but converting
between these two may cause a crash. The problem is the default
encoding, which is ascii. 

Our inputs are mainly stuff from the os functions, xml files and
metadata. Right now, stuff from the filesystem is stored as str, the
xml parser is unicode. I don't want to change that, but keep that in
mind. The output is the osd and os functions again. Pygame can handle
unicode, so no need to convert. The os functions may handle unicode,
that depends on the encoding. Better not to put unicode objects to
them. 

How to convert: please use the functions 'Unicode' and 'String' and
not 'unicode' and 'str' to convert strings from one type to
another. Even better: try to avoid conversions since pygame can handle
unicode. So we have to rething all the string.encode('latin-1') in our
code. Do we need them? Rememeber: xml is Unicode, pygame can handle
this. If someone has some free time, maybe he/she can look over the tv
stuff to check it.


Dischi

-- 
Misfortune, n.:
        The kind of fortune that never misses.
                -- Ambrose Bierce, "The Devil's Dictionary"



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to