From 8eab55d173e9f14d1c5c21889f1c839deb35467b Mon Sep 17 00:00:00 2001 From: alfadur Date: Mon, 6 Sep 2021 01:12:22 +0300 Subject: [PATCH] add missing bit to UTF-16 surrogate pair conversion --- src/physfs_unicode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physfs_unicode.c b/src/physfs_unicode.c index 0e00602..b520eaf 100644 --- a/src/physfs_unicode.c +++ b/src/physfs_unicode.c @@ -210,7 +210,7 @@ static PHYSFS_uint32 utf16codepoint(const PHYSFS_uint16 **_str) else { src++; /* eat the other surrogate. */ - cp = (((cp - 0xD800) << 10) | (pair - 0xDC00)); + cp = (0x10000 | ((cp - 0xD800) << 10) | (pair - 0xDC00)); } /* else */ } /* else if */