36 if ((ValidBytes < 1) || (ValidBytes > 3)) {
79 switch (*ValidBytes) {
81 if ((Temp & 0x80) == 0) {
87 Utf8Char->Utf8_1 = Temp;
90 }
else if ((Temp & 0xe0) == 0xc0) {
96 Utf8Char->Utf8_2[1] = Temp;
97 }
else if ((Temp & 0xf0) == 0xe0) {
103 Utf8Char->Utf8_3[2] = Temp;
119 if ((Temp & 0xc0) == 0x80) {
120 Utf8Char->Utf8_2[0] = Temp;
133 if ((Temp & 0xc0) == 0x80) {
135 Utf8Char->Utf8_3[1] = Temp;
138 Utf8Char->Utf8_3[0] = Temp;
182 OUT CHAR16 *UnicodeChar
197 switch (ValidBytes) {
202 *UnicodeChar = (UINT16)Utf8Char.Utf8_1;
209 Byte0 = Utf8Char.Utf8_2[0];
210 Byte1 = Utf8Char.Utf8_2[1];
212 UnicodeByte0 = (UINT8)((Byte1 << 6) | (Byte0 & 0x3f));
213 UnicodeByte1 = (UINT8)((Byte1 >> 2) & 0x07);
214 *UnicodeChar = (UINT16)(UnicodeByte0 | (UnicodeByte1 << 8));
221 Byte0 = Utf8Char.Utf8_3[0];
222 Byte1 = Utf8Char.Utf8_3[1];
223 Byte2 = Utf8Char.Utf8_3[2];
225 UnicodeByte0 = (UINT8)((Byte1 << 6) | (Byte0 & 0x3f));
226 UnicodeByte1 = (UINT8)((Byte2 << 4) | ((Byte1 >> 2) & 0x0f));
227 *UnicodeChar = (UINT16)(UnicodeByte0 | (UnicodeByte1 << 8));
256 OUT UINT8 *ValidBytes
265 UnicodeByte0 = (UINT8)Unicode;
266 UnicodeByte1 = (UINT8)(Unicode >> 8);
268 if (Unicode < 0x0080) {
269 Utf8Char->Utf8_1 = (UINT8)(UnicodeByte0 & 0x7f);
271 }
else if (Unicode < 0x0800) {
276 Utf8Char->Utf8_2[1] = (UINT8)((UnicodeByte0 & 0x3f) + 0x80);
277 Utf8Char->Utf8_2[0] = (UINT8)((((UnicodeByte1 << 2) + (UnicodeByte0 >> 6)) & 0x1f) + 0xc0);
285 Utf8Char->Utf8_3[2] = (UINT8)((UnicodeByte0 & 0x3f) + 0x80);
286 Utf8Char->Utf8_3[1] = (UINT8)((((UnicodeByte1 << 2) + (UnicodeByte0 >> 6)) & 0x3f) + 0x80);
287 Utf8Char->Utf8_3[0] = (UINT8)(((UnicodeByte1 >> 4) & 0x0f) + 0xe0);
BOOLEAN RawFiFoRemoveOneKey(TERMINAL_DEV *TerminalDevice, UINT8 *Output)
BOOLEAN IsUnicodeFiFoFull(TERMINAL_DEV *TerminalDevice)
BOOLEAN UnicodeFiFoInsertOneKey(TERMINAL_DEV *TerminalDevice, UINT16 Input)
BOOLEAN IsRawFiFoEmpty(TERMINAL_DEV *TerminalDevice)
EFI_STATUS VTUTF8TestString(IN TERMINAL_DEV *TerminalDevice, IN CHAR16 *WString)
VOID VTUTF8RawDataToUnicode(IN TERMINAL_DEV *TerminalDevice)
VOID UnicodeToUtf8(IN CHAR16 Unicode, OUT UTF8_CHAR *Utf8Char, OUT UINT8 *ValidBytes)
VOID Utf8ToUnicode(IN UTF8_CHAR Utf8Char, IN UINT8 ValidBytes, OUT CHAR16 *UnicodeChar)
VOID GetOneValidUtf8Char(IN TERMINAL_DEV *Utf8Device, OUT UTF8_CHAR *Utf8Char, OUT UINT8 *ValidBytes)