r = m_pASEngine->SetEngineProperty(asEP_SCRIPT_SCANNER, 1);
r = m_pASEngine->SetEngineProperty(asEP_STRING_ENCODING, 0);
Using characters such as in AS
I'm having trouble trying to send characters such as ãéíàáç, etc. from my script code to the application although I have turned on the UTF-8 encoding. As far as I know, these characters (used in portuguese, spanish and french) are included in the UTF-8 (I might be wrong). The AS engine returns a warning saying thar I'm using invalid unicode sequences, and my program prints messed up strings. Any hint?
...
You may want to pick up the latest WIP of AngelScript. I fixed a bug regarding this in revision 534.
If asEP_SCRIPT_SCANNER is set to 1 (default) the script code is assumed to be encoded in UTF-8. If it is not, and the string constants contain ANSI characters above 127 then you will get this error.
Make sure you save the scripts in UTF-8 format. Text editors that support this (including Notepad.exe) usually includes the BOM character at the start of the file. For UTF-8 this is the three byte sequence, 0xEF, 0xBB, 0xBF.
If you do not want to use unicode, then set the asEP_SCRIPT_SCANNER to 0, in which case the scripts will be compiled 'as-is' without any attempts to interpret the bytes in the string constants. You'll need the bug fix mentioned above if you do this.
Regards,
Andreas
If asEP_SCRIPT_SCANNER is set to 1 (default) the script code is assumed to be encoded in UTF-8. If it is not, and the string constants contain ANSI characters above 127 then you will get this error.
Make sure you save the scripts in UTF-8 format. Text editors that support this (including Notepad.exe) usually includes the BOM character at the start of the file. For UTF-8 this is the three byte sequence, 0xEF, 0xBB, 0xBF.
If you do not want to use unicode, then set the asEP_SCRIPT_SCANNER to 0, in which case the scripts will be compiled 'as-is' without any attempts to interpret the bytes in the string constants. You'll need the bug fix mentioned above if you do this.
Regards,
Andreas
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement