From 13f208f37be4fc6563177cf4876e05393f65913f Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Mon, 21 May 2012 21:02:39 +0200 Subject: [PATCH] Add debian/patches/utf16-fix - fix handling of characters beyond BMP. Thanks to Vladimir Serbinenko . --- debian/changelog | 2 ++ debian/patches/series | 1 + debian/patches/utf16-fix | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 debian/patches/utf16-fix diff --git a/debian/changelog b/debian/changelog index fa07f49..1a335e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ fuse-exfat (0.9.7-2) UNRELEASED; urgency=low integration with the automount functionality in thunar. Thanks to Bob Valantin . (Closes: #673517) * Add debian/patches/honor-cppflags - scons should use exported CPPFLAGS. + * Add debian/patches/utf16-fix - fix handling of characters beyond BMP. + Thanks to Vladimir Serbinenko . -- Sven Hoexter Thu, 17 May 2012 14:47:47 +0200 diff --git a/debian/patches/series b/debian/patches/series index 06c25e1..e3ec1be 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ honor-cppflags +utf16-fix diff --git a/debian/patches/utf16-fix b/debian/patches/utf16-fix new file mode 100644 index 0000000..10bce32 --- /dev/null +++ b/debian/patches/utf16-fix @@ -0,0 +1,22 @@ +Applied upstream in r283. +http://code.google.com/p/exfat/source/detail?r=283 +Closes Debian bug #672898. +Thanks to Vladimir Serbinenko . +--- a/libexfat/utf.c ++++ b/libexfat/utf.c +@@ -89,6 +89,7 @@ static const le16_t* utf16_to_wchar(cons + return NULL; + *wc = ((wchar_t) (le16_to_cpu(input[0]) & 0x3ff) << 10); + *wc |= (le16_to_cpu(input[1]) & 0x3ff); ++ *wc += 0x10000; + return input + 2; + } + else +@@ -186,6 +187,7 @@ static le16_t* wchar_to_utf16(le16_t* ou + } + if (outsize < 2) + return NULL; ++ wc -= 0x10000; + output[0] = cpu_to_le16(0xd800 | ((wc >> 10) & 0x3ff)); + output[1] = cpu_to_le16(0xdc00 | (wc & 0x3ff)); + return output + 2; -- 2.39.5