ShellPkg/CommandLib: Use first found UC for unsupported PlatformLang

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2300

On some firmwares PlatformLang is set to the local language (e.g. ru-RU),
however there is no Unicode Collation protocol instance that supports it.
As for missing PlatformLang, fall back to the first found instance.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de>
This commit is contained in:
Marvin H?user 2019-11-05 21:50:44 +08:00 committed by Liming Gao
parent 0cecb1f99e
commit 9e9f0be353
1 changed files with 5 additions and 1 deletions

View File

@ -107,9 +107,13 @@ CommandInit(
//
// Without clue provided use the first Unicode Collation2 protocol.
// This may happen when PlatformLang is NULL or when no installed Unicode
// Collation2 protocol instance supports PlatformLang.
//
if (PlatformLang == NULL) {
if (gUnicodeCollation == NULL) {
gUnicodeCollation = Uc;
}
if (PlatformLang == NULL) {
break;
}