[plugin] opdsparser: add support for hexadecimal code points (#13482)

This commit is contained in:
Renee
2025-04-02 11:43:42 +01:00
committed by GitHub
parent 4d73b36c17
commit 7b68fb64f0

View File

@@ -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