Compilation Failed With 'illegal character encoding in string literal'

697 views
Skip to first unread message

awt

unread,
Jul 24, 2015, 6:35:17 AM7/24/15
to emscripten-discuss
Hi,

I have the following string literal in my program:

"élève - à la façon - château"

Emscripten reports an error 'illegal character encoding in string literal' when it encounters the string above. Has anybody come across this before?

Alon Zakai

unread,
Jul 24, 2015, 1:43:39 PM7/24/15
to emscripte...@googlegroups.com
What is the exact output? It would help to know what reports the error - the clang frontend, emscripten backend, or another part of the toolchain.

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

awt

unread,
Jul 26, 2015, 10:21:10 PM7/26/15
to emscripten-discuss, alon...@gmail.com
This is the error that I saw in the compilation stage:

xxx.cpp:49:25: error: illegal character encoding in string literal
        StringClass dummyString(L"<E9>l<E8>ve - <E0> la fa<E7>on - ch<E2>teau");

awt

unread,
Jul 27, 2015, 6:01:20 AM7/27/15
to emscripten-discuss, alon...@gmail.com, knigh...@gmail.com
Alon, it turns out that the source file that I was working on belongs to a Visual Studio project that was encoded with Windows-1252. I was able to pass compilation after saving the file with utf-8 encoding.

Alon Zakai

unread,
Jul 27, 2015, 1:45:04 PM7/27/15
to awt, emscripten-discuss
Thanks for the update. Looks like clang can't handle Windows-1252.
Reply all
Reply to author
Forward
0 new messages