#include <stddef.h>
Go to the source code of this file.
Defines | |
#define | UTF8_CONTINUATION_BYTE(c) (((c) & 0xc0) == 0x80) |
Functions | |
int | UTF8_delete_char (char *s, int pos) |
Delete a whole (possibly multibyte) character from a string. | |
int | UTF8_insert_char (char *s, int n, int pos, int codepoint) |
Insert a (possibly multibyte) UTF-8 character into a string. | |
int | UTF8_char_len (unsigned char c) |
length of UTF-8 character starting with this byte. | |
int | UTF8_encoded_len (int codepoint) |
size_t | UTF8_strlen (const char *str) |
Count the number of character (not the number of bytes) of a zero termination string. | |
char * | UTF8_strncpyz (char *dest, const char *src, size_t limit) |
UTF8 capable string copy function. |
Definition in file utf8.h.
#define UTF8_CONTINUATION_BYTE | ( | c | ) | (((c) & 0xc0) == 0x80) |
Is this the second or later byte of a multibyte UTF-8 character?
Definition at line 36 of file utf8.h.
Referenced by R_FontFindFit(), R_FontFindTruncFit(), R_FontMakeChunks(), and UTF8_delete_char().
int UTF8_char_len | ( | unsigned char | c | ) |
length of UTF-8 character starting with this byte.
Definition at line 103 of file utf8.c.
Referenced by Com_sprintf(), R_FontMakeChunks(), UTF8_strlen(), and UTF8_strncpyz().
int UTF8_delete_char | ( | char * | s, | |
int | pos | |||
) |
Delete a whole (possibly multibyte) character from a string.
[in] | s | Start of the string |
[in] | pos | Offset from the start |
Definition at line 35 of file utf8.c.
References next, and UTF8_CONTINUATION_BYTE.
Referenced by Key_Message(), and UI_TextEntryNodeEdit().
int UTF8_encoded_len | ( | int | c | ) |
Calculate how long a Unicode code point (such as returned by SDL key events in unicode mode) would be in UTF-8 encoding.
Definition at line 124 of file utf8.c.
Referenced by Key_Message(), UI_TextEntryNodeEdit(), and UTF8_insert_char().
int UTF8_insert_char | ( | char * | s, | |
int | n, | |||
int | pos, | |||
int | c | |||
) |
Insert a (possibly multibyte) UTF-8 character into a string.
[in] | s | Start of the string |
[in] | n | Buffer size of the string |
[in] | pos | Offset from the start |
[in] | c | Unicode code as 32-bit integer |
Definition at line 60 of file utf8.c.
References UTF8_encoded_len().
Referenced by Key_Message(), and UI_TextEntryNodeEdit().
size_t UTF8_strlen | ( | const char * | str | ) |
Count the number of character (not the number of bytes) of a zero termination string.
Definition at line 143 of file utf8.c.
References UTF8_char_len().
Referenced by UI_TextEntryNodeDraw().
char* UTF8_strncpyz | ( | char * | dest, | |
const char * | src, | |||
size_t | limit | |||
) |
UTF8 capable string copy function.
[out] | dest | Pointer to the output string |
[in] | src | Pointer to the input string |
[in] | limit | Maximum number of bytes to copy |
Definition at line 162 of file utf8.c.
References i, and UTF8_char_len().
Referenced by Q_strncpyz(), and testStringCopiers().