Chris Angelico <[email protected]>:
> Here's how I'd do it.
>
> $ python3
>>>> with open("source1", encoding="iso-8859-1") as source,
>> open("target", "w", encoding="utf-8") as target:
> ... target.write(source.read())
You might run out of memory. How about:
========================================================================
#!/usr/bin/env python3
import shutil
shutil.copyfileobj(
open("source1", encoding="iso-8859-1"),
open("target", "w", encoding="utf-8"))
========================================================================
Marko
--
https://mail.python.org/mailman/listinfo/python-list