Message53767
| Author |
jorend |
| Recipients |
| Date |
2003年02月22日.19:21:01 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Tested in Python 2.3a1.
If I write u'Hello\r\nworld\r\n' to a file, then read
it back in 'U' mode, I should get u'Hello\nworld\n'.
However, if I do this using codecs.open() and the
UTF-16 encoding, I get u'Hello\n\nworld\n\n'.
codecs.open() is not 'U'-mode-aware. The underlying
file is opened in universal newline mode, so the byte
'\x0d' is erroneously translated to '\x0a' before the
UTF-16 codec has a chance to decode it.
The attached unit test should show specifically what it
is that I wish would work.
|
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 16:06:21 | admin | link | issue691291 messages |
| 2007年08月23日 16:06:21 | admin | create |
|