redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers

Ask your IT question here

troubles with unicode


Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    Programming Forums -> Python programming forum
View previous topic :: View next topic  
Author Message
Jackil
Enthusiastic Coder


Joined: 24 May 2006
Posts: 97
the system default encoding on window here was ascii
I actually got some problems when parsing the xml-file, because it also contains a string to save another file.

Reply with quote
 
BigDaddy
Enthusiastic Coder


Joined: 26 May 2006
Posts: 147
Huh? what do you mean "a string to save another file"
Embedded python code? a xml reference to another file?

Reply with quote
 
Jackil
Enthusiastic Coder


Joined: 24 May 2006
Posts: 97
sorry, one of the fields contains a filename
Which might contain characters not found in ascii

Reply with quote
 
BigDaddy
Enthusiastic Coder


Joined: 26 May 2006
Posts: 147
How do you want to handle those? will your small homebuilt xml parser accept unicode strings?
Reply with quote
 
Jackil
Enthusiastic Coder


Joined: 24 May 2006
Posts: 97
I have no idea, I'm using xml.saxtils to create an xml handler. But I'm really confused if I should enforce utf-8 to avoid problems when both storing and reading the file.
Reply with quote
 
BigDaddy
Enthusiastic Coder


Joined: 26 May 2006
Posts: 147
The transition to unicode is a pain in the ass. luckily im an american and can just ignore it
Reply with quote
 
Jackil
Enthusiastic Coder


Joined: 24 May 2006
Posts: 97
BigDaddy, I'm really just looking for a solution to both be able to store filenames with local characters on both linux and windows, and the be able get the names back in a readable form.
But this whole character thing really confuses me...

Reply with quote
 
BigDaddy
Enthusiastic Coder


Joined: 26 May 2006
Posts: 147
Jackil, if the xml file is coming back as utf-8 you need to be aware of that and read it in as utf-8 (by reading the string and then getting a new unicode string from that with .decode('utf-8'))
Jackil, or verify (or teach) the xml parser knows utf-8 (i doubt it)

Reply with quote
 
Jackil
Enthusiastic Coder


Joined: 24 May 2006
Posts: 97
BigDaddy, oki, the filesystem on linux is using utf-8. But would it be easier to just let the web-server enforce iso?
Reply with quote
 
BigDaddy
Enthusiastic Coder


Joined: 26 May 2006
Posts: 147
The other issue is, is the other end really putting utf-8 into the xml file, or is it just the local filename in whatever encoding the filesystem or whatever generated the xml is using
Because if the server is SAYING its utf-8 but its actually Latin-1 in the fields, you are in trouble ;)

Reply with quote
 
Page 2 of 3 Goto page Previous  1, 2, 3  Next
Post new topic   Reply to topic    Programming Forums -> Python programming forum


Dubai Forums - Expat Help | Vegan Chat | Java Programming | Free 3D tutorials and 3d textures | Paris Forum | EU Forum
Free Dubai Classifieds | Free London Classifieds | Jobs in London

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Powered by phpBB © 2001, 2005 phpBB Group