diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2014-10-29 02:09:31 +0100 |
---|---|---|
committer | Sebastian Pipping <sebastian@pipping.org> | 2014-10-29 02:09:35 +0100 |
commit | 525e6b4807ba338b11921849c53ba05f939e53db (patch) | |
tree | 5a5aa6fe8293f546ce2740afd9b1960c4daa4246 | |
parent | Fix crash for locale without explicit encoding (Gentoo bug #527240) (diff) | |
download | elogv-0.7.6.6.tar.gz elogv-0.7.6.6.tar.bz2 elogv-0.7.6.6.zip |
Save one round of encoding/decoding back and forth0.7.6.6
-rwxr-xr-x | elogv | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -189,12 +189,13 @@ def date2str(d): raise ValueError('Cannot decode byte stream') try: - u.encode('ascii') + b = u.encode('ascii') except UnicodeEncodeError: # Prevent crash locales like ja_JP.UTF-8, e.g. "2014年10月24日" # https://bugs.gentoo.org/show_bug.cgi?id=464962 - u = u.encode('ascii', errors='replace').decode('ascii') - return u + b = u.encode('ascii', errors='replace') + + return b # Main class (called with curses.wrapper later) class ElogViewer: |