Unicode File Python Error in compile_b4w.py
19 July 2017 21:15
Hi,
When I compile an application, the process fails due to a Unicode read error in compile_b4w.py. I am running B4W 17.06.
I have also seen this behavior in 17.04, but I was waiting for 17.06 to test because Ivan suggested a fix for a related issue was coming in 17.06.
https://www.blend4web.com/en/forums/topic/3184/
If anyone else is having this issue, change line 434 in compile_b4w.py
from:
f = open(abs_path)
to:
f = open(abs_path,encoding="UTF8")
per Ivan's suggestion in the other thread.
I am running Windows 10 and use Notepad++ as my text editor.
Here is the error message from python:
Traceback (most recent call last):
File "D:\blend4web_ce\scripts\compile_b4w.py", line 567, in
run()
File "D:\blend4web_ce\scripts\compile_b4w.py", line 296, in run
append_externs_items(SRC_EXT_FILES, externs_js, externs_gen_file)
File "D:\blend4web_ce\scripts\compile_b4w.py", line 435, in append_externs_items
text = f.read()
File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1500: character maps to
Thanks,
Jem
When I compile an application, the process fails due to a Unicode read error in compile_b4w.py. I am running B4W 17.06.
I have also seen this behavior in 17.04, but I was waiting for 17.06 to test because Ivan suggested a fix for a related issue was coming in 17.06.
https://www.blend4web.com/en/forums/topic/3184/
If anyone else is having this issue, change line 434 in compile_b4w.py
from:
f = open(abs_path)
to:
f = open(abs_path,encoding="UTF8")
per Ivan's suggestion in the other thread.
I am running Windows 10 and use Notepad++ as my text editor.
Here is the error message from python:
Traceback (most recent call last):
File "D:\blend4web_ce\scripts\compile_b4w.py", line 567, in
run()
File "D:\blend4web_ce\scripts\compile_b4w.py", line 296, in run
append_externs_items(SRC_EXT_FILES, externs_js, externs_gen_file)
File "D:\blend4web_ce\scripts\compile_b4w.py", line 435, in append_externs_items
text = f.read()
File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 1500: character maps to
Thanks,
Jem