Fix UT8 handling in fs_writefile
Fixes https://github.com/armory3d/armortools/issues/1768 Thanks to @shiena s investigation it was easy to see that non ascii utf8 glyphs where handled incorrectly because they take more than one byte. charCodeAt retrieves a utf16 code point though because JavaScript stores string in utf16 encoding internally. Therefore the solution to convert to utf8 first.
@MathemanFlo I tried this patch. The correct character encoding was output in Japanese, so it seems to be OK.
Thanks for figuring out what's wrong! I found a FILE.puts(str) method at https://bellard.org/quickjs/quickjs.html which seems to do the trick. Will do some more testing.
https://github.com/armory3d/armorcore/commit/c24dfade5ecc2627bd5faa69044cc346053062b0