summaryrefslogtreecommitdiff
path: root/tex/context/base/l-unicode.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/l-unicode.lua')
-rw-r--r--tex/context/base/l-unicode.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/tex/context/base/l-unicode.lua b/tex/context/base/l-unicode.lua
index 813ffd54b..cf0c93d4f 100644
--- a/tex/context/base/l-unicode.lua
+++ b/tex/context/base/l-unicode.lua
@@ -777,11 +777,19 @@ end
local _, l_remap = utf.remapper(little)
local _, b_remap = utf.remapper(big)
+function utf.utf8_to_utf16_be(str)
+ return char(254,255) .. lpegmatch(b_remap,str)
+end
+
+function utf.utf8_to_utf16_le(str)
+ return char(255,254) .. lpegmatch(l_remap,str)
+end
+
function utf.utf8_to_utf16(str,littleendian)
if littleendian then
- return char(255,254) .. lpegmatch(l_remap,str)
+ return utf.utf8_to_utf16_le(str)
else
- return char(254,255) .. lpegmatch(b_remap,str)
+ return utf.utf8_to_utf16_be(str)
end
end