Writing UTF-8 string to UNICODE file

Peter Hansen peter at engcorp.com
Tue Nov 11 12:49:17 EST 2003


Michael Weir wrote:
> 
> I'm sure this is a very simple thing to do, once you know how to do it, but
> I am having no fun at all trying to write utf-8 strings to a unicode file.
> Does anyone have a couple of lines of code that
> - opens a file appropriately for output
> - writes to this file

I can't give you an example, never having done this, but if you would post
a few lines of your own code which you thought would work, someone can probably
point out the error of your ways more easily than writing something from
scratch.  (Of course, we'll shortly see a complete working solution from
someone anyway, but in general this is the better way to proceed with such
a problem.)

-Peter




More information about the Python-list mailing list