(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>\r
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
\r
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
EFI_STATUS Status;\r
CHAR8 *PlatformLang;\r
\r
- GetEfiGlobalVariable2 (EFI_PLATFORM_LANG_VARIABLE_NAME, (VOID**)&PlatformLang, NULL);\r
- if (PlatformLang == NULL) {\r
- return EFI_UNSUPPORTED;\r
- }\r
-\r
if (gUnicodeCollation == NULL) {\r
+\r
+ GetEfiGlobalVariable2 (EFI_PLATFORM_LANG_VARIABLE_NAME, (VOID**)&PlatformLang, NULL);\r
+\r
Status = gBS->LocateHandleBuffer (\r
ByProtocol,\r
&gEfiUnicodeCollation2ProtocolGuid,\r
continue;\r
}\r
\r
+ //\r
+ // Without clue provided use the first Unicode Collation2 protocol.\r
+ //\r
+ if (PlatformLang == NULL) {\r
+ gUnicodeCollation = Uc;\r
+ break;\r
+ }\r
+\r
//\r
// Find the best matching matching language from the supported languages\r
// of Unicode Collation2 protocol.\r
if (Handles != NULL) {\r
FreePool (Handles);\r
}\r
- FreePool (PlatformLang);\r
+ if (PlatformLang != NULL) {\r
+ FreePool (PlatformLang);\r
+ }\r
}\r
\r
return (gUnicodeCollation == NULL) ? EFI_UNSUPPORTED : EFI_SUCCESS;\r