summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua22
1 files changed, 13 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
index 9f498132132..595af6b1530 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-uhc2utf8.lua
@@ -10,17 +10,18 @@
-- and version 1.3c or later is part of all distributions of LaTeX
-- version 2006/05/20 or later.
-module('luatexkouhc2utf8', package.seeall)
-
luatexbase.provides_module({
name = "luatexko-uhc2utf8",
- version = 1.0,
- date = "2013/05/10",
+ version = 1.2,
+ date = "2013/06/10",
author = "Dohyun Kim",
description = "UHC (CP949) input encoding",
license = "LPPL v1.3+",
})
+luatexkouhc2utf8 = luatexkouhc2utf8 or {}
+local luatexkouhc2utf8 = luatexkouhc2utf8
+
local find = string.find
local gsub = string.gsub
local byte = string.byte
@@ -30,7 +31,6 @@ local ugsub = unicode.utf8.gsub
local ubyte = unicode.utf8.byte
local uchar = unicode.utf8.char
local floor = math.floor
-local isfile = lfs.isfile
local kpse_find_file = kpse.find_file
local add_to_callback = luatexbase.add_to_callback
local remove_from_callback = luatexbase.remove_from_callback
@@ -77,13 +77,15 @@ local uhc_to_utf8 = function(buffer)
return buffer
end
-function startconvert ()
+local function startconvert ()
add_to_callback('process_input_buffer', uhc_to_utf8, 'luatexko-uhctoutf8', 1)
end
+luatexkouhc2utf8.startconvert = startconvert
-function stopconvert ()
+local function stopconvert ()
remove_from_callback('process_input_buffer', 'luatexko-uhctoutf8')
end
+luatexkouhc2utf8.stopconvert = stopconvert
-----------------------------------------
-- Hangul Windows OS uses CP949 filenames
@@ -117,14 +119,16 @@ local function uhc_find_file (file, ...)
return f
end
-function start_uhc_filename ()
+local function start_uhc_filename ()
add_to_callback('find_read_file', function(id, name) return uhc_find_file(name) end, 'luatexko-touhc-findreadfile')
add_to_callback('find_image_file', uhc_find_file, 'luatexko-touhc-findimagefile')
kpse.find_file = uhc_find_file
end
+luatexkouhc2utf8.start_uhc_filename = start_uhc_filename
-function stop_uhc_filename ()
+local function stop_uhc_filename ()
remove_from_callback('find_read_file', 'luatexko-touhc-findreadfile')
remove_from_callback('find_image_file', 'luatexko-touhc-findimagefile')
kpse.find_file = kpse_find_file
end
+luatexkouhc2utf8.stop_uhc_filename = stop_uhc_filename