Skip to content

Commit f5ea80d

Browse files
committed
Return registry strings of each_value and each_key as UTF-8
Since ruby-3.0 usually all strings from the Windows-API are returned as UTF-8 strings. Win32::Registry partly returned OEM encoding. This was a leftover from 2.x times. This commit changes it to UTF-8. Fixes: oneclick/rubyinstaller2#348
1 parent 5b66442 commit f5ea80d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

‎lib/win32/registry.rb‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ module Win32
6969
WCHAR_NUL = "\0".encode(WCHAR).freeze
7070
WCHAR_CR = "\r".encode(WCHAR).freeze
7171
WCHAR_SIZE = WCHAR_NUL.bytesize
72-
begin
73-
LOCALE = Encoding.find(Encoding.locale_charmap)
74-
rescue ArgumentError
75-
LOCALE = Encoding::UTF_8
76-
end
72+
LOCALE = Encoding::UTF_8
7773

7874
class Registry
7975

0 commit comments

Comments
 (0)