Re: utf8 and ftplib

2005-06-22 Thread Fredrik Lundh
Fredrik Lundh wrote: > character references refer to code points in the Unicode code > space, so you just convert the bytes you get after converting > to UTF-8. "so you cannot just", of course. -- http://mail.python.org/mailman/listinfo/python-list

Re: utf8 and ftplib

2005-06-20 Thread Fredrik Lundh
Richard Lewis wrote: > On Mon, 20 Jun 2005 14:27:17 +0200, "Fredrik Lundh" > <[EMAIL PROTECTED]> said: > > > > well, you're messing it up all by yourself. getting rid of all the > > codecs and > > unicode2charrefs nonsense will fix this: > > > Thanks for being so patient and understanding. > > OK

Re: utf8 and ftplib

2005-06-20 Thread Kent Johnson
Richard Lewis wrote: > My code now works without generating any errors but Konqueror's KHTML > and Embedded Advanced Text Viewer and IE5 on the Mac still show > capital-A-with-a-tilde in all the files that have been > generated/altered. Whereas my text editor and Mozilla show them > correctly. How

Re: utf8 and ftplib

2005-06-20 Thread Richard Lewis
On Mon, 20 Jun 2005 14:27:17 +0200, "Fredrik Lundh" <[EMAIL PROTECTED]> said: > > well, you're messing it up all by yourself. getting rid of all the > codecs and > unicode2charrefs nonsense will fix this: > Thanks for being so patient and understanding. OK, I've taken it all out. The only think

Re: utf8 and ftplib

2005-06-20 Thread Fredrik Lundh
Richard Lewis wrote: > OK, I'm still not getting this unicode business. obviously. > > aàáâã > eèéêë > iìíîï > oòóôõ > oùúûü > > > (If testing, make sure you save this as utf-8 encoded.) why? that XML snippet doesn't include any UTF-8-encoded characters. ::: >file =

Re: utf8 and ftplib

2005-06-20 Thread Richard Lewis
On Mon, 20 Jun 2005 12:37:42 +0100, "Richard Lewis" <[EMAIL PROTECTED]> said: > [SNIP] Just add to this: my input document was written using character references rather than literal characters (as was the sample output document). However, I've just noticed that my mail client (or maybe something

Re: utf8 and ftplib

2005-06-20 Thread Richard Lewis
OK, I'm still not getting this unicode business. Given this document: == aàáâã eèéêë iìíîï oòóôõ oùúûü == (If testing, make sure you save this as utf-8 encoded.) and this Python script: == import sys f

Re: utf8 and ftplib

2005-06-18 Thread Fredrik Lundh
Richard Lewis wrote: > OK, I've fiddled around a bit more but I still haven't managed to get it > to work. I get the fact that its not the FTP operation thats causing the > problem so it must be either the xml.minidom.parse() function (and > whatever sort of file I give that) or the way that I wri

Re: utf8 and ftplib

2005-06-17 Thread John Roth
"Richard Lewis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On Thu, 16 Jun 2005 12:06:50 -0600, "John Roth" > <[EMAIL PROTECTED]> said: >> "Richard Lewis" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > Hi there, >> > >> > I'm having a problem with unicode f

Re: utf8 and ftplib

2005-06-17 Thread Richard Lewis
On Thu, 16 Jun 2005 12:06:50 -0600, "John Roth" <[EMAIL PROTECTED]> said: > "Richard Lewis" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hi there, > > > > I'm having a problem with unicode files and ftplib (using Python 2.3.5). > > > > I've got this code: > > > > xml_source =

Re: utf8 and ftplib

2005-06-16 Thread John Machin
Richard Lewis wrote: > Hi there, > > I'm having a problem with unicode files and ftplib (using Python 2.3.5). > > I've got this code: > > xml_source = codecs.open("foo.xml", 'w+b', "utf8") > #xml_source = file("foo.xml", 'w+b') > > ftp.retrbinary("RETR foo.xml", xml_source.write) > #ftp.retrlin

Re: utf8 and ftplib

2005-06-16 Thread John Roth
"Richard Lewis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi there, > > I'm having a problem with unicode files and ftplib (using Python 2.3.5). > > I've got this code: > > xml_source = codecs.open("foo.xml", 'w+b', "utf8") > #xml_source = file("foo.xml", 'w+b') > > ftp.retrbin

utf8 and ftplib

2005-06-16 Thread Richard Lewis
Hi there, I'm having a problem with unicode files and ftplib (using Python 2.3.5). I've got this code: xml_source = codecs.open("foo.xml", 'w+b', "utf8") #xml_source = file("foo.xml", 'w+b') ftp.retrbinary("RETR foo.xml", xml_source.write) #ftp.retrlines("RETR foo.xml", xml_source.write) It op