/** @file\r
Implementation of translation upon VT-UTF8.\r
\r
-Copyright (c) 2006, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
#include "Terminal.h"\r
\r
/**\r
- Translate all VT-UTF8 characters in the Raw FIFI into unicode characters, \r
+ Translate all VT-UTF8 characters in the Raw FIFI into unicode characters,\r
and insert them into Unicode FIFO.\r
\r
@param TerminalDevice The terminal device.\r
\r
- @return None.\r
-\r
**/\r
VOID\r
VTUTF8RawDataToUnicode (\r
\r
@param Utf8Device The terminal device.\r
@param Utf8Char Returned valid VT-UTF8 characters set.\r
- @param ValidBytes The count of returned VT-VTF8 characters. \r
+ @param ValidBytes The count of returned VT-VTF8 characters.\r
If ValidBytes is zero, no valid VT-UTF8 returned.\r
\r
**/\r
break;\r
\r
case 2:\r
+ //\r
+ // two-byte utf8 char go on\r
+ //\r
if ((Temp & 0xc0) == 0x80) {\r
\r
Utf8Char->Utf8_2[0] = Temp;\r
break;\r
\r
case 3:\r
+ //\r
+ // three-byte utf8 char go on\r
+ //\r
if ((Temp & 0xc0) == 0x80) {\r
\r
Utf8Char->Utf8_3[2 - Index] = Temp;\r
Index++;\r
- if (Index == 3) {\r
+ if (Index > 2) {\r
FetchFlag = FALSE;\r
}\r
} else {\r
-\r
+ //\r
+ // reset *ValidBytes and Index to zero, let valid utf8 char search restart\r
+ //\r
*ValidBytes = 0;\r
Index = 0;\r
}\r
return ;\r
}\r
\r
-/** \r
+/**\r
Translate VT-UTF8 characters into one Unicode character.\r
\r
UTF8 Encoding Table\r
\r
@param Utf8Char VT-UTF8 character set needs translating.\r
@param ValidBytes The count of valid VT-UTF8 characters.\r
- @param UnicodeChar Returned unicode character. \r
- \r
- @return None.\r
+ @param UnicodeChar Returned unicode character.\r
\r
**/\r
VOID\r
return ;\r
}\r
\r
-/** \r
+/**\r
Translate one Unicode character into VT-UTF8 characters.\r
\r
UTF8 Encoding Table\r
@param Utf8Char Return VT-UTF8 character set.\r
@param ValidBytes The count of valid VT-UTF8 characters. If\r
ValidBytes is zero, no valid VT-UTF8 returned.\r
- \r
- @return None.\r
\r
**/\r
VOID\r
Check if input string is valid VT-UTF8 string.\r
\r
@param TerminalDevice The terminal device.\r
- @param WString The input string. \r
- \r
+ @param WString The input string.\r
+\r
@retval EFI_SUCCESS If all input characters are valid.\r
\r
**/\r