| View previous topic :: View next topic |
| Author |
Message |
Jackil Enthusiastic Coder
Joined: 24 May 2006 Posts: 97
|
Hi guys. I got some problems with parsing a xml file while running a script on both linux and windows. Should I save the file as utf-8 on both platforms?
Reply with quote
|
| |
|
|
BigDaddy Enthusiastic Coder
Joined: 26 May 2006 Posts: 147
|
Jackil, what is the encoding of the xml file? what is giving you the option of saving as another encoding
And yes utf-8 should be OK as long as you read it back in as utf-8, and the xml parser accepts that
Reply with quote
|
| |
|
|
Jackil Enthusiastic Coder
Joined: 24 May 2006 Posts: 97
|
BigDaddy, hmm.. the encoding is specified as utf-8, but the file is fetched from a webserver though.
Reply with quote
|
| |
|
|
BigDaddy Enthusiastic Coder
Joined: 26 May 2006 Posts: 147
| |
Jackil Enthusiastic Coder
Joined: 24 May 2006 Posts: 97
| |
BigDaddy Enthusiastic Coder
Joined: 26 May 2006 Posts: 147
| |
Jackil Enthusiastic Coder
Joined: 24 May 2006 Posts: 97
|
Well, a filehandle
Which I then have created a small xml parser for
Reply with quote
|
| |
|
|
BigDaddy Enthusiastic Coder
Joined: 26 May 2006 Posts: 147
|
When reading it in, you might want to get it into unicode with stringjustread.decode('utf-8')
Reply with quote
|
| |
|
|
Jackil Enthusiastic Coder
Joined: 24 May 2006 Posts: 97
| |
BigDaddy Enthusiastic Coder
Joined: 26 May 2006 Posts: 147
|
To answer the original question, whatever worked on windows should work on linux, except that the system default encoding for 8-bit strings might be "windows-1252" and not "ascii"
Reply with quote
|
| |
|
|
| Page 1 of 3 |
Goto page 1, 2, 3 Next |
|