Re: encoding ascii data for xml

2008-10-04 Thread D'Arcy J.M. Cain
On Sat, 04 Oct 2008 12:18:13 -0700 Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 4 Oct 2008 06:59:20 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > not whitespace. BTW `chr(3)` isn't "end of line" but "end of text" (ETX). > > > Hmm

Re: encoding ascii data for xml

2008-10-04 Thread John Machin
On Oct 4, 7:41 am, harrelson <[EMAIL PROTECTED]> wrote: > I have a large amount of data in a postgresql database with the > encoding of SQL_ASCII.  Most recent data is UTF-8 but data from > several years ago could be of some unknown other data type.  Being > honest with myself, I am not even sure t

Re: encoding ascii data for xml

2008-10-04 Thread Dillon Collins
On Friday 03 October 2008, harrelson wrote: > import xml.dom.minidom > print chr(3).encode('utf-8') > dom = xml.dom.minidom.parseString( "%s" % > chr(3).encode('utf-8') ) > > chr(3) is the ascii character for "end of line". [...] My > question is why doesn't encode() blow up? You just answered yo

Re: encoding ascii data for xml

2008-10-04 Thread Marc 'BlackJack' Rintsch
On Fri, 03 Oct 2008 14:41:13 -0700, harrelson wrote: > import xml.dom.minidom > print chr(3).encode('utf-8') > dom = xml.dom.minidom.parseString( "%s" % > chr(3).encode('utf-8') ) > > chr(3) is the ascii character for "end of line". I would think that > trying to encode this to utf-8 would fail

Re: encoding ascii data for xml

2008-10-03 Thread Tino Wildenhain
harrelson wrote: I have a large amount of data in a postgresql database with the encoding of SQL_ASCII. Most recent data is UTF-8 but data from several years ago could be of some unknown other data type. Being honest with myself, I am not even sure that the most recent data is always UTF-8-- da

encoding ascii data for xml

2008-10-03 Thread harrelson
I have a large amount of data in a postgresql database with the encoding of SQL_ASCII. Most recent data is UTF-8 but data from several years ago could be of some unknown other data type. Being honest with myself, I am not even sure that the most recent data is always UTF-8-- data is entered on we