ISO Latin -> HTML conversion

Olivier Dagenais olivierS.dagenaisP at canadaA.comM
Fri Jul 7 14:24:49 EDT 2000


I think the map function was designed for something like this.. (???)

--
----------------------------------------------------------------------
Olivier A. Dagenais - Carleton University - Computer Science III


"Danny Yee" <danny at thrud.anatomy.usyd.edu.au> wrote in message
news:8k4r6p$p1v$1 at thrud.anatomy.usyd.edu.au...
> I need to convert text with ISO Latin characters to HTML, e.g.
> I want to map é to é and so forth.
>
> I can do this by reading in a wopping big file
> ('À', 'À'),
> ('Á', 'Á'),
> ('Â', 'Â'),
> ('Ã', 'Ã'),
> .
> .
>
> and then going
> for pair in fix_list:
> line = re.sub(pair[0], pair[1], line)
> as I read each line... but there has to be something quicker than that,
> surely.  Is there a fast way to do this?
>
> Danny.
>
>
>





More information about the Python-list mailing list