|
iPXE
|
UTF-8 Unicode encoding. More...
#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | utf8_accumulator |
| A UTF-8 character accumulator. More... | |
Macros | |
| #define | UTF8_MAX_LEN 4 |
| Maximum length of UTF-8 sequence. | |
| #define | UTF8_MIN_TWO 0x80 |
| Minimum legal value for two-byte UTF-8 sequence. | |
| #define | UTF8_MIN_THREE 0x800 |
| Minimum legal value for three-byte UTF-8 sequence. | |
| #define | UTF8_MIN_FOUR 0x10000 |
| Minimum legal value for four-byte UTF-8 sequence. | |
| #define | UTF8_HIGH_BIT 0x80 |
| High bit of UTF-8 bytes. | |
| #define | UTF8_CONTINUATION_BITS 6 |
| Number of data bits in each continuation byte. | |
| #define | UTF8_CONTINUATION_MASK ( ( 1 << UTF8_CONTINUATION_BITS ) - 1 ) |
| Bit mask for data bits in a continuation byte. | |
| #define | UTF8_CONTINUATION 0x80 |
| Non-data bits in a continuation byte. | |
| #define | UTF8_IS_CONTINUATION(byte) |
| Check for a continuation byte. | |
| #define | UTF8_IS_ASCII(byte) |
| Check for an ASCII byte. | |
| #define | UTF8_INVALID 0xfffd |
| Invalid character returned when decoding fails. | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| unsigned int | utf8_accumulate (struct utf8_accumulator *utf8, uint8_t byte) |
| Accumulate Unicode character from UTF-8 byte sequence. | |
UTF-8 Unicode encoding.
Definition in file utf8.h.
| #define UTF8_MAX_LEN 4 |
Maximum length of UTF-8 sequence.
Definition at line 16 of file utf8.h.
Referenced by utf8_accumulate().
| #define UTF8_MIN_TWO 0x80 |
Minimum legal value for two-byte UTF-8 sequence.
Definition at line 19 of file utf8.h.
Referenced by utf8_accumulate().
| #define UTF8_MIN_THREE 0x800 |
Minimum legal value for three-byte UTF-8 sequence.
Definition at line 22 of file utf8.h.
Referenced by utf8_accumulate().
| #define UTF8_MIN_FOUR 0x10000 |
Minimum legal value for four-byte UTF-8 sequence.
Definition at line 25 of file utf8.h.
Referenced by utf8_accumulate().
| #define UTF8_HIGH_BIT 0x80 |
| #define UTF8_CONTINUATION_BITS 6 |
Number of data bits in each continuation byte.
Definition at line 31 of file utf8.h.
Referenced by utf8_accumulate().
| #define UTF8_CONTINUATION_MASK ( ( 1 << UTF8_CONTINUATION_BITS ) - 1 ) |
Bit mask for data bits in a continuation byte.
Definition at line 34 of file utf8.h.
Referenced by utf8_accumulate().
| #define UTF8_CONTINUATION 0x80 |
| #define UTF8_IS_CONTINUATION | ( | byte | ) |
Check for a continuation byte.
| byte | UTF-8 byte |
| is_continuation | Byte is a continuation byte |
Definition at line 44 of file utf8.h.
Referenced by utf8_accumulate().
| #define UTF8_IS_ASCII | ( | byte | ) |
Check for an ASCII byte.
| byte | UTF-8 byte |
| is_ascii | Byte is an ASCII byte |
Definition at line 52 of file utf8.h.
Referenced by utf8_accumulate().
| #define UTF8_INVALID 0xfffd |
Invalid character returned when decoding fails.
Definition at line 55 of file utf8.h.
Referenced by efi_putchar(), and utf8_accumulate().
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
|
extern |
Accumulate Unicode character from UTF-8 byte sequence.
| utf8 | UTF-8 accumulator |
| byte | UTF-8 byte |
| character | Unicode character, or 0 if incomplete |
Definition at line 44 of file utf8.c.
References assert, utf8_accumulator::character, DBGC, DBGC2, len, min, utf8_accumulator::min, utf8_accumulator::remaining, tmp, UTF8_CONTINUATION_BITS, UTF8_CONTINUATION_MASK, UTF8_HIGH_BIT, UTF8_INVALID, UTF8_IS_ASCII, UTF8_IS_CONTINUATION, UTF8_MAX_LEN, UTF8_MIN_FOUR, UTF8_MIN_THREE, and UTF8_MIN_TWO.
Referenced by efi_putchar(), fbcon_putchar(), and utf8_accumulate_okx().