void-packages/srcpkgs/ibus-anthy/patches/0001-read-utf-8-encoded-zip...

26 lines
899 B
Diff

From: NOKUBI Takatsugu <knok@daionet.gr.jp>
Date: Thu, 2 Nov 2017 15:11:52 +0900
Subject: read utf-8 encoded zipfile
---
anthy form Debian converted those zipfile to utf-8
data/zipcode-textdic.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/data/zipcode-textdic.py b/data/zipcode-textdic.py
index 6fa50d6..cb28a1f 100755
--- data/zipcode-textdic.py
+++ data/zipcode-textdic.py
@@ -21,9 +21,9 @@ if len(sys.argv) < 2:
anthy_zipfile = sys.argv[1]
try:
- contents = codecs.open(anthy_zipfile, 'r', 'euc_jp').read()
+ contents = codecs.open(anthy_zipfile, 'r', 'utf-8').read()
except UnicodeDecodeError as e:
- print('Your file is not eucJP? %s' % anthy_zipfile, file=sys.stderr)
+ print('Your file is not of UTF-8? %s' % anthy_zipfile, file=sys.stderr)
contents = open(anthy_zipfile).read()
output_zipfile = codecs.open('zipcode.t', 'w', 'utf-8')