Created
September 23, 2013 19:46
-
-
Save davispuh/6675912 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
#encoding: utf-8 | |
require 'win32/registry' | |
begin | |
Win32::Registry::HKEY_CURRENT_USER.open("SOFTWARE\doesnt_exist") do |reg| | |
end | |
rescue Win32::Registry::Error => e | |
message = e.message | |
puts message.encoding | |
puts message | |
puts message.inspect | |
puts message.force_encoding("windows-1257") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment