Bug#859294: hunspell-dict-ko: FTBFS: UnicodeDecodeError: 'ascii' codec can't decode byte 0xed in position 38: ordinal not in range(128)
OK I found a way of specifying the encoding of the I/O files.
diff --git a/make-aff-dic.py b/make-aff-dic.py
index 47dff10..98aba41 100644
--- a/make-aff-dic.py
+++ b/make-aff-dic.py
@@ -308,9 +308,9 @@ if __name__ == '__main__':
dic = Dictionary()
for filename in infilenames:
if filename.endswith('.json'):
- dic.load_json(open(filename))
+ dic.load_json(open(filename, encoding='utf-8'))
else:
print('ERROR: unknown file type: ' + filename)
sys.exit(1)
dic.process()
- dic.output(open(afffilename, 'w'), open(dicfilename, 'w'))
+ dic.output(open(afffilename, 'w', encoding='utf-8'),
open(dicfilename, 'w', encoding='utf-8'))
2017-04-05 12:44 GMT+09:00 Changwoo Ryu <cwryu@debian.org>:
> It only fails on a legacy non-Unicode locale, such as "C".
>
> So what is a solution? Specifying a UTF-8 locale and Build-Depending
> on locales-all do not seems to be a right way.
Reply to: