Skip to content

Instantly share code, notes, and snippets.

@davispuh davispuh/test2.rb
Created Sep 23, 2013

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.