On Thursday 07 April 2005 23:18, Angus Leeming wrote: > Ok, Lars, > > the attached file, generate_contributions.py, is a python script that > both stores and manipulates the raw data needed to create CREDITS, > credits.php and blanket-permission.php > [...] > We're not ready to use CREDITS encoded in UTF-8 yet.
This is the ideal solution. :-) > Any gurus got a python solution? That was to be expected: http://docs.python.org/lib/string-methods.html#l2h-180 Notice the second argument for encoding, by default it is 'strict', and it bails out if any error occurs. You have the explanation for the different values of the second argument here: http://docs.python.org/lib/module-codecs.html So you want probably 'ignore'. (?) > I know that I could pass the generated CREDITS file through recode but a > one-stop solution would be nice. > > $ recode 'UTF-8..ISO-8859-1' < CREDITS2 > CREDITS3 > $ diff -u CREDITS CREDITS3 | recode 'ISO-8859-1..UTF-8' | less I know, python has the batteries included. :-) -- Josà AbÃlio