http://bugs.winehq.org/show_bug.cgi?id=20517
Summary: temporary language switch causes permanent change of codepage Product: Wine Version: 1.1.30 Platform: PC OS/Version: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: hoehle@users.sourceforge.net
For as long as I can remember (I'm sorry to report this now only), the sequence rm -rf .wine; wine winecfg; LANG=C wine winecfg; wine winecfg (assuming a default of LANG=de_DE.UTF-8 in Linux) provoked the following change in the registry against the initial setting:
+[System\CurrentControlSet\Control\Nls\Codepage] 1251317004 "37"="" "ACP"="1252" -"OEMCP"="437" +"OEMCP"="850"
This proves that something is not initialized consistently. This is clearly a bug and might cause seemingly non-deterministic faults in apps.
I don't know whether this is related to the bug that I'm actually researching: some old multi-lingual French and German apps start in English when I expect them to start in French or German.
On the Mac, the situation in the registry seems a little worse. Apple has a couple of fonts using native (non-ASCII) file names. Switching from the default German to the French locale (see bug #20377 on how to do this on the Mac) causes the following changes in addition to the above:
-"Hiragino Mincho Pro (TrueType)"="Z:\Library\Fonts\\x30d2\x30e9\x30ae\x30ce... +"Hiragino Mincho Pro (TrueType)"="Z:\Library\Fonts\\xe3\x83\x92\xe3\x83\xa9... # The file name is ヒラギノ明朝 Pro W3.otf or similar. -"Locale"="00000407" +"Locale"="0000040c" -"sCountry"="Germany" +"sCountry"="France" -"sLanguage"="DEU" +"sLanguage"="FRA"
I.e. the filename's encoding was changed. I don't know whether it's consistent with the codepage, but I see no reason why switching from German (UTF-8) to French (UTF-8) should cause Wine to change - the codepage or - filename encodings.
Regards, Jörg Höhle
http://bugs.winehq.org/show_bug.cgi?id=20517
--- Comment #1 from Dmitry Timoshkov dmitry@codeweavers.com 2009-10-30 03:50:54 --- These changes in the registry reflect the locale change. What is the problem?
http://bugs.winehq.org/show_bug.cgi?id=20517
--- Comment #2 from Alexandre Julliard julliard@winehq.org 2009-10-30 04:23:00 --- The font path thing does look suspicious, it should remain in Unicode, not be converted to utf-8.
http://bugs.winehq.org/show_bug.cgi?id=20517
--- Comment #3 from Jörg Höhle hoehle@users.sourceforge.net 2009-10-30 04:33:17 --- The problem is that Wine can be in LANG=de_DE.UTF-8 with either cp437 or cp850. There should be only one.
The codepage has an impact on some programs and should be set deterministically, so users know what to expect. Here I show that its value depends on the history of language switches, not on the current language setting.
Reading http://en.wikipedia.org/wiki/Code_page_850 and http://en.wikipedia.org/wiki/CP437 it would seem that CP850 is a more reasonable default for French and German (perhaps CP437 for LANG=C?), but I don't know what would be best for apps running in Wine.
On the Mac, switching from German to French should be no reason to switch the codepage -- so it seems naively, as I'd expect these two western european languages to use the same codepage. Maybe that's a distinct issue?
http://bugs.winehq.org/show_bug.cgi?id=20517
--- Comment #4 from Jörg Höhle hoehle@users.sourceforge.net 2009-10-30 04:47:16 --- Regarding font changes, here are further notes of mine. I never mentioned them earlier because I was unsure whether it may be a Gnome/Fontconfig issue.
$LANG=xyz changes some font attributes (LANG=de_DE.UTF-8) rm -rf .wine; wine winecfg [...]; wine notepad select menu -> Bearbeiten -> Schriftarten; then close it. Afterwards: LANG=C wine notepad -> Edit -> Fonts causes both system.reg and user.reg to change a few font attributes.
-"AlMateen Bold (TrueType)"=... +"AlMateen-Bold Bold (TrueType)"=... and some more with this xyz-Bold suffix scheme.
DejaVu stands out, changing the number of entries. -"DejaVu Sans Condensed Bold (TrueType)"="Z:...\ttf-dejavu\DejaVuSansCondensed-Bold.ttf" -"DejaVu Sans Condensed Bold Oblique (TrueType)"="Z:...\ttf-dejavu\DejaVuSansCondensed-BoldOblique.ttf" -"DejaVu Sans Condensed Oblique (TrueType)"="Z:...\ttf-dejavu\DejaVuSansCondensed-Oblique.ttf" +"DejaVu Sans Condensed (TrueType)"="Z:...\ttf-dejavu\DejaVuSansCondensed.ttf" +"DejaVu Sans Condensed Condensed Bold (TrueType)"="Z:...\ttf-dejavu\DejaVuSansCondensed-Bold.ttf" +"DejaVu Sans Condensed Condensed Bold Oblique (TrueType)"="Z:...\ttf-dejavu\DejaVuSansCondensed-BoldOblique.ttf" +"DejaVu Sans Condensed Condensed Oblique (TrueType)"="Z:...\ttf-dejavu\DejaVuSansCondensed-Oblique.ttf" +"DejaVu Sans Light (TrueType)"="Z:...\ttf-dejavu\DejaVuSans-ExtraLight.ttf" Likewise for DejaVu Serif Condensed.
One font appears out of nowhere: +"utkal (TrueType)"="Z:\usr\share\fonts\truetype\ttf-indic-fonts-core\utkal.ttf"
(default LANG) wine notepad restores the previous registry entries.
Might as well be an issue with FreeType/FontConfig/Gnome/Ubuntu E.g. gedit -> DejaVu Serif shows 8 style names (correct), but "Condensed" appears double and "Condensed Italic" is missing. Same results with or without LANG=C.
Maybe it's related to bug #7779, comment #0 "Wine displays only the fonts conforming to these codepages"?
http://bugs.winehq.org/show_bug.cgi?id=20517
--- Comment #5 from Alexandre Julliard julliard@winehq.org 2009-10-30 05:17:33 --- The root of the problem is that Windows assumes a system-wide locale, while it can be set per-process on Unix. So if you run processes under different locales with the same registry then the entries will change depending on which process updates them. The alternative would be to ignore the specified Unix locale, but that wouldn't be an improvement.
http://bugs.winehq.org/show_bug.cgi?id=20517
--- Comment #6 from Jörg Höhle hoehle@users.sourceforge.net 2009-10-30 06:59:42 ---
So if you run processes under different locales with the same registry
I was not running multiple processes simultaneously. It's all sequential.
LANG=de_DE.UTF-8 rm -rf .wine wine winecfg # 1. Wait until wineserver exists cd .wine; mkdir orig; cp *.reg orig/ LANG=C wine winecfg; # 2. wait again wine winecfg; # 3. wait again diff orig/ .
It's normal that the entries change while using a different LANG. But in any of the 3 invocations, all threads within Wine share the same LANG, and I "simply" expect the third invocation to put in place the same codepage that was set during the first invocation (assuming some sort of LANG->codepage mapping), as they both use LANG=de_DE.UTF-8.
I've never tried running 2 apps within the same wineserver with different LANG settings.
http://bugs.winehq.org/show_bug.cgi?id=20517
--- Comment #7 from Alexandre Julliard julliard@winehq.org 2009-10-30 07:18:16 --- I see, that one is because wine.inf redefines the codepages. It probably shouldn't.
http://bugs.winehq.org/show_bug.cgi?id=20517
Jörg Höhle hoehle@users.sourceforge.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #8 from Jörg Höhle hoehle@users.sourceforge.net 2009-11-18 16:33:02 --- Fixed in 1.1.33 by Alexandre's commit cf8fa5459abe7a56c156c884882bb337ef3bcec1 The changes to the registry are restored to their initial state.
What I've not yet done is test whether some of my multilingual French and German apps now finally start in their native language instead of English.
http://bugs.winehq.org/show_bug.cgi?id=20517
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2009-12-04 12:16:22 --- Closing bugs fixed in 1.1.34.