summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2011-05-13 11:37:00 +0200
committerHans Hagen <pragma@wxs.nl>2011-05-13 11:37:00 +0200
commitaf13aa7e4d8076268e853de13d96a1e73d70ce35 (patch)
tree29403738a0c170379a557ccc785784ccfd746749 /scripts
parent4bfd1949398de94ab92544f2c4c49b9c41c1189f (diff)
downloadcontext-af13aa7e4d8076268e853de13d96a1e73d70ce35.tar.gz
beta 2011.05.13 11:37
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtxrun.lua13
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua13
-rwxr-xr-xscripts/context/stubs/unix/mtxrun13
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 100755
--- 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