Re: Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte
- From: Jarek Zgoda <jzgoda@xxxxxxxxxx>
- Date: Sat, 31 Mar 2007 12:41:46 +0200
Oleg Parashchenko napisał(a):
I spent two hours fixing it, and I hope it's done. The solution is oneCalling sys.setdefaultencoding might not even help in this case, and
of the ugliest hack I ever written, but it solves the pain. The full
story and the code is in my blog:
http://uucode.com/blog/2007/03/23/shut-up-you-dummy-7-bit-python/
the consensus is that it may be harmful to your code's portability
[1].
Yes, but I think UTF-8 is now everywhere.
No, it is not. Your own system is "not ready for UTF-8", as you stated
somewhere in this blog entry. How can you expect everybody else's system
being utf-8, while "you are not ready for transition"?
It would be better if you write your programs in encoding-agnostic way,
using byte streams only for input and output (yes, printing a debug
statement on terminal *is* a kind of producing the output). An, oh, you
cann't encode/decode text not knowing the encoding...
--
Jarek Zgoda
http://jpa.berlios.de/
.
- References:
- Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte
- From: Oleg Parashchenko
- Re: Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte
- From: Paul Boddie
- Re: Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte
- From: Oleg Parashchenko
- Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte
- Prev by Date: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed
- Next by Date: Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed
- Previous by thread: Re: Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte
- Next by thread: Re: Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte
- Index(es):
Relevant Pages
|