/* Converts a Null-terminated string to legal characters in a FAT filename using an OEM character set. */
BOOLEAN EFIAPI EngStrToFat(IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN CHAR16 *String, IN UINTN FatSize, OUT CHAR8 *Fat)
/* Converts a Null-terminated string to legal characters in a FAT filename using an OEM character set. */
BOOLEAN EFIAPI EngStrToFat(IN EFI_UNICODE_COLLATION_PROTOCOL *This, IN CHAR16 *String, IN UINTN FatSize, OUT CHAR8 *Fat)
{
  BOOLEAN  SpecialCharExist;
  SpecialCharExist = FALSE;
  while ((*String != 0) && (FatSize != 0)) {
    if ((*String != '.') && (*String != ' ')) {
      if ((*String < MAP_TABLE_SIZE) && ((mEngInfoMap[*String] & CHAR_FAT_VALID) != 0)) {
        *Fat = mEngUpperMap[*String];
      } else {
        *Fat             = '_';
        SpecialCharExist = TRUE;
      }
      Fat     += 1;
      FatSize -= 1;
    }
    String += 1;
  }
  return SpecialCharExist;
}