Freeciv-3.3
|
Go to the source code of this file.
Macros | |
#define | fc_ut8_next_char(utf8_char) (utf8_char + fc_utf8_skip[*(unsigned char *) utf8_char]) |
Variables | |
const char | fc_utf8_skip [256] |
Jump to next UTF-8 character start.
NB: This function can return a invalid UTF-8 character. Check with fc_utf8_char_validate() to ensure.
Definition at line 204 of file fc_utf8.c.
Referenced by base_fc_utf8_strlcpy_rep().
size_t size_t size_t size_t int fc_utf8_snprintf_trunc | ( | char * | str, |
size_t | n, | ||
const char * | format, | ||
... | |||
) |
Returns the number of characters in the string 'utf8_string'. To know the number of used bytes, used strlen() instead.
NB: 'utf8_string' must be UTF-8 valid (see fc_utf8_validate()), or the behaviour of this function will be unknown.
Returns TRUE if the string 'utf8_string' contains only valid UTF-8 characters. If 'end' is not nullptr, the end of the valid string will be stored there, even if it returns TRUE.
See also fc_utf8_validate_len().
Definition at line 239 of file fc_utf8.c.
Referenced by fc_utf8_validate_trunc(), fc_utf8_validate_trunc_dup(), fc_utf8_vsnprintf_rep(), and fc_utf8_vsnprintf_trunc().
Returns TRUE if the string 'utf8_string' contains only valid UTF-8 characters in the limit of the length (in bytes) 'byte_len'. If 'end' is not nullptr, the end of the valid string will be stored there, even if it returns TRUE.
See also fc_utf8_validate().
Definition at line 269 of file fc_utf8.c.
Referenced by base_fc_utf8_strlcpy_rep(), base_fc_utf8_strlcpy_trunc(), and fc_utf8_validate_trunc_len().
Duplicate 'utf8_string' and replace all invalid characters with the replacement character.
See also fc_utf8_validate_rep_len(), and fc_utf8_validate_trunc_dup().
Transform 'utf8_string' with replacing all invalid characters with the replacement character in the limit of 'byte_len', truncate the last character. Returns 'utf8_string'.
See also fc_utf8_validate_len(), fc_utf8_validate_trunc(), and fc_utf8_validate_rep_dup().
Definition at line 369 of file fc_utf8.c.
Referenced by fc_utf8_vsnprintf_rep().
Truncate the string 'utf8_string' at the first invalid UTF-8 character. Returns 'utf8_string'.
See also fc_utf8_validate(), fc_utf8_validate_trunc_len(), and fc_utf8_validate_trunc_dup().
Duplicate the truncation of the string 'utf8_string' at the first invalid UTF-8 character.
See also fc_utf8_validate_trunc(), fc_utf8_validate_trunc_len(), and fc_utf8_validate_rep_dup().
Truncate the string 'utf8_string' at the first invalid UTF-8 character in the limit (in bytes) of 'byte_len'. Returns 'utf8_string'.
See also fc_utf8_validate_trunc(), fc_utf8_validate_trunc_dup(), and fc_utf8_validate_rep_len().