aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-29 16:39:10 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-29 16:42:12 +1000
commit96793f8938c49e0f9d8c1308d0250232a2c66299 (patch)
tree09bc9127c6a67f61ada9d7152942c49096032090 /src
parent7cbf48bd75d12509c876bd658f98617b753fff21 (diff)
downloadfengari-96793f8938c49e0f9d8c1308d0250232a2c66299.tar.gz
fengari-96793f8938c49e0f9d8c1308d0250232a2c66299.tar.bz2
fengari-96793f8938c49e0f9d8c1308d0250232a2c66299.zip
src/lutf8lib.js: Push correct charpattern
to_luastring breaks due to encoding issues
Diffstat (limited to 'src')
-rw-r--r--src/lutf8lib.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lutf8lib.js b/src/lutf8lib.js
index 3c9147a..803898b 100644
--- a/src/lutf8lib.js
+++ b/src/lutf8lib.js
@@ -217,11 +217,11 @@ const funcs = {
};
/* pattern to match a single UTF-8 character */
-const UTF8PATT = "[\0-\x7F\xC2-\xF4][\x80-\xBF]*";
+const UTF8PATT = [ 91, 0, 45, 127, 194, 45, 244, 93, 91, 128, 45, 191, 93, 42 ];
const luaopen_utf8 = function(L) {
lauxlib.luaL_newlib(L, funcs);
- lua.lua_pushstring(L, lua.to_luastring(UTF8PATT));
+ lua.lua_pushstring(L, UTF8PATT);
lua.lua_setfield(L, -2, lua.to_luastring("charpattern", true));
return 1;
};