diff options
author | Marius <mariausol@gmail.com> | 2011-05-13 12:40:12 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2011-05-13 12:40:12 +0300 |
commit | 4a00862b42dd8347bd782022a819fa9c3a32f9a2 (patch) | |
tree | 1360a3144185079a59795bd6503910988b6c9755 /scripts | |
parent | 749d7be28ed620f9017cb6a65735ac937d1b8a86 (diff) | |
download | context-4a00862b42dd8347bd782022a819fa9c3a32f9a2.tar.gz |
beta 2011.05.13 11:37
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtxrun.lua | 13 | ||||
-rw-r--r-- | scripts/context/stubs/mswin/mtxrun.lua | 13 | ||||
-rw-r--r-- | scripts/context/stubs/unix/mtxrun | 13 |
3 files changed, 33 insertions, 6 deletions
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 |