Forum: Ruby WIN32 registry throwing an error when searching for a key

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
75cfeff7523434ae98bf08f7f8abc6fc?d=identicon&s=25 Ranjith G. (ranjith31)
on 2017-02-02 05:23
We are facing an issue with the method 'export_string' in registry.rb in
the previous version of ruby(1.9.3) we haven't seen this method and now
when we are searching for a key mean while when it encountered a key
with '™ tm' then its throwing an error like ,

"C:/Ruby23/lib/ruby/2.3.0/win32/registry.rb:908:in `encode': U+2122 to
IBM437 in
conversion from UTF-16LE to UTF-8 to IBM437

How can we resolve this issue, can any one help me out.
Current ruby version ruby-2.3.3

Ranjith Ganapuram
3a81ced4012650ca2004c9bff7b18202?d=identicon&s=25 Ronald F. (rovf)
on 2017-02-06 12:40
I understand that you get an exception when this character is converted
to IBM437, but I don't understand *why* this conversion is done. It
could be a bug in Ruby 2.3, but for the safe side, can you show the
complete stack trace and in particular that part of your code, where you
invoke the respective method from the Win32::Registry class?
75cfeff7523434ae98bf08f7f8abc6fc?d=identicon&s=25 Ranjith G. (ranjith31)
on 2017-02-06 14:55
In my registry there is a key it includes 'TM' symbol so it is unable to
decode at that time and I have just included the
In my ruby script where am calling win32 registry then it's working
3a81ced4012650ca2004c9bff7b18202?d=identicon&s=25 Ronald F. (rovf)
on 2017-02-06 16:50
Did you have a different default internal encoding before? AFIK, the
internal encoding is always UTF-8, unless you specify it otherwise.
That's why I thought at first that this might have been a bug in the
Ruby library.
75cfeff7523434ae98bf08f7f8abc6fc?d=identicon&s=25 Ranjith G. (ranjith31)
on 2017-02-06 18:02
No we don't have any internal encoding part and for the ruby 1.9.3 it
doesn't raise any error but this error occuring while upgrading to ruby
2.3.3 version
3a81ced4012650ca2004c9bff7b18202?d=identicon&s=25 Ronald F. (rovf)
on 2017-02-07 06:54
If this is the case, maybe it *is* a bug in Ruby, because IMO you should
not be required to do this setting, because, from my understanding,
UTF-8 is supposed to be the default. I can't test it because I don't
have a comparable Ruby system installed.

May I suggest that you open a bug report on this issue?
75cfeff7523434ae98bf08f7f8abc6fc?d=identicon&s=25 Ranjith G. (ranjith31)
on 2017-02-07 17:43
Okay Ronald.
Where can I raise this bug ?
3a81ced4012650ca2004c9bff7b18202?d=identicon&s=25 Ronald F. (rovf)
on 2017-02-08 09:40
Ranjith Ganapuram wrote in post #1185538:
> Okay Ronald.
> Where can I raise this bug ?

Well, it depends on which implementation of Ruby you have! You told us
only that this is on Windows, but there are several Ruby implementations
on Windows.

But you can usually find information on where/how to open a bug report,
by either going to the website of the implementer, or by just googling
for it.
This topic is locked and can not be replied to.