In the meantime, I've discovered why the FH
utf8 library does not detect
utf8data.lua being loaded.
The
utf8data.lua file has tables
utf8_lc_uc and
utf8_uc_lc to translate characters.
The file
C:\Program Files (x86)\Family Historian\Program\Lua\utf8\primitives\dummy.lua contains the id & comments:
Code: Select all
-- $Id: utf8.lua 179 2009-04-03 18:10:03Z pasta $
-- If utf8data.lua (containing the lower<->upper case mappings) is loaded, these
-- additional functions are available:
-- * utf8upper(s)
-- * utf8lower(s)
The file
https://github.com/subsoap/defsave/blob ... e/utf8.lua has identical id & comments but also the commented out script:
Code: Select all
--[[
-- replace UTF-8 characters based on a mapping table
local function utf8replace (s, mapping)
: : : : : : :
return newstr
end
-- identical to string.upper except it knows about unicode simple case conversions
local function utf8upper (s)
return utf8replace(s, utf8_lc_uc)
end
-- identical to string.lower except it knows about unicode simple case conversions
local function utf8lower (s)
return utf8replace(s, utf8_uc_lc)
end
]]
The file
https://github.com/vhallac/ouf_grid/blo ... 8/utf8.lua has an earlier id 147 and script:
Code: Select all
-- $Id: utf8.lua 147 2007-01-04 00:57:00Z pasta $
-- identical to string.upper except it knows about unicode simple case conversions
local function utf8upper (s)
return utf8replace(s, utf8_lc_uc)
end
-- install in the string library
if not string.utf8upper and utf8_lc_uc then
string.utf8upper = utf8upper
end
-- identical to string.lower except it knows about unicode simple case conversions
local function utf8lower (s)
return utf8replace(s, utf8_uc_lc)
end
-- install in the string library
if not string.utf8lower and utf8_uc_lc then
string.utf8lower = utf8lower
end
The FH
utf8 library files do not contain any references to
utf8upper,
utf8_lc_uc,
utf8lower, or
utf8_uc_lc.
So even if
require("utf8data") is used, the library has nothing to detect or utilise its tables.
Therefore, one solution is for CP to incorporate the above script to honour their
dummy.lua comment:
Code: Select all
-- If utf8data.lua (containing the lower<->upper case mappings) is loaded, these
-- additional functions are available:
-- * utf8upper(s)
-- * utf8lower(s)
Do you think that solution is worth persuing?