HTML5 Build Error UnicodeDecodeError: 'ascii'

Whenever I try to build my HTML5 project, I keep getting this error.

UATHelper: Packaging (HTML5):       File "F:\UE_4.20\Engine\Extras\ThirdPartyNotUE\emsdk\emscripten\1.37.19\emcc", line 13, in <module>
UATHelper: Packaging (HTML5):         emcc.run()
UATHelper: Packaging (HTML5):       File "F:\UE_4.20\Engine\Extras\ThirdPartyNotUE\emsdk\emscripten\1.37.19\emcc.py", line 1483, in run
UATHelper: Packaging (HTML5):         final = shared.Building.llvm_opt(final, link_opts, DEFAULT_FINAL)
UATHelper: Packaging (HTML5):       File "F:\UE_4.20\Engine\Extras\ThirdPartyNotUE\emsdk\emscripten\1.37.19\tools\shared.py", line 1886, in llvm_opt
UATHelper: Packaging (HTML5):         proc = Popen([LLVM_OPT] + inputs + opts + ['-o', target], stdout=PIPE)
UATHelper: Packaging (HTML5):       File "F:\UE_4.20\Engine\Extras\ThirdPartyNotUE\emsdk\Win64\python\2.7.5.3_64bit\lib\subprocess.py", line 711, in __init__
UATHelper: Packaging (HTML5):         errread, errwrite)
UATHelper: Packaging (HTML5):       File "F:\UE_4.20\Engine\Extras\ThirdPartyNotUE\emsdk\Win64\python\2.7.5.3_64bit\lib\subprocess.py", line 907, in _execute_child
UATHelper: Packaging (HTML5):         args = list2cmdline(args)
UATHelper: Packaging (HTML5):       File "F:\UE_4.20\Engine\Extras\ThirdPartyNotUE\emsdk\Win64\python\2.7.5.3_64bit\lib\subprocess.py", line 646, in list2cmdline
UATHelper: Packaging (HTML5):         return ''.join(result)
UATHelper: Packaging (HTML5):     UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)
PackagingResults: Error: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)
UATHelper: Packaging (HTML5):   ERROR: UBT ERROR: Failed to produce item: F:\UE4 PROJECTS\ArchiWeb\Binaries\HTML5\ArchiWeb.js
UATHelper: Packaging (HTML5):          (see C:\Users\ヒロ\AppData\Roaming\Unreal Engine\AutomationTool\Logs\F+UE_4.20\UBT-ArchiWeb-HTML5-Development_3.txt for full exception trace)
PackagingResults: Error: UBT ERROR: Failed to produce item: F:\UE4 PROJECTS\ArchiWeb\Binaries\HTML5\ArchiWeb.js

(It was working fine at first with no issues and I have been always building properly, after a day of work, i thought about trying to build again and I just couldn’t find out how to fix it)
tried :

  • installing emscripten 1.21.0

  • activating it

  • fully rebuilding

  • changing

    from:
    attrs = ctypes.windll.kernel32.GetFileAttributesW(unicode(filepath))

    to:
    attrs = ctypes.windll.kernel32.GetFileAttributesW( filepath )
    in the file packager.py

here is my full log file

I appreciate all help, thank you!

note: when upgrading the emscripten toolchain – you will also need to re-build the Thirdparty libraries used on HTML5 packaging. jic you’re interested in doing this, the latest set of instructions are found here:

and read all of the README.*.md files

that said, you might have a stray “string/character” that’s not (e.g.) utf8 – and emscripten (that’s currently python2 powered) hit against. please see this for details:

meaning, ensure you didn’t copy and paste "auto formated’ strings into your project. (e.g. copying text from a word doc – where the straight double quote " is different to the curly open “ and curly closing ”)

Thank you for your answer.
I have rebuilt the whole engine including the “Thirdparty libraries”

I also checked over 7 times variable by variable.
There were no weird characters. All what I have typed was (a-z, A-Z, 0-9)
I even had a + and I removed it.
Still the same error.

Is there a possibility to send you privately the blueprints to check it up? or any other suggestions?

Thank you.

  • installed UE4.21.2

  • Created a new C++ empty project.

  • Tried to package for HTML5

  • I receive :

LogPlayLevel: Error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)

LogPlayLevel: Error: ERROR: UBT ERROR: Failed to produce item: F:\UE4 PROJECTS\ArchDev421\Binaries\HTML5\ArchDev421.js

are you using the new emscripten toolchain when using the new 3rdparty libs?

you need to ensure that when UE4 packages HTML5 that it is using the new version (new toolchain binaries can only work with libs built with same toolchain). so, make sure the version number match (the folder numbers from the README files i mentioned above):

and finally – to help you see what’s going on with the build, enable EMCC_DEBUG to print terse build commands. this may help narrow down what’s going on with your build (uncomment the following line and then recompile UnrealBuildTool in visual studio):

is this packaging done with the stock binaries and 3rd party libs? (i.e. no custom rebuilds or modified versions of the toolchain?)

Thank you for your help, nick.shin.

Yes it was definitely directly after installing all pre-reqs of UE4 and UE4.21.2 release itself.

I didn’t change any 3rd party file in that new version. Maybe I have to edit the EnvVars? Do you have any suggestion over that point? as I followed all the links that you sent me and couldn’t achieve a specific solve.

However, fortunately, I could package a project on another PC. So I believe it was due from this one.

Eventually if I didn’t have a solution on my current Workstation,
I will format it fully and make sure everything is deleted this time so I could make it packages like the other PC.