Page 1 of 1

UnicodeDecodeError while import MHX2 file

PostPosted: Tue Jun 23, 2020 1:35 am
by spkingr
I installed the plugins for Makehuman 1.20 and Blender 2.83, but it did not work, the error in Blender:

Code: Select all
Traceback (most recent call last):
  File "C:\Users\Qingwen Liu\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_runtime_mhx2\importer.py", line 57, in execute
    importMhx2File(self.filepath, cfg, context)
  File "C:\Users\Qingwen Liu\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_runtime_mhx2\importer.py", line 144, in importMhx2File
    struct, time1 = importMhx2Json(filepath)
  File "C:\Users\Qingwen Liu\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_runtime_mhx2\importer.py", line 159, in importMhx2Json
    struct = loadJson(filepath)
  File "C:\Users\Qingwen Liu\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_runtime_mhx2\load_json.py", line 39, in loadJson
    struct = json.load(fp)
  File "D:\Software\Blender\2.83\python\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 3074663: illegal multibyte sequence

location: <unknown location>:-1



Help and thanks! :geek:

Re: UnicodeDecodeError while import MHX2 file

PostPosted: Thu Jun 25, 2020 10:29 am
by joepal
It seems either the mhx file you tried to import, or possibly one of the textures it links to contained an illegal character in its file name.

Which file or what character cannot be seen here. But my guess is that the encoding "gbk" has characters which are not representable in UTF-8. Try renaming files which look suspicious so they only have english characters in their names. Also make sure the files arent in a directory with illegal characters in its name.

Re: UnicodeDecodeError while import MHX2 file

PostPosted: Mon Jun 29, 2020 4:26 am
by MTKnife
GBK is apparently a fairly common encoding for simplified Chinese characters, but it includes stuff that's not in Unicode: https://en.wikipedia.org/wiki/GBK_(character_encoding)

Note that anything in Unicode--which should include most anything in any Latin script, plus a lot of other stuff--should be work, not just English names.