From 3cb114e8217246e103ea38bf9b7db0c588cbb293 Mon Sep 17 00:00:00 2001 From: xavo95 Date: Mon, 4 Nov 2024 22:16:14 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=BC=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/extras.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extras.rs b/src/extras.rs index 0e3c030..7df1882 100644 --- a/src/extras.rs +++ b/src/extras.rs @@ -52,7 +52,7 @@ unsafe extern "win64" fn on_kurohttp_get(reg: *mut Registers, _: usize) { if let Some(result) = replacer.replace(url.as_str()) { println!("Redirecting to: {result}"); // TODO: Track https://doc.rust-lang.org/nightly/unstable-book/library-features/str-from-utf16-endian.html to replace widestring when stabilized - let new_url = widestring::U16String::from_str(result.as_str()); + let new_url = widestring::U16CString::from_str(result.as_str()).unwrap(); let new_wstr = PCWSTR::from_raw(new_url.as_ptr()); std::ptr::copy_nonoverlapping(new_wstr.as_ptr(), wstr, new_wstr.as_wide().len() + 2); };