Skip to content

Instantly share code, notes, and snippets.

@davispuh
Last active December 23, 2015 18:29
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/6676377 to your computer and use it in GitHub Desktop.
Save davispuh/6676377 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", Win32::Registry::KEY_ALL_ACCESS) do |reg|
reg['test2'] = 'åáâäãā'
reg['test3åáâäãā'] = 'åáâäãā'
value = reg['test']
puts value.encoding
puts value
puts value.inspect
reg.each do |v|
puts v
end
end
rescue Win32::Registry::Error => e
puts e.message
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment