From 2fe8f7381f67519f4067f15774b47c42898fd50a Mon Sep 17 00:00:00 2001 From: RamiLego4Game Date: Sat, 12 May 2018 09:56:39 +0300 Subject: [PATCH] Tiny fix in the UTF-16 decoder --- love-pe.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/love-pe.lua b/love-pe.lua index 3b2e67c..a1ae5e5 100644 --- a/love-pe.lua +++ b/love-pe.lua @@ -89,7 +89,7 @@ local function decodeUTF16(str16) local lowPair = iter() if lowPair and lowPair >= 0xDC00 and lowPair <= 0xDFFF then - unicode = lshift(unicode-0xD800,10) + (lowPair-0xDC00) + unicode = lshift(unicode-0xD800,10) + (lowPair-0xDC00) + 0x01000 nstr[#nstr+1] = utf8.char(unicode) unicode = iter() else --Unpaired surrogate