]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/TerminalDxe/Vtutf8.c
MdeModulePkg: Removing ipf which is no longer supported from edk2.
[mirror_edk2.git] / MdeModulePkg / Universal / Console / TerminalDxe / Vtutf8.c
index 26fc13147a040aaf255dda636f3c145aac73da20..0768273863d09dbb6f698a13e7d86b8fdaeff8ae 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation of translation upon VT-UTF8.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, 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
@@ -36,7 +36,7 @@ VTUTF8RawDataToUnicode (
   // 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
@@ -177,10 +177,10 @@ GetOneValidUtf8Char (
   Translate VT-UTF8 characters into one Unicode character.\r
 \r
   UTF8 Encoding Table\r
-  Bits per Character | Unicode Character Range | Unicode Binary  Encoding |    UTF8 Binary Encoding\r
-        0-7             |     0x0000 - 0x007F     |     00000000 0xxxxxxx        |   0xxxxxxx\r
-        8-11          |     0x0080 - 0x07FF       |     00000xxx xxxxxxxx        |   110xxxxx 10xxxxxx\r
-       12-16          |     0x0800 - 0xFFFF       |     xxxxxxxx xxxxxxxx        |   1110xxxx 10xxxxxx 10xxxxxx\r
+  Bits per Character | Unicode Character Range | Unicode Binary  Encoding |  UTF8 Binary Encoding\r
+        0-7           |     0x0000 - 0x007F     |     00000000 0xxxxxxx    |   0xxxxxxx\r
+        8-11          |     0x0080 - 0x07FF     |     00000xxx xxxxxxxx     |   110xxxxx 10xxxxxx\r
+       12-16         |     0x0800 - 0xFFFF     |     xxxxxxxx xxxxxxxx    |   1110xxxx 10xxxxxx 10xxxxxx\r
 \r
 \r
   @param  Utf8Char         VT-UTF8 character set needs translating.\r
@@ -250,10 +250,10 @@ Utf8ToUnicode (
   Translate one Unicode character into VT-UTF8 characters.\r
 \r
   UTF8 Encoding Table\r
-  Bits per Character | Unicode Character Range | Unicode Binary  Encoding |    UTF8 Binary Encoding\r
-        0-7             |     0x0000 - 0x007F     |     00000000 0xxxxxxx        |   0xxxxxxx\r
-        8-11          |     0x0080 - 0x07FF       |     00000xxx xxxxxxxx        |   110xxxxx 10xxxxxx\r
-       12-16          |     0x0800 - 0xFFFF       |     xxxxxxxx xxxxxxxx        |   1110xxxx 10xxxxxx 10xxxxxx\r
+  Bits per Character | Unicode Character Range | Unicode Binary  Encoding |  UTF8 Binary Encoding\r
+        0-7           |     0x0000 - 0x007F     |     00000000 0xxxxxxx    |   0xxxxxxx\r
+        8-11          |     0x0080 - 0x07FF     |     00000xxx xxxxxxxx     |   110xxxxx 10xxxxxx\r
+       12-16         |     0x0800 - 0xFFFF     |     xxxxxxxx xxxxxxxx    |   1110xxxx 10xxxxxx 10xxxxxx\r
 \r
 \r
   @param  Unicode          Unicode character need translating.\r