/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/lua/unicode_strings_runme.lua
16 строк
739 B
Erez Geva
More Lua tests (#3405)
31 май 2026, 17:09
31 май 2026, 17:09
a1b3ca8
Код
Авторство
О чём код?
require("unicode_strings") -- Lua do not support any characters coding -- For any non-ASCII character we use the '\<decimal>' escape sequance notation per byte! -- E9(233) is passed as is -- ISO 8859-1/Latin-1 small letter o with diaeresis U+00F6 tranlate to C3(195) B6(182) local test_string = "h\233llo w\195\182rld" assert(unicode_strings.non_utf8_c_str() == test_string) assert(unicode_strings.non_utf8_std_string() == test_string) local test2 = "\212\182\t\172" assert(unicode_strings.charstring(test2) == test2) -- zero value is regard as null termination on C -- C++ std::string and C string with explicit length do support zero values! local test3 = "\212\182\t\172\0afterNull" assert(unicode_strings.charstring(test3) ~= test3)