From de80176321a4ed7086e6dcfb0127f8f28c1a23e3 Mon Sep 17 00:00:00 2001 From: Ookiineko Date: Tue, 9 Apr 2024 00:46:21 +0800 Subject: [PATCH] fixup: Magisk: disable UTF-8 checks when on Windows (#26) - this fixes #26 Signed-off-by: Ookiineko --- ...0-workaround-UTF-8-issues-on-Windows.patch | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 patches/Magisk/0010-workaround-UTF-8-issues-on-Windows.patch diff --git a/patches/Magisk/0010-workaround-UTF-8-issues-on-Windows.patch b/patches/Magisk/0010-workaround-UTF-8-issues-on-Windows.patch new file mode 100644 index 0000000..4fdfb57 --- /dev/null +++ b/patches/Magisk/0010-workaround-UTF-8-issues-on-Windows.patch @@ -0,0 +1,27 @@ +From 7f4f80f0d520abb0fdf25a02bdc656f66fb5b797 Mon Sep 17 00:00:00 2001 +From: Ookiineko +Date: Tue, 9 Apr 2024 00:45:17 +0800 +Subject: [PATCH] workaround UTF-8 issues on Windows + +Signed-off-by: Ookiineko +--- + native/src/base/cstr.rs | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/native/src/base/cstr.rs b/native/src/base/cstr.rs +index d93db87..4bbbeb9 100644 +--- a/native/src/base/cstr.rs ++++ b/native/src/base/cstr.rs +@@ -312,7 +312,9 @@ pub struct Utf8CStr([u8]); + impl Utf8CStr { + pub fn from_cstr(cstr: &CStr) -> Result<&Utf8CStr, StrErr> { + // Validate the buffer during construction ++ #[cfg(not(target_os = "windows"))] + str::from_utf8(cstr.to_bytes())?; ++ + Ok(unsafe { Self::from_bytes_unchecked(cstr.to_bytes_with_nul()) }) + } + +-- +2.44.0 +