Project

General

Profile

This project is closed and read-only.

Actions

Backport #8943

closed

Invalid encoding for Windows Registry

Backport #8943: Invalid encoding for Windows Registry

Added by davispuh (Dāvis Mosāns) almost 13 years ago. Updated over 10 years ago.

Status:
Rejected
Assignee:
[ruby-core:57339]

Description

=begin
It's not possible to correctly read non-ASCII registry values. It's also not possible to write them with correct encoding.

to test import ((<test.reg|URL:https://gist.github.com/davispuh/6676385#file-test-reg>))

then ((<test3.rb|URL:https://gist.github.com/davispuh/6676377#file-test3-rb>))

Output on Ruby 2.0 (it's same for 1.9.3 except encoding is US-ASCII not UTF-8, but both are wrong)

N:\Projects>ruby test3.rb
UTF-8
�??�?�
"\xE5??\xE4?\xE2"
test

(it hangs here)

screenshot of registry after running it ((URL:http://i.imm.io/1gFES.png))

seems that whoever wrote Ruby code to interact with WinAPI had no idea about encodings/code pages Windows uses as there's loads of issues and they've been for years.
=end


Related issues 1 (0 open1 closed)

Related to Backport200 - Backport #8942: Wrong encoding for Windows native error messagesClosedwindowsActions

Updated by luislavena (Luis Lavena) almost 13 years ago Actions #1 [ruby-core:57340]

  • Assignee set to windows

Hello,

Code in win32/registry predates the presence of encoding support built in Ruby (started in 1.9.1 and greater)

Feel free to send a patch that uses Wide characters functions to perform these operations, but don't bluntly assume people don't have idea on this topic.

If you have been affected by this for so many years, a better use of your time will be provide a patch instead of aggressively complaining.

The principle of Open Source is "scratch your own itch".

Updated by davispuh (Dāvis Mosāns) almost 13 years ago Actions #2 [ruby-core:57343]

Sorry, I didn't wanted to sound too arrogant and I didn't meant this issue specially, but proper encoding/Unicode support overall. For me it's just hard to understand why it wasn't implemented properly in first place. I encountered these issues only now recently as quite rarely have to deal with Unicode characters in some places. But this is 4th encoding related issue I've submitted in last 2 months and it's a bit annoying. Especially as Ruby language didn't came out this year, but some while ago so there shouldn't be many problems. Even just reporting issues takes time. Of course I could fix it myself and I actually live with "If you want something done, do it yourself" but sadly I don't really have time now and it's not so important as other things I've to do. So maybe later after some months when I'll have time I might fix it myself if there won't be any progress. Anyway thanks.

Updated by nobu (Nobuyoshi Nakada) almost 13 years ago Actions #3

  • Tracker changed from Bug to Backport
  • Project changed from Ruby to 15

r41838, r41844, r41936, r41845, r41847, r41848, r41849, r41856, r41936, r43026, and hopefully str_fill_term fixes.

Updated by usa (Usaku NAKAMURA) almost 13 years ago Actions #4

It's already fixed at trunk by a part of r41838.

Updated by usa (Usaku NAKAMURA) almost 13 years ago Actions #5 [ruby-core:58747]

Oh, sorry, the previous message was wrong.
Please forget about it.

Updated by naruse (Yui NARUSE) over 10 years ago Actions #6

  • Status changed from Open to Rejected
Actions

Also available in: PDF Atom