encoding problems (é and è)

Christoph Zwerschke cito at online.de
Thu Mar 23 10:49:56 EST 2006


bussiere bussiere wrote:
> hi i'am making a program for formatting string,
> i've added :
> #!/usr/bin/python
> # -*- coding: utf-8 -*-
> 
> in the begining of my script but
> 
>  str = str.replace('Ç', 'C')
> ...
> doesn't work it put me " and , instead of remplacing é by E

Are your sure your script and your input file *is* actually encoded with 
utf-8? If it does not work as expected, it is probably latin-1, just 
like your posting. Try changing the coding to latin-1. Does it work now?

-- Christoph



More information about the Python-list mailing list