Skip to content

Instantly share code, notes, and snippets.

@davispuh
Created September 23, 2013 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davispuh/6675912 to your computer and use it in GitHub Desktop.
Save davispuh/6675912 to your computer and use it in GitHub Desktop.
#!/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