/** @file\r
Implementation of translation upon VT-UTF8.\r
\r
-Copyright (c) 2006 - 2009, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, 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
// and translate it into unicode, then push\r
// the unicode into unicode fifo, until the raw fifo is empty.\r
//\r
- while (!IsRawFiFoEmpty (TerminalDevice)) {\r
+ while (!IsRawFiFoEmpty (TerminalDevice) && !IsUnicodeFiFoFull (TerminalDevice)) {\r
\r
GetOneValidUtf8Char (TerminalDevice, &Utf8Char, &ValidBytes);\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 > 2) {\r
+ if (Index == 1) {\r
+ Utf8Char->Utf8_3[1] = Temp;\r
+ Index++;\r
+ } else {\r
+ Utf8Char->Utf8_3[0] = Temp;\r
FetchFlag = FALSE;\r
}\r
} else {\r