+ UINTN Index;\r
+ UINTN StrLen;\r
+ CHAR8 *Lan1;\r
+ CHAR8 *Lan2;\r
+\r
+ //\r
+ // Convert to lower to compare.\r
+ //\r
+ StrLen = AsciiStrSize (Language1);\r
+ Lan1 = AllocateZeroPool (StrLen);\r
+ ASSERT (Lan1 != NULL);\r
+ AsciiStrCpy(Lan1, Language1);\r
+ AsciiHiiToLower (Lan1);\r
+\r
+ StrLen = AsciiStrSize (Language2);\r
+ Lan2 = AllocateZeroPool (StrLen);\r
+ ASSERT (Lan2 != NULL);\r
+ AsciiStrCpy(Lan2, Language2);\r
+ AsciiHiiToLower (Lan2);\r
+\r
+ //\r
+ // Compare the Primary Language in Language1 to Language2\r
+ //\r
+ for (Index = 0; Lan1[Index] != 0 && Lan1[Index] != ';'; Index++) {\r
+ if (Lan1[Index] != Lan2[Index]) {\r
+ //\r
+ // Return FALSE if any characters are different.\r
+ //\r
+ FreePool (Lan1);\r
+ FreePool (Lan2);\r
+ return FALSE;\r
+ }\r
+ }\r
+\r
+ FreePool (Lan1);\r
+ FreePool (Lan2);\r