- fixes german umlauts
This commit is contained in:
+20
-2
@@ -378,6 +378,24 @@ local function getUtf8Table(word)
|
||||
return tbl
|
||||
end
|
||||
|
||||
--- handles UTF-8 characters like äöü (except ß, ÿ, × and ÷)
|
||||
local function toUpper(word)
|
||||
return (Grichelde.F.gsub(_G.strupper(word), "\195([\160-\190])", function(c)
|
||||
if (c ~= "\183") then
|
||||
return "\195" .. Grichelde.F.bytes2Char(Grichelde.F.toByte(c) - 32)
|
||||
end
|
||||
end))
|
||||
end
|
||||
|
||||
--- handles UTF-8 characters like äöü (except ß, ÿ, × and ÷)
|
||||
local function toLower(word)
|
||||
return (Grichelde.F.gsub(_G.strlower(word), "\195([\128-\158])", function(c)
|
||||
if (c ~= "\151") then
|
||||
return "\195" .. Grichelde.F.bytes2Char(Grichelde.F.toByte(c) + 32)
|
||||
end
|
||||
end))
|
||||
end
|
||||
|
||||
local function isLetter(word)
|
||||
local char = Grichelde.F.getNextCharUtf8(word)
|
||||
return (char ~= nil) and (Grichelde.F.toUpper(char) ~= Grichelde.F.toLower(char))
|
||||
@@ -514,8 +532,8 @@ Grichelde.F = {
|
||||
gmatch = _G.string.gmatch,
|
||||
join = _G.strjoin,
|
||||
split = _G.strsplit,
|
||||
toUpper = _G.strupper,
|
||||
toLower = _G.strlower,
|
||||
toUpper = toUpper,
|
||||
toLower = toLower,
|
||||
getNextCharUtf8 = getNextCharUtf8,
|
||||
isUtf8MultiByte = isUtf8MultiByte,
|
||||
getUtf8Sequence = getUtf8Sequence,
|
||||
|
||||
Reference in New Issue
Block a user