TeamPBCN / Metroid-Dread

Metroid Dread localization tools
1 stars 2 forks source link

I'm having unicodedecodeEroor utf-16 problem #3

Closed himo456 closed 2 weeks ago

himo456 commented 3 weeks ago

C:\Users\HP\Desktop\New folder (9)\010093801237C000\Metroid-Dread-master>python3 .\tools\scripts\font.py create --ttf-path ".\temp\a.ttf" --charset-path ".\temp\simplified_chinese.txt" --gtbl-path ".\temp\chcglyphtable.buct" --bfnt-path-fmt ".\temp\chc{}.bfont" --mtxt-path ".\temp\chc_atlas.bctex" --mtxt-width 4096 --mtxt-height 2048 --gtbl-path-ingame "system/fonts/symbols/chc_glyphtable.buct" --mtxt-path-ingame "system/fonts/textures/chc_atlas.bctex" --32 .\temp\simplified_chinese.txt --32-useicon --52 .\temp\simplified_chinese.txt --52-ttf ".\temp\b.ttf" Traceback (most recent call last): File "C:\Users\HP\Desktop\New folder (9)\010093801237C000\Metroid-Dread-master\tools\scripts\font.py", line 386, in fire.Fire(Actions) File "C:\Users\HP\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\fire\core.py", line 143, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\HP\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\fire\core.py", line 477, in _Fire component, remaining_args = _CallAndUpdateTrace( ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\HP\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\fire\core.py", line 693, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\HP\Desktop\New folder (9)\010093801237C000\Metroid-Dread-master\tools\scripts\font.py", line 364, in create filter = open(kwargs[kw], 'r', encoding='utf-16').read() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 322, in decode File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1520.0_x64__qbz5n2kfra8p0\Lib\encodings\utf_16.py", line 61, in _buffer_decode codecs.utf_16_ex_decode(input, errors, 0, final) UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 126190: truncated data

LITTOMA commented 3 weeks ago

Make sure that ".\temp\simplified_chinese.txt" is UTF-16LE encoded.

himo456 commented 2 weeks ago

Thanks