If Kivy-ios is left as default, the multi-byte Japanese codec will not be installed. So change the settings and recompile.
Add the following description to Modules Setup under "kivy-ios / src / python_files /".
ModulesSetup
# for Japanese(Windows Charactor Code)
_codecs_jp cjkcodecs/_codecs_jp.c
_multibytecodec cjkcodecs/multibytecodec.c
This alone will not work with an error like "UnicodeDecodeError:'ascii' codec can't decode ....". As a result of various investigations, it seems that the default codec is ascii, so I will change the default of Python-2.7.1 to utf-8 (this will be fetched newly when compiling, so " Change gz2 in .cache "directly). Add the following files under "Lib".
sitecustomize.py
import sys
sys.setdefaultencoding("utf-8")
Now run "tools / build-all.sh" and you're ready to go.
sample
utf8data = '1234'
sjisdata = utf8data.encode('shift_jis')
print to_hex(sjisdata)
When executed, it will be converted correctly.
0x8250825182528253
[Caution] Apparently, it doesn't seem to be perfect yet, so the reverse conversion is not possible. I will update it as soon as I understand something.
Recommended Posts