http://bugs.winehq.org/show_bug.cgi?id=14627
Summary: regedit broken due to locale settings Product: Wine Version: unspecified Platform: Other OS/Version: other Status: UNCONFIRMED Severity: normal Priority: P2 Component: programs AssignedTo: wine-bugs@winehq.org ReportedBy: galtgendo@o2.pl
I'm not sure I can describe this correctly. I've got a few registry keys that contain Japanese signs (in values). Regedit can't export those keys correctly, when I run in my own locale (pl_PL.UTF-8). They also fail to be displayed then. (The key names are ASCII, the values are not). But when I run as LANG=ja_JP.UTF-8, something strange happens, while regkey can be exported (as CP932, which sucks a bit, IMHO), it can't be viewed. The treeview of the key shows a plus beside it, but the key values are not shown and clicking that plus doesn't expand the subkey (in my standard locale, at least subkey got expanded).
(I'll just ignore for now the fact, that in my locale, if keyname is Japanese, it's shown as question signs.)
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #1 from Rafał Mużyło galtgendo@o2.pl 2008-07-25 07:57:48 --- Looks like I have to correct myself, but I was mislead by regedit. One of the subkeys had a Japanese name after all. The real structure of the key was: <ascii name 1>/<japanese name>/<ascii name 2>. In my locale it was simply shown as: <ascii name 1>/??? so it was even more incorrect than I thought it was.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #2 from Vitaliy Margolen vitaliy@kievinfo.com 2008-07-25 09:44:02 --- What Wine version? How did you added those keys into registry in the first place?
http://bugs.winehq.org/show_bug.cgi?id=14627
Rafał Mużyło galtgendo@o2.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |1.1.1
--- Comment #3 from Rafał Mużyło galtgendo@o2.pl 2008-07-25 10:14:25 --- Missed that detail, sorry (it's set now). They were added natively - by install process.
http://bugs.winehq.org/show_bug.cgi?id=14627
Rafał Mużyło galtgendo@o2.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.1 |1.1.2
http://bugs.winehq.org/show_bug.cgi?id=14627
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.2 |1.1.1
--- Comment #4 from Dmitry Timoshkov dmitry@codeweavers.com 2008-07-26 07:37:21 --- Please don't change an originally reported version.
http://bugs.winehq.org/show_bug.cgi?id=14627
Rafał Mużyło galtgendo@o2.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.1 |1.1.2
--- Comment #5 from Rafał Mużyło galtgendo@o2.pl 2008-07-26 07:56:13 --- OK, was just letting you know 1.1.2 doesn't change a thing.
http://bugs.winehq.org/show_bug.cgi?id=14627
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.2 |1.1.1
http://bugs.winehq.org/show_bug.cgi?id=14627
Mikolaj Zalewski mikolaj.zalewski@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mikolaj.zalewski@gmail.com
--- Comment #6 from Mikolaj Zalewski mikolaj.zalewski@gmail.com 2008-07-26 09:31:03 --- Regedit is currently an ANSI application so it can't access keys with characters outside of the locale codepage.
http://bugs.winehq.org/show_bug.cgi?id=14627
Rafał Mużyło galtgendo@o2.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.1 |1.1.2
--- Comment #7 from Rafał Mużyło galtgendo@o2.pl 2008-07-26 10:15:02 --- If it would simply display it as boxes, it would be much better. But it not only fail to list the values, but fails to export them too. And that really broken (even if it's broken-by-design). After all, now (that change was fairly recent AFAIK, though) registry can have unicode keys/values.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #8 from Mikolaj Zalewski mikolaj.zalewski@gmail.com 2008-07-26 10:22:43 --- Unicode registry is available for a very long time (I think I remember it being like that in the 90s). The regedit's ability to import Unicode registry files is recent. It seems we still need to add Unicode export and make the UI Unicode. Of course, IMO this should be fixed.
http://bugs.winehq.org/show_bug.cgi?id=14627
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|1.1.2 |1.1.1
--- Comment #9 from Dmitry Timoshkov dmitry@codeweavers.com 2008-07-28 00:36:43 --- Don't change an originally reported version.
http://bugs.winehq.org/show_bug.cgi?id=14627
Alexander Nicolaysen Sørnes alex@thehandofagony.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |alex@thehandofagony.com
--- Comment #10 from Alexander Nicolaysen Sørnes alex@thehandofagony.com 2008-08-25 16:15:48 --- Could you re-test with Wine 1.1.4 when it comes out?
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #11 from Rafał Mużyło galtgendo@o2.pl 2008-08-25 17:19:14 --- It's a bit better even with 1.1.3 - if run in ja_JP.utf8. Now, it can viewed. If it's run in my standard locale it still misbehaves: keys with Japanese names can't be expanded (plus is visible, but doesn't work). But the exporting seems to be broken in a funny way: when I choose "Export", give a filename and press Enter, it saves an invalid export (an empty key), outputs "Success" into the terminal and quits regedit.
I'll see, if 1.1.4 will be better.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #12 from Rafał Mużyło galtgendo@o2.pl 2008-08-25 17:21:40 --- To be more specific: exporting was about pl_PL.utf8 locale.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #13 from Rafał Mużyło galtgendo@o2.pl 2008-09-05 16:53:57 --- OK, 1.1.4 is here, so let's start complaining. ja_JP.UTF-8 seems to be fully working now. But pl_PL.UTF-8 is still broken. While at least everything can be sort-of viewied (by sort of I mean kanji/kana is still missing, but the number of missing font boxes seems to be correct and all the keys are expandable), the export is still broken in the way I previously described.
http://bugs.winehq.org/show_bug.cgi?id=14627
Alexander Nicolaysen Sørnes alex@thehandofagony.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #14 from Alexander Nicolaysen Sørnes alex@thehandofagony.com 2008-09-08 12:47:02 --- Unicode export hasn't been implemented yet; I'll try to do it by Wine 1.1.5. Are the Japanese characters only displayed correctly in the jp_JP locale, and not pl_PL?
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #15 from Rafał Mużyło galtgendo@o2.pl 2008-09-08 13:27:13 --- Yes, but this seems to be simply a font problem, as (as I already mentioned) number of 'missing font' boxes does match the number of signs in the key name.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #16 from Alexander Nicolaysen Sørnes alex@thehandofagony.com 2008-09-16 09:52:25 --- Please test with Wine 1.1.5 when it comes out.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #17 from Rafał Mużyło galtgendo@o2.pl 2008-09-19 16:34:06 --- OK, 1.1.5 is here - updating complaints. More improvements: In pl_PL.utf8 it finally save something and doesn't quit anymore. However, the saved values are still incorrect: - case REGEDIT4: in ja_JP.utf8 saved correctly as CP932, in pl_PL.utf8 - not: question marks in place of kana/kanji (should it work that way ?) - case REGEDIT5: both locales - hard to tell; it seems correct, but on the other hand, native Windows keys write 000d000a instead of 000d0a; can't say if that's a bug or not
In pl_PL.utf8 still empty boxes instead of glyphs, but that's just an annoyance.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #18 from Rafał Mużyło galtgendo@o2.pl 2008-09-20 11:11:59 --- Well, after reading programs/regedit/regproc.c, I think it's a bug caused by using \n in many places of export_hkey(). compiler translates it to 0d0a, but that's two wchar, not one.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #19 from Rafał Mużyło galtgendo@o2.pl 2008-10-20 13:51:10 --- Created an attachment (id=16759) --> (http://bugs.winehq.org/attachment.cgi?id=16759) the incorrect patch for the problem
this patch is incorrect, but the exported key is at least valid utf-16, as it should be; corrections welcomed
http://bugs.winehq.org/show_bug.cgi?id=14627
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch, source
http://bugs.winehq.org/show_bug.cgi?id=14627
Rafał Mużyło galtgendo@o2.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #16759|0 |1 is obsolete| |
--- Comment #20 from Rafał Mużyło galtgendo@o2.pl 2008-10-21 08:30:18 --- Created an attachment (id=16772) --> (http://bugs.winehq.org/attachment.cgi?id=16772) a better working patch
This patch (while still incorrect, cause it's most probably broken for REGEDIT4) finally produces regfiles that are just like the Windows ones. I'm not sure about multiline strings, cause I didn't have an example of how it should look like, but single strings and hex values seem correct. Only difference I could see was an extra empty line at the end of the Windows file.
As you may see, most important change was opening as binary. Correct fix would probably be fixing fopen to work with wchar text output.
http://bugs.winehq.org/show_bug.cgi?id=14627
Rafał Mużyło galtgendo@o2.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #16772|0 |1 is obsolete| |
--- Comment #21 from Rafał Mużyło galtgendo@o2.pl 2008-12-19 15:21:22 --- Created an attachment (id=18075) --> (http://bugs.winehq.org/attachment.cgi?id=18075) a new version of the old patch
This version applies to 1.1.10 and I think it will still apply to today's git.
Yes, as I was told on #winehackers, it's the fopen that should be fixed, but even msdn says that encoding argument of fopen was implemented only since MSVC 2005. And it's much easier to write a partially correct patch to an app, than to risk patching a lib, that many other apps use.
http://bugs.winehq.org/show_bug.cgi?id=14627
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #22 from Rafał Mużyło galtgendo@o2.pl 2011-03-08 11:28:10 CST --- Well, what do you know: commit 3c6de3b3485e8ee3a622ef990c5b9042ad28e237 (accepted yesterday) does more or less the same what my patch does. I've only missed REGEDIT4 header and failed to add '_setmode(_fileno(file), _O_BINARY);' part for stdout.
It took only about two years to reach this decision.
As for the font problem, as long as FontSubstitutes are set up correctly, keys are displayed correctly even in pl_PL.utf8 locale.
As such this bug can probably be marked as fixed with wine 1.3.16 release.
http://bugs.winehq.org/show_bug.cgi?id=14627
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |dank@kegel.com Resolution| |FIXED
--- Comment #23 from Dan Kegel dank@kegel.com 2011-03-08 11:32:44 CST --- We can mark it fixed now; it gets closed with the release.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #24 from Rafał Mużyło galtgendo@o2.pl 2011-03-08 11:33:28 CST --- Oops, I filed this so long ago, that I forgot about certain parts of this bug: "case REGEDIT4: in ja_JP.utf8 saved correctly as CP932, in pl_PL.utf8 - not: question marks in place of kana/kanji" - that part is probably still broken.
http://bugs.winehq.org/show_bug.cgi?id=14627
Rafał Mużyło galtgendo@o2.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |
--- Comment #25 from Rafał Mużyło galtgendo@o2.pl 2011-03-08 11:35:41 CST --- ...and as such, this bug needs to be reopened for a bit longer.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #26 from Rafał Mużyło galtgendo@o2.pl 2011-03-08 12:05:54 CST --- OK, it seems the answer lies in the last parameter of WideCharToMultiByte, but there's a question: should regedit not use that parameter and export invalid values or should it set it to non-NULL and refuse to export if it gets set to TRUE ?
It's not a rhetorical question, I'm both unsure what Windows does in such case and whether wine should mirror that behavior.
http://bugs.winehq.org/show_bug.cgi?id=14627
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED
--- Comment #27 from Dmitry Timoshkov dmitry@codeweavers.com 2011-03-09 00:16:47 CST --- (In reply to comment #26)
OK, it seems the answer lies in the last parameter of WideCharToMultiByte, but there's a question: should regedit not use that parameter and export invalid values or should it set it to non-NULL and refuse to export if it gets set to TRUE ?
I'd assume there is nothing that can be done to workaround an incompatible locale.
It's not a rhetorical question, I'm both unsure what Windows does in such case and whether wine should mirror that behavior.
Then please test first before reopening.
http://bugs.winehq.org/show_bug.cgi?id=14627
Rafał Mużyło galtgendo@o2.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |
--- Comment #28 from Rafał Mużyło galtgendo@o2.pl 2011-03-09 06:24:18 CST --- Somebody seems to have a strange definition of "fixed" - a TEST-REQUEST or a WONTFIX (if really nothing can be done) I'd agree with, but as long as it's broken, it's not FIXED.
What I was trying to say in comment 26 was: as you well know Windows sucks at multiple locale handling (even AppLocale doesn't help that much, in some cases - not at all). Also, REGEDIT4 are strings in locale-dependent encoding. So, should wine's regedit continue to be broken and export bogus values in such case, or should it at least pop up a dialog, saying "Keys you've selected can't be exported correctly in this locale. Do you want to continue anyway or export to 'REGEDIT 5' ?". Lately, a few Windows 95 workarounds were dropped in wine, so perhaps something like this would fit.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #29 from Alexandre Julliard julliard@winehq.org 2011-03-09 06:50:12 CST --- (In reply to comment #28)
Somebody seems to have a strange definition of "fixed" - a TEST-REQUEST or a WONTFIX (if really nothing can be done) I'd agree with, but as long as it's broken, it's not FIXED.
It's not broken unless you can show that Windows does it differently.
http://bugs.winehq.org/show_bug.cgi?id=14627
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |INVALID
--- Comment #30 from Dmitry Timoshkov dmitry@codeweavers.com 2011-03-09 06:52:35 CST --- (In reply to comment #28)
Somebody seems to have a strange definition of "fixed" - a TEST-REQUEST or a WONTFIX (if really nothing can be done) I'd agree with, but as long as it's broken, it's not FIXED.
Reading an original report I believe that this bug is actually invalid.
What I was trying to say in comment 26 was: as you well know Windows sucks at multiple locale handling (even AppLocale doesn't help that much, in some cases - not at all). Also, REGEDIT4 are strings in locale-dependent encoding. So, should wine's regedit continue to be broken and export bogus values in such case, or should it at least pop up a dialog, saying "Keys you've selected can't be exported correctly in this locale. Do you want to continue anyway or export to 'REGEDIT 5' ?".
If Windows regedit doesn't do that - Wine implementation shouldn't do that either.
http://bugs.winehq.org/show_bug.cgi?id=14627
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #31 from Dmitry Timoshkov dmitry@codeweavers.com 2011-03-09 06:52:48 CST --- Closing invalid.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #32 from Rafał Mużyło galtgendo@o2.pl 2011-03-09 09:33:31 CST --- Well, it does seem that Windows exports bogus values in such case, but should wine really do bug-for-bug mapping here ? Cause if the values are unusable, it's still a bug.
On Windows, switching locale either requires a reboot or AppLocale, which is known to fail on occasions. As such, it can be seen as working in multiple locales being effectively unsupported. wine handles it far smoother, via LANG value - locale is still constant for a process, but processes with different locales can run on one sever (at least AFAICT). So, perhaps such an enhancement for regedit would be fitting ?
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #33 from Dmitry Timoshkov dmitry@codeweavers.com 2011-03-09 10:22:02 CST --- (In reply to comment #32)
Well, it does seem that Windows exports bogus values in such case, but should wine really do bug-for-bug mapping here ? Cause if the values are unusable, it's still a bug.
That's unavoidable for not unicode text strings.
On Windows, switching locale either requires a reboot or AppLocale, which is known to fail on occasions. As such, it can be seen as working in multiple locales being effectively unsupported. wine handles it far smoother, via LANG value - locale is still constant for a process, but processes with different locales can run on one sever (at least AFAICT). So, perhaps such an enhancement for regedit would be fitting ?
Just use .reg files which support unicode format.
http://bugs.winehq.org/show_bug.cgi?id=14627
--- Comment #34 from Rafał Mużyło galtgendo@o2.pl 2011-03-09 10:34:22 CST --- Well, I'd say Windows "workarounds" it in similar way - REGEDIT5 is the default on XP.
Still, while probably nothing can be done on command line, couldn't GUI at least pop up a warning of "Some of the keys were probably exported incorrectly" in REGEDIT4 case after such export ?
(and I still think a WONTFIX is more fitting for this case than INVALID)