From 0f6c01ed2aba62330d4f37e1da43197e8df6f36d Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 24 Mar 2010 14:20:22 +0200 Subject: Make sanitize() Unicode friendly --- otfl-font-nms.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() -- cgit v1.2.3