Actually that's what I tried to do, for example:
outputString = myString.encode('iso-8859-1','ignore')

However, I always get such messages (the character, that's causing problems 
varies, but its always higher than 127 ofc...)

'ascii' codec can't decode byte 0xc3 in position 51: ordinal not in range(128) 

It doesn't matter what encoding I use (tried 'utf-8' 'utf-16' 'latin_1' and the 
iso one). The debugger is showing all the special characters (from french and 
german language) so I'm wondering why there's still the message about the 
'ascii' codec...

Would that mean that the string "myString" is an ascii-string or what?

-----Original Message-----
From: Marc 'BlackJack' Rintsch [mailto:[EMAIL PROTECTED] 
Sent: Donnerstag, 20. März 2008 15:24
To: python-list@python.org
Subject: Re: Problem with PARAGRAPH SEPARATOR

On Thu, 20 Mar 2008 13:03:17 +0000, Dominique.Holzwarth wrote:

> The output of the transformation (a big string containg the whole 
> file) contains a so called 'paragraph separator' (unicode: 2029). If I 
> want to pring that string (file) to the std out or a file object then 
> I get a "UnicodeError" saying that the unicode 2029 can't be encoded...
> 
> Can anyone please tell me how I should handle that paragraph seperator?

You have to encode the unicode object in an encoding that know this character.  
UTF-8 might be a candidate encoding for this.

Ciao,
        Marc 'BlackJack' Rintsch


*********************************
This e-mail and any files attached are strictly confidential, may be legally 
privileged and are intended solely for the addressee. If you are not the 
intended recipient please notify the sender immediately by return email and 
then delete the e-mail and any attachments immediately. The views and or 
opinions expressed in this e-mail are not necessarily the views of De La Rue 
plc or any of its subsidiaries and the De La Rue Group of companies, their 
directors, officers and employees make no representation about and accept no 
liability for its accuracy or completeness. You should ensure that you have 
adequate virus protection as the De La Rue Group of companies do not accept 
liability for any viruses 
De La Rue plc Registered No.3834125, De La Rue Holdings plc Registered No 58025 
and De La Rue International Limited Registered No 720284 are all registered in 
England with their registered office at: De La Rue House, Jays Close, Viables, 
Hampshire RG22 4BS
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to