/* If Language is a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable that matches the language code specified by Language, then it is returned in UnicodeString. */
EFI_STATUS EFIAPI LookupUnicodeString(IN CONST CHAR8 *Language, IN CONST CHAR8 *SupportedLanguages, IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable, OUT CHAR16 **UnicodeString)
/* If Language is a member of SupportedLanguages and a Unicode string is found in UnicodeStringTable that matches the language code specified by Language, then it is returned in UnicodeString. */
EFI_STATUS EFIAPI LookupUnicodeString(IN CONST CHAR8 *Language, IN CONST CHAR8 *SupportedLanguages, IN CONST EFI_UNICODE_STRING_TABLE *UnicodeStringTable, OUT CHAR16 **UnicodeString)
{
  if ((Language == NULL) || (UnicodeString == NULL)) {
    return EFI_INVALID_PARAMETER;
  }
  if ((SupportedLanguages == NULL) || (UnicodeStringTable == NULL)) {
    return EFI_UNSUPPORTED;
  }
  while (*SupportedLanguages != 0) {
    if (CompareIso639LanguageCode (Language, SupportedLanguages)) {
      while (UnicodeStringTable->Language != NULL) {
        if (CompareIso639LanguageCode (Language, UnicodeStringTable->Language)) {
          *UnicodeString = UnicodeStringTable->UnicodeString;
          return EFI_SUCCESS;
        }
        UnicodeStringTable++;
      }
      return EFI_UNSUPPORTED;
    }
    SupportedLanguages += 3;
  }
  return EFI_UNSUPPORTED;
}