Re: EBCDIC -- ASCII

2008-12-08 Thread martinjamesevans
On Dec 5, 2:13 pm, Michael Ströder [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: On Dec 4, 4:45 pm, Michael Ströder [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I'm having a problem trying to use the codecs package to aid me in converting some bytes from EBCDIC into ASCII.

Re: EBCDIC -- ASCII

2008-12-05 Thread Michael Ströder
[EMAIL PROTECTED] wrote: On Dec 4, 4:45 pm, Michael Ströder [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: I'm having a problem trying to use the codecs package to aid me in converting some bytes from EBCDIC into ASCII. Which EBCDIC variant? sEBCDIC = unicode(sSource, 'cp500', 'ignore')

EBCDIC -- ASCII

2008-12-04 Thread martinjamesevans
I'm having a problem trying to use the codecs package to aid me in converting some bytes from EBCDIC into ASCII. I have some 8bit text that is in mixed format. I extract the bytes that are coded for EBCDIC and would like to display them correctly. The bytes that are EBCDIC could values 0-255, I'm

Re: EBCDIC -- ASCII

2008-12-04 Thread Michael Ströder
[EMAIL PROTECTED] wrote: I'm having a problem trying to use the codecs package to aid me in converting some bytes from EBCDIC into ASCII. Which EBCDIC variant? sEBCDIC = unicode(sSource, 'cp500', 'ignore') Are you sure CP500 is the EBCDIC variant for the language you want?

Re: EBCDIC -- ASCII

2008-12-04 Thread Ulrich Eckhardt
[EMAIL PROTECTED] wrote: I've tried starting with something like this, but I assume it is expecting the source to be in unicode already? e.g. (pretend the second half are EBCDIC characters) sAll = This bit is ASCII, this bit ebcdic Why pretend? You can use this: abcde\x81\x82\x83\x84