[JW Lua] FCString:CreateEnigmaStrings doesn't work on long unicode strings, but on short ones

Jan Angermüller jan at angermueller.com
Thu Jul 9 18:30:33 CEST 2015


Jari,
>> it's only the i.LuaString that troubles me.
>
> Yes, since the LuaString method returns an 8-bit (UTF-8) string. If 
> the UTF-16 to UTF-8 conversion is unknown and fails, the string will 
> be empty.
But why does it fail to convert THREE identical symbols in a row, while 
it succeeds when converting the same TWO identical symbols in a row. It 
is always the same UTF conversion.
And why does it succeed again in converting the three identical symbols 
when they were preceded by an ascii symbol ? (e.g. char(36) .. 0xe050 .. 
0xe050 .. 0xe050  works fine in a LuaString while  0xe050 .. 0xe050 .. 
0xe050 doesn't)

> Don't use LuaString for Unicode symbols that aren't in the standard 
> Unicode text range.
What range do you mean exactly with "unicode text range" ? 0-128, 0-255, 
0-1FFF, 0-DFFF or 0-FFFF ?

Well, anyway, as this unexpected behaviour doesn't occur with my 
user-defined CreateEnigmaStrings which uses the ascii insert method from 
above as a workaround, I have at least found a working solution for 
manipulating unicode strings with CreateEnigmaStrings.

All the best,
Jan





More information about the JWLua mailing list