summaryrefslogtreecommitdiff
path: root/otfl-font-nms.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-03-24 14:20:22 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-03-24 14:21:16 +0200
commit0f6c01ed2aba62330d4f37e1da43197e8df6f36d (patch)
tree1de7b615519bc613e1a68dd4aa49cc1820d233d2 /otfl-font-nms.lua
parent8d5d4c328c83c892e5350c06f37568dde3912a85 (diff)
downloadluaotfload-0f6c01ed2aba62330d4f37e1da43197e8df6f36d.tar.gz
Make sanitize() Unicode friendly
Diffstat (limited to 'otfl-font-nms.lua')
-rw-r--r--otfl-font-nms.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/otfl-font-nms.lua b/otfl-font-nms.lua
index 2a7c586..8a7c206 100644
--- a/otfl-font-nms.lua
+++ b/otfl-font-nms.lua
@@ -22,13 +22,14 @@ names.path = {
local splitpath, expandpath, glob, basename = file.split_path, kpse.expand_path, dir.glob, file.basename
local upper, lower, format, gsub, match = string.upper, string.lower, string.format, string.gsub, string.match
local rpadd = string.rpadd
+local utfgsub = unicode.utf8.gsub
local trace_progress = true --trackers.register("names.progress", function(v) trace_progress = v end)
local trace_search = false --trackers.register("names.search", function(v) trace_search = v end)
local trace_loading = false --trackers.register("names.loading", function(v) trace_loading = v end)
local function sanitize(str)
- return gsub(lower(str), "[^%a%d]", "")
+ return utfgsub(lower(str), "[^%a%d]", "")
end
function names.load()