On Fri, 24 Mar 2000, Dmitry Timoshkov wrote:
> Okay, you don't like an idea to have centralized place for all encodings.
That depends. The source files can be in one place for all I care, it's
the runtime environment that this was about, where the x11drv should only
use the standard windows API exported from the Wine core. The X11
encodings do not have assigned codepages, so they should not be in the
codepage registry (and thus not exported from the core), but be considered
"custom codepages" in the x11drv, and so should use the RtlCustomCP
routines with its own (embedded or not) tables, rather than absolutely
require these driver-specific tables to be in the Wine core.
> But all, that I have in mind is to make things as simple as it can be.
> Using RtlCustomCPToUnicodeN and RtlUnicodeToCustomCPN is anything but not an
> intrusive intention at all.
As I've shown, using RtlCustomCP routines can be done without using
RtlInitCodePageTable, but not without contradicting centralization and
export cleanliness. That's why I've been advocating you putting the custom
codepages (X11 encodings) into the x11drv so that you can do the IMO right
thing, to use the RtlCustomCP routines.
> I think that changing in registry
>
> [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Nls\Codepage]
> "ACP"="1252"
> "OEMCP"="437"
> "MACCP"="1000"
>
> to any appropriate values should be enough to make user happy without
> recompilation.
As discussed earlier, the user should get happy just by setting the
standard LANG, LC_ALL, or LC_CTYPE, etc, environment variables, which
determines the user's locale, then the codepages are acquired with
ACP = GetLocaleInfo(locale,LOCALE_IDEFAULTANSICODEPAGE)
OEMCP = GetLocaleInfo(locale,LOCALE_IDEFAULTCODEPAGE)
MACCP = GetLocaleInfo(locale,LOCALE_IDEFAULTMACCODEPAGE)
Configuration should be as automatic as possible, they shouldn't need to
mess with their registry when they have already set up the rest of their
system with the desired locale using the LANG or LC_ALL env var; most of
the users probably don't even know what a codepage is.
I see there's some code to deduce the locale in misc/main.c (though the
implementation appears buggy to me (the LANG_SUB_ENTRIES macro lacks curly
braces around the two statements after the "if") and thus may not work
properly right now), called from ole/ole2nls.c. It shouldn't be hard to
also use this to deduce the codepage using the locale info.
> What do you think about including of files with all possible encodings
> from ftp.unocode.org in the same form to Wine tree?
Okay with me, though Alexandre would have the final say.