/* Since each UCS2 character can be represented by 1-3 UTF8 encoded characters, this function is used to retrieve the UTF8 encoding size for a UCS2 character. */
UINT8 GetUTF8SizeForUCS2(IN CHAR8 *Utf8Buffer)
/* Since each UCS2 character can be represented by 1-3 UTF8 encoded characters, this function is used to retrieve the UTF8 encoding size for a UCS2 character. */
UINT8 GetUTF8SizeForUCS2(IN CHAR8 *Utf8Buffer)
{
  CHAR8  TempChar;
  UINT8  Utf8Size;
  ASSERT (Utf8Buffer != NULL);
  TempChar = *Utf8Buffer;
  if ((TempChar & 0xF0) == 0xF0) {
    return 0;
  }
  Utf8Size = 1;
  if ((TempChar & 0x80) == 0x80) {
    if ((TempChar & 0xC0) == 0xC0) {
      Utf8Size++;
      if ((TempChar & 0xE0) == 0xE0) {
        Utf8Size++;
      }
    }
  }
  return Utf8Size;
}