From e356991b0500d282198c70d14a30a8216361c081 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 29 May 2017 16:41:07 +1000 Subject: src/lutf8lib.js: Use String.fromCodePoint so that astral characters work --- src/lutf8lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lutf8lib.js b/src/lutf8lib.js index 803898b..b69abb0 100644 --- a/src/lutf8lib.js +++ b/src/lutf8lib.js @@ -80,7 +80,7 @@ const utflen = function(L) { 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.fromCharCode(code))); + lua.lua_pushstring(L, lua.to_luastring(String.fromCodePoint(code))); }; /* -- cgit v1.2.3-54-g00ecf