-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From be7f76870b3e6abb56c24b60710a00b25bc3f4cf Mon Sep 17 00:00:00 2001 | ||
From: Lars Kanis <[email protected]> | ||
Date: Mon, 25 Dec 2023 15:53:47 +0100 | ||
From 8f4f5e778c582ca1a64d7f74b48dc289acc64276 Mon Sep 17 00:00:00 2001 | ||
From: Lars Kanis <[email protected]> | ||
Date: Sat, 28 Sep 2024 21:38:25 +0200 | ||
Subject: [PATCH] [Win32] Return registry strings as UTF-8 | ||
|
||
Since ruby-3.0 usually all strings from the Windows-API are returned as UTF-8 strings. | ||
|
@@ -10,18 +10,22 @@ This commit changes it to UTF-8. | |
|
||
Fixes: https://github.com/oneclick/rubyinstaller2/issues/348 | ||
--- | ||
ext/win32/lib/win32/registry.rb | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
ext/win32/lib/win32/registry.rb | 6 +----- | ||
1 file changed, 1 insertion(+), 5 deletions(-) | ||
|
||
diff --git a/ext/win32/lib/win32/registry.rb b/ext/win32/lib/win32/registry.rb | ||
index b5b99ff684..91f666cdd7 100644 | ||
index c801b1327b..1459adeaa0 100644 | ||
--- a/ext/win32/lib/win32/registry.rb | ||
+++ b/ext/win32/lib/win32/registry.rb | ||
@@ -69,7 +69,7 @@ module Win32 | ||
@@ -69,11 +69,7 @@ module Win32 | ||
WCHAR_NUL = "\0".encode(WCHAR).freeze | ||
WCHAR_CR = "\r".encode(WCHAR).freeze | ||
WCHAR_SIZE = WCHAR_NUL.bytesize | ||
- LOCALE = Encoding.find(Encoding.locale_charmap) | ||
- begin | ||
- LOCALE = Encoding.find(Encoding.locale_charmap) | ||
- rescue ArgumentError | ||
- LOCALE = Encoding::UTF_8 | ||
- end | ||
+ LOCALE = Encoding::UTF_8 | ||
|
||
class Registry | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters