From 4a00862b42dd8347bd782022a819fa9c3a32f9a2 Mon Sep 17 00:00:00 2001 From: Marius Date: Fri, 13 May 2011 12:40:12 +0300 Subject: beta 2011.05.13 11:37 --- scripts/context/lua/mtxrun.lua | 13 +++++++++++-- scripts/context/stubs/mswin/mtxrun.lua | 13 +++++++++++-- scripts/context/stubs/unix/mtxrun | 13 +++++++++++-- 3 files changed, 33 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index f399b90a4..dfba13b4a 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -3435,8 +3435,10 @@ local unicode = unicode utf = utf or unicode.utf8 -local concat, utfchar, utfgsub = table.concat, utf.char, utf.gsub +local concat = table.concat +local utfchar, utfbyte, utfgsub = utf.char, utf.byte, utf.gsub local char, byte, find, bytepairs, utfvalues, format = string.char, string.byte, string.find, string.bytepairs, string.utfvalues, string.format +local type = type local utfsplitlines = string.utfsplitlines @@ -3648,6 +3650,14 @@ function unicode.utfcodes(str) return concat(t,separator or " ") end +function unicode.ustring(s) + return format("U+%05X",type(s) == "number" and s or utfbyte(s)) +end + +function unicode.xstring(s) + return format("0x%05X",type(s) == "number" and s or utfbyte(s)) +end + local lpegmatch = lpeg.match local utftype = lpeg.patterns.utftype @@ -3659,7 +3669,6 @@ end - end -- of closure do -- create closure to overcome 200 locals limit diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index f399b90a4..dfba13b4a 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -3435,8 +3435,10 @@ local unicode = unicode utf = utf or unicode.utf8 -local concat, utfchar, utfgsub = table.concat, utf.char, utf.gsub +local concat = table.concat +local utfchar, utfbyte, utfgsub = utf.char, utf.byte, utf.gsub local char, byte, find, bytepairs, utfvalues, format = string.char, string.byte, string.find, string.bytepairs, string.utfvalues, string.format +local type = type local utfsplitlines = string.utfsplitlines @@ -3648,6 +3650,14 @@ function unicode.utfcodes(str) return concat(t,separator or " ") end +function unicode.ustring(s) + return format("U+%05X",type(s) == "number" and s or utfbyte(s)) +end + +function unicode.xstring(s) + return format("0x%05X",type(s) == "number" and s or utfbyte(s)) +end + local lpegmatch = lpeg.match local utftype = lpeg.patterns.utftype @@ -3659,7 +3669,6 @@ end - end -- of closure do -- create closure to overcome 200 locals limit diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index f399b90a4..dfba13b4a 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -3435,8 +3435,10 @@ local unicode = unicode utf = utf or unicode.utf8 -local concat, utfchar, utfgsub = table.concat, utf.char, utf.gsub +local concat = table.concat +local utfchar, utfbyte, utfgsub = utf.char, utf.byte, utf.gsub local char, byte, find, bytepairs, utfvalues, format = string.char, string.byte, string.find, string.bytepairs, string.utfvalues, string.format +local type = type local utfsplitlines = string.utfsplitlines @@ -3648,6 +3650,14 @@ function unicode.utfcodes(str) return concat(t,separator or " ") end +function unicode.ustring(s) + return format("U+%05X",type(s) == "number" and s or utfbyte(s)) +end + +function unicode.xstring(s) + return format("0x%05X",type(s) == "number" and s or utfbyte(s)) +end + local lpegmatch = lpeg.match local utftype = lpeg.patterns.utftype @@ -3659,7 +3669,6 @@ end - end -- of closure do -- create closure to overcome 200 locals limit -- cgit v1.2.3