+ for (Index = 0; Index < NumHandles; Index++) {\r
+ //\r
+ // Open Unicode Collation Protocol\r
+ //\r
+ Status = gBS->OpenProtocol (\r
+ Handles[Index],\r
+ &gEfiUnicodeCollation2ProtocolGuid,\r
+ (VOID **) &Uc,\r
+ gImageHandle,\r
+ NULL,\r
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ continue;\r
+ }\r
+\r
+ //\r
+ // Find the best matching matching language from the supported languages\r
+ // of Unicode Collation2 protocol. \r
+ //\r
+ BestLanguage = GetBestLanguage (\r
+ Uc->SupportedLanguages,\r
+ FALSE,\r
+ PlatformLang,\r
+ NULL\r
+ );\r
+ if (BestLanguage != NULL) {\r
+ FreePool (BestLanguage);\r
+ gUnicodeCollation = Uc;\r
+ break;\r
+ }\r
+ }\r
+ if (Handles != NULL) {\r
+ FreePool (Handles);\r
+ }\r
+ FreePool (PlatformLang);\r