TianoCore EDK2 master
Loading...
Searching...
No Matches
Vtutf8.c File Reference
#include "Terminal.h"

Go to the source code of this file.

Functions

VOID VTUTF8RawDataToUnicode (IN TERMINAL_DEV *TerminalDevice)
 
VOID GetOneValidUtf8Char (IN TERMINAL_DEV *Utf8Device, OUT UTF8_CHAR *Utf8Char, OUT UINT8 *ValidBytes)
 
VOID Utf8ToUnicode (IN UTF8_CHAR Utf8Char, IN UINT8 ValidBytes, OUT CHAR16 *UnicodeChar)
 
VOID UnicodeToUtf8 (IN CHAR16 Unicode, OUT UTF8_CHAR *Utf8Char, OUT UINT8 *ValidBytes)
 
EFI_STATUS VTUTF8TestString (IN TERMINAL_DEV *TerminalDevice, IN CHAR16 *WString)
 

Detailed Description

Implementation of translation upon VT-UTF8.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file Vtutf8.c.

Function Documentation

◆ GetOneValidUtf8Char()

VOID GetOneValidUtf8Char ( IN TERMINAL_DEV Utf8Device,
OUT UTF8_CHAR Utf8Char,
OUT UINT8 *  ValidBytes 
)

Get one valid VT-UTF8 characters set from Raw Data FIFO.

Parameters
Utf8DeviceThe terminal device.
Utf8CharReturned valid VT-UTF8 characters set.
ValidBytesThe count of returned VT-VTF8 characters. If ValidBytes is zero, no valid VT-UTF8 returned.

Definition at line 56 of file Vtutf8.c.

◆ UnicodeToUtf8()

VOID UnicodeToUtf8 ( IN CHAR16  Unicode,
OUT UTF8_CHAR Utf8Char,
OUT UINT8 *  ValidBytes 
)

Translate one Unicode character into VT-UTF8 characters.

UTF8 Encoding Table Bits per Character | Unicode Character Range | Unicode Binary Encoding | UTF8 Binary Encoding 0-7 | 0x0000 - 0x007F | 00000000 0xxxxxxx | 0xxxxxxx 8-11 | 0x0080 - 0x07FF | 00000xxx xxxxxxxx | 110xxxxx 10xxxxxx 12-16 | 0x0800 - 0xFFFF | xxxxxxxx xxxxxxxx | 1110xxxx 10xxxxxx 10xxxxxx

Parameters
UnicodeUnicode character need translating.
Utf8CharReturn VT-UTF8 character set.
ValidBytesThe count of valid VT-UTF8 characters. If ValidBytes is zero, no valid VT-UTF8 returned.

Definition at line 253 of file Vtutf8.c.

◆ Utf8ToUnicode()

VOID Utf8ToUnicode ( IN UTF8_CHAR  Utf8Char,
IN UINT8  ValidBytes,
OUT CHAR16 *  UnicodeChar 
)

Translate VT-UTF8 characters into one Unicode character.

UTF8 Encoding Table Bits per Character | Unicode Character Range | Unicode Binary Encoding | UTF8 Binary Encoding 0-7 | 0x0000 - 0x007F | 00000000 0xxxxxxx | 0xxxxxxx 8-11 | 0x0080 - 0x07FF | 00000xxx xxxxxxxx | 110xxxxx 10xxxxxx 12-16 | 0x0800 - 0xFFFF | xxxxxxxx xxxxxxxx | 1110xxxx 10xxxxxx 10xxxxxx

Parameters
Utf8CharVT-UTF8 character set needs translating.
ValidBytesThe count of valid VT-UTF8 characters.
UnicodeCharReturned unicode character.

Definition at line 179 of file Vtutf8.c.

◆ VTUTF8RawDataToUnicode()

VOID VTUTF8RawDataToUnicode ( IN TERMINAL_DEV TerminalDevice)

Translate all VT-UTF8 characters in the Raw FIFI into unicode characters, and insert them into Unicode FIFO.

Parameters
TerminalDeviceThe terminal device.

Definition at line 19 of file Vtutf8.c.

◆ VTUTF8TestString()

EFI_STATUS VTUTF8TestString ( IN TERMINAL_DEV TerminalDevice,
IN CHAR16 *  WString 
)

Check if input string is valid VT-UTF8 string.

Parameters
TerminalDeviceThe terminal device.
WStringThe input string.
Return values
EFI_SUCCESSIf all input characters are valid.

Definition at line 303 of file Vtutf8.c.