mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[plugin] opdsparser: add support for hexadecimal code points (#13482)
This commit is contained in:
@@ -23,7 +23,14 @@ local function unescape(str)
|
||||
if unescape_map[s] then
|
||||
return unescape_map[s]
|
||||
elseif n == "#" then -- unescape unicode
|
||||
return util.unicodeCodepointToUtf8(tonumber(s))
|
||||
local codepoint
|
||||
-- Determine if the code point is written as a decimal or hexadecimal number
|
||||
if string.sub(s, 1, 1) == "x" then
|
||||
codepoint = tonumber(string.sub(s, 2), 16)
|
||||
else
|
||||
codepoint = tonumber(s)
|
||||
end
|
||||
return util.unicodeCodepointToUtf8(codepoint)
|
||||
else
|
||||
return orig
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user