afdko icon indicating copy to clipboard operation
afdko copied to clipboard

Encoding problem?

Open NightFurySL2001 opened this issue 3 years ago • 3 comments

I am trying to build a font with makeotf as below:

PS E:\edit old dot\build_final_otf> makeotf -f cidfont.ps -omitMacNames -ff features.CN -fi cidfontinfo.CN -mf FontMenuNameDB.SUBSET -r -nS -cs 25 -ch UniSourceHanSansCN-UTF32-H -ci SourceHanSans_CN_sequences.txt
makeotf [Warning] Could not find an Adobe CMAP Mac encoding mapping file. If you want a Mac cmap subtable, please specify the Mac CMAP encoding file with the '-cm' option.
makeotf [Note] setting the USE_TYPO_METRICS OS/2 fsSelection bit 7 from fontinfo keyword.
makeotf [Note] setting the WEIGHT_WIDTH_SLOPE_ONLY OS/2 fsSelection bit 8 from fontinfo keyword.
makeotf [Note] setting the OBLIQUE OS/2 fsSelection bit 9 from fontinfo keyword.
Traceback (most recent call last):
  File "c:\users\username\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\username\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\username\AppData\Local\Programs\Python\Python39\Scripts\makeotf.exe\__main__.py", line 7, in <module>
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\afdko\makeotf.py", line 2775, in main
    runMakeOTF(makeOTFParams)
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\afdko\makeotf.py", line 2664, in runMakeOTF
    success = fdkutils.run_shell_command_logging(params)
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\afdko\fdkutils.py", line 112, in run_shell_command_logging
    out = proc.communicate()[0]
  File "c:\users\username\appdata\local\programs\python\python39\lib\subprocess.py", line 1117, in communicate
    stdout = self.stdout.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xab in position 554: illegal multibyte sequence

My system have used Chinese (PRC) in the settings for localization, and Python by default reads all files as GBK. Does this requires a fix?

NightFurySL2001 avatar May 19 '21 11:05 NightFurySL2001