Hi Jaben,
Can you help to review this patch, thanks.
Based on new spec request, when call function
GetDriverName()/RunDiagnostics()/GetControllerName(), Callers of interfaces
that require RFC 4646 language codes to retrieve a Unicode string, must use the
RFC 4647 algorithm to lookup the Unicode string with the closest matching RFC
4646 language code. But for current implementation, if user input a language,
shell will base on this language to get the string, else shell will get the
first language from the supported language list to get the string. It is not
follow the rule defined in RFC 4647.
In my patch, I update the logic about how to select language which will be used
to get string: base on below priority list to get best language: 1. user input
language 2.current platform language 3.support language list to get the
language from the support language list, user input language has the highest
priority and support language list has the lowest priority.
In this patch, mainly changes includes:
GetBestLanguageForDriver() behavior is changed.
GetBestLanguageForDriver() API is exposed as Library API.
Current only one place(exported library interface GetStringNameFromHandle) use
GetBestLanguageForDriver function, and I have update the logic for it.
New logic for GetBestLanguageForDriver is better than the old one:
old logic last use hard code "en" or "en-US", may still can't find one(if
language support list without English)
new logic use the "supportedLanguages" as the lowest priority one, that will
make this function always return one.
Old logic:
BestLanguage = GetBestLanguage(
SupportedLanguages,
Iso639Language,
(LanguageVariable != NULL) ? LanguageVariable : "",
Iso639Language ? "en" : "en-US",
NULL
);
New logic:
BestLanguage = GetBestLanguage(
SupportedLanguages,
Iso639Language,
(InputLanguage != NULL) ? InputLanguage : "",
(LanguageVariable != NULL) ? LanguageVariable : "",
SupportedLanguages,
NULL
);
Thanks,
Eric
Get Best language logic.patch
Description: Get Best language logic.patch
------------------------------------------------------------------------------ Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more! Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save! http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
