From 96793f8938c49e0f9d8c1308d0250232a2c66299 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 29 May 2017 16:39:10 +1000 Subject: src/lutf8lib.js: Push correct charpattern to_luastring breaks due to encoding issues --- src/lutf8lib.js | 4 ++-- 1 file 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; }; -- cgit v1.2.3-70-g09d2