summaryrefslogtreecommitdiff
path: root/src/lutf8lib.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lutf8lib.js')
-rw-r--r--src/lutf8lib.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lutf8lib.js b/src/lutf8lib.js
index 722d9f1..58533cf 100644
--- a/src/lutf8lib.js
+++ b/src/lutf8lib.js
@@ -76,10 +76,11 @@ const utflen = function(L) {
return 1;
};
+const p_U = lua.to_luastring("%U");
const pushutfchar = function(L, arg) {
let code = lauxlib.luaL_checkinteger(L, arg);
lauxlib.luaL_argcheck(L, 0 <= code && code <= MAXUNICODE, arg, lua.to_luastring("value out of range", true));
- lua.lua_pushstring(L, lua.to_luastring(String.fromCodePoint(code)));
+ lua.lua_pushfstring(L, p_U, code);
};
/*