Re: the stupid encoding problem to stdout
- From: Ben Finney <ben+python@xxxxxxxxxxxxxxx>
- Date: Fri, 10 Jun 2011 09:19:52 +1000
Sérgio Monteiro Basto <sergiomb@xxxxxxx> writes:
Ben Finney wrote:
In this case your shell has no preference for the encoding (since
you're redirecting output to a file).
How I say to python that I want that write in utf-8 to files ?
You already did:
In the first print statement you specify the encoding UTF-8, which
is capable of encoding the characters.
If you want UTF-8 on the byte stream for a file, specify it when opening
the file, or when reading or writing the file.
--
\ “But Marge, what if we chose the wrong religion? Each week we |
`\ just make God madder and madder.” —Homer, _The Simpsons_ |
_o__) |
Ben Finney
.
- References:
- the stupid encoding problem to stdout
- From: Sérgio Monteiro Basto
- Re: the stupid encoding problem to stdout
- From: Ben Finney
- Re: the stupid encoding problem to stdout
- From: Sérgio Monteiro Basto
- the stupid encoding problem to stdout
- Prev by Date: Re: how to inherit docstrings?
- Next by Date: Re: how to inherit docstrings?
- Previous by thread: Re: the stupid encoding problem to stdout
- Next by thread: Re: the stupid encoding problem to stdout
- Index(es):
Relevant Pages
|