From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.92.69.28]) by mx.groups.io with SMTP id smtpd.web09.3798.1572961847325626558 for ; Tue, 05 Nov 2019 05:50:47 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: outlook.de, ip: 40.92.69.28, mailfrom: mhaeuser@outlook.de) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b/q0v3h2JvgwInRJUPbZEuQpNFzmx+EhkUIBHru1BWYe1pgVU+PKGAMjXMOg1p3f3SY+qq2KH4mDnsGZVLzq/zGAmfBA1ho1QfrPJIx4JU2xV7QliJ0a1rqII9m71FlgLC2t0xp+jIukWI7+Yv2C+wNeauWlbftZPniR+a8gJGLwR1mL8f3JZWytSb1081h8ttKcJ/YPFU6h1X1766DZwIlKiYIWVMIaz71tvbiCFTqGUdQjAZpCgmjJu3U1nsnjtM6P7QS6d9Ke2MKAS64NIgiGlER2qQbCxPIn2wFfblA1l/INUDnCyx+XYFj8Ad21L/SG8Uhju/tpQ9u72iYa3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TZfhVjkhrFSKScyLNN3KwUPbX2Ov2OH7ApxUUzY71SM=; b=V4ArxHdeLccZ1B89jpcAl0hLBOtPFBmsorho4VlCx8NorEH3zSuYuKcmKegxUU2R7XBBTDaZ9VG3MKytiTh2ziejGy0k8xZI2xP+x/fs4ZSEnKud1t47ZK9b1rn0vCT1WYyieJE0WnnwomFq43vAD6w7U6uK9u5UpZXU7ORHNdJbXtgIGNkTePEWfHPm7rEj5Oas8bxLT60Sc1eVKcNxmLKXbwsIixHfBK47XvvFDEl+a57LE06iZQvMAFb0vgT8sbNCQ5r1QgqJmNYyIu1MbWC1W6JkL7BYyJVkVq8ccCLPOhKQEFmNRM0JMbn1rhnBNGo91vIj55hdzyMtZJFn1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from AM5EUR02FT055.eop-EUR02.prod.protection.outlook.com (10.152.8.53) by AM5EUR02HT124.eop-EUR02.prod.protection.outlook.com (10.152.9.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2387.20; Tue, 5 Nov 2019 13:50:45 +0000 Received: from VI1PR07MB4861.eurprd07.prod.outlook.com (10.152.8.60) by AM5EUR02FT055.mail.protection.outlook.com (10.152.9.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2387.20 via Frontend Transport; Tue, 5 Nov 2019 13:50:45 +0000 Received: from VI1PR07MB4861.eurprd07.prod.outlook.com ([fe80::3030:797a:f957:a698]) by VI1PR07MB4861.eurprd07.prod.outlook.com ([fe80::3030:797a:f957:a698%3]) with mapi id 15.20.2430.013; Tue, 5 Nov 2019 13:50:45 +0000 From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: "devel@edk2.groups.io" CC: Ray Ni , Zhichao Gao Subject: [PATCH] ShellPkg/CommandLib: Use first found UC for unsupported PlatformLang Thread-Topic: [PATCH] ShellPkg/CommandLib: Use first found UC for unsupported PlatformLang Thread-Index: AQHVk+AF+n3lPOrv/kOINTfjJhF8gQ== Date: Tue, 5 Nov 2019 13:50:44 +0000 Message-ID: Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM0PR0102CA0035.eurprd01.prod.exchangelabs.com (2603:10a6:208:14::48) To VI1PR07MB4861.eurprd07.prod.outlook.com (2603:10a6:803:8e::27) x-incomingtopheadermarker: OriginalChecksum:575FAF85FEDB4ACD6070269A5510FEF6D02BE87F78DEC1D84B4FF2461F62FC72;UpperCasedChecksum:C1A87BFFBEC8B131F00283CF38BDFB5B7AFB3EDA02D2425804EB314F3F434414;SizeAsReceived:7299;Count:48 x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.23.0.windows.1 x-tmn: [WItuO/ozuEs5+inBRd75usYtRwCg339b] x-microsoft-original-message-id: <1080ff8633dfde54408cbc31214b99fdd8c2bcc7.1572961771.git.mhaeuser@outlook.de> x-ms-publictraffictype: Email x-incomingheadercount: 48 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 52388a14-37b5-4f9b-7f52-08d761f72767 x-ms-traffictypediagnostic: AM5EUR02HT124: x-ms-exchange-purlcount: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5+s/lxXof5iG0Zq8cl8PVotKnZFWzmRjTsuEqOJ/V37t2LPPGovOXfYyOpSwcd9OaqV54Q7jaU41Qcd/y0eKlk2jeHaogR07bc9SC/ChH/xli1GUThrDo8g8FeMFqcHEWbWVGjIyMqmoz6gaOyLLR6ebEPbmNQwK/4GHt5R5PV8GGgn8al7jO2/glHrDqO6KK80keDsooxT/Kf8TV8X6QgR9tfea6kWGwhq6uLwPixU= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 52388a14-37b5-4f9b-7f52-08d761f72767 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2019 13:50:45.0470 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5EUR02HT124 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2300 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 Cc: Zhichao Gao Reviewed-by: Zhichao Gao Signed-off-by: Marvin Haeuser --- ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/S= hellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c index 4c48b65fbc1d..345808a1eac6 100644 --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c @@ -107,9 +107,13 @@ CommandInit( =0D //=0D // Without clue provided use the first Unicode Collation2 protocol.= =0D + // This may happen when PlatformLang is NULL or when no installed Un= icode=0D + // Collation2 protocol instance supports PlatformLang.=0D //=0D - if (PlatformLang =3D=3D NULL) {=0D + if (gUnicodeCollation =3D=3D NULL) {=0D gUnicodeCollation =3D Uc;=0D + }=0D + if (PlatformLang =3D=3D NULL) {=0D break;=0D }=0D =0D --=20 2.23.0.windows.1