Blender V2.61 - r43446
|
Go to the source code of this file.
Defines | |
#define | BLI_UTF8_MAX 6 |
#define | BLI_UTF8_ERR ((unsigned int)-1) |
Functions | |
char * | BLI_strncpy_utf8 (char *dst, const char *src, size_t maxncpy) |
char * | BLI_strncat_utf8 (char *dst, const char *src, size_t maxncpy) |
int | BLI_utf8_invalid_byte (const char *str, int length) |
int | BLI_utf8_invalid_strip (char *str, int length) |
int | BLI_str_utf8_size (const char *p) |
unsigned int | BLI_str_utf8_as_unicode (const char *p) |
unsigned int | BLI_str_utf8_as_unicode_and_size (const char *p, size_t *index) |
unsigned int | BLI_str_utf8_as_unicode_step (const char *p, size_t *index) |
size_t | BLI_str_utf8_from_unicode (unsigned int c, char *outbuf) |
char * | BLI_str_find_prev_char_utf8 (const char *str, const char *p) |
char * | BLI_str_find_next_char_utf8 (const char *p, const char *end) |
char * | BLI_str_prev_char_utf8 (const char *p) |
size_t | BLI_wstrlen_utf8 (const wchar_t *src) |
size_t | BLI_strlen_utf8 (const char *strc) |
size_t | BLI_strncpy_wchar_as_utf8 (char *dst, const wchar_t *src, const size_t maxcpy) |
size_t | BLI_strncpy_wchar_from_utf8 (wchar_t *dst, const char *src, const size_t maxcpy) |
Definition in file BLI_string_utf8.h.
#define BLI_UTF8_ERR ((unsigned int)-1) |
Definition at line 57 of file BLI_string_utf8.h.
Referenced by blf_font_boundbox(), blf_font_draw(), BLI_str_utf8_as_unicode(), BLI_str_utf8_as_unicode_and_size(), BLI_str_utf8_as_unicode_step(), and BLI_strncpy_wchar_from_utf8().
#define BLI_UTF8_MAX 6 |
Definition at line 56 of file BLI_string_utf8.h.
Referenced by text_font_draw_character_utf8(), text_insert_invoke(), txt_add_char_intern(), txt_print_undo(), txt_redo_read_unicode(), txt_replace_char(), txt_undo_add_charop(), and txt_undo_read_unicode().
char* BLI_str_find_next_char_utf8 | ( | const char * | p, |
const char * | end | ||
) |
BLI_str_find_next_char_utf8: : a pointer to a position within a UTF-8 encoded string : a pointer to the byte following the end of the string, or NULL to indicate that the string is nul-terminated.
Finds the start of the next UTF-8 character in the string after .
does
not have to be at the beginning of a UTF-8 character. No check is made to see if the character found is actually valid other than it starts with an appropriate byte.
Return value: a pointer to the found character or NULL
Definition at line 528 of file string_utf8.c.
Referenced by BLI_str_utf8_as_unicode_step(), BLI_strncpy_wchar_from_utf8(), and ui_textedit_step_next_utf8().
char* BLI_str_find_prev_char_utf8 | ( | const char * | str, |
const char * | p | ||
) |
BLI_str_find_prev_char_utf8: : pointer to the beginning of a UTF-8 encoded string : pointer to some position within
Given a position with
a UTF-8 encoded string , find the start of the previous UTF-8 character starting before . Returns NULL if no UTF-8 characters are present in before
.
does
not have to be at the beginning of a UTF-8 character. No check is made to see if the character found is actually valid other than it starts with an appropriate byte.
Return value: a pointer to the found character or NULL.
Definition at line 503 of file string_utf8.c.
Referenced by ui_textedit_step_prev_utf8().
char* BLI_str_prev_char_utf8 | ( | const char * | p | ) |
BLI_str_prev_char_utf8: : a pointer to a position within a UTF-8 encoded string
Finds the previous UTF-8 character in the string before .
does
not have to be at the beginning of a UTF-8 character. No check is made to see if the character found is actually valid other than it starts with an appropriate byte. If might
be the first character of the string, you must use g_utf8_find_prev_char() instead.
Return value: a pointer to the found character.
Definition at line 559 of file string_utf8.c.
References p.
Referenced by draw_brackets(), txt_backspace_char(), txt_jump_left(), txt_move_left(), and txt_wrap_move_eol().
unsigned int BLI_str_utf8_as_unicode | ( | const char * | p | ) |
BLI_str_utf8_as_unicode: : a pointer to Unicode character encoded as UTF-8
Converts a sequence of bytes encoded as UTF-8 to a Unicode character. If does
not point to a valid UTF-8 encoded character, results are undefined. If you are not sure that the bytes are complete valid Unicode characters, you should use g_utf8_get_char_validated() instead.
Return value: the resulting character
Definition at line 358 of file string_utf8.c.
References BLI_UTF8_ERR, i, len(), UTF8_COMPUTE, and UTF8_GET.
Referenced by txt_jump_left(), txt_jump_right(), txt_redo_read_unicode(), and txt_undo_read_unicode().
unsigned int BLI_str_utf8_as_unicode_and_size | ( | const char * | p, |
size_t * | index | ||
) |
Definition at line 373 of file string_utf8.c.
References BLI_UTF8_ERR, i, len(), UTF8_COMPUTE, and UTF8_GET.
Referenced by BLI_strncpy_wchar_from_utf8(), txt_backspace_char(), txt_delete_char(), and txt_replace_char().
unsigned int BLI_str_utf8_as_unicode_step | ( | const char * | p, |
size_t * | index | ||
) |
Definition at line 389 of file string_utf8.c.
References BLI_str_find_next_char_utf8(), BLI_UTF8_ERR, i, len(), NULL, p, UTF8_COMPUTE, and UTF8_GET.
Referenced by text_insert_exec(), and txt_insert_buf().
size_t BLI_str_utf8_from_unicode | ( | unsigned int | c, |
char * | outbuf | ||
) |
BLI_str_utf8_from_unicode: : a Unicode character code : output buffer, must have at least 6 bytes of space. If NULL, the length will be computed and returned and nothing will be written to .
Converts a single character to UTF-8.
Return value: number of bytes written
Definition at line 444 of file string_utf8.c.
Referenced by BLI_strncpy_wchar_as_utf8(), BLI_wstrlen_utf8(), text_insert_invoke(), txt_add_char_intern(), txt_extended_ascii_as_utf8(), txt_print_undo(), txt_replace_char(), and txt_undo_add_charop().
int BLI_str_utf8_size | ( | const char * | p | ) |
Definition at line 333 of file string_utf8.c.
References len(), and UTF8_COMPUTE.
Referenced by draw_brackets(), flatten_index_to_offset(), flatten_len(), flatten_string(), text_cursor_set_to_pos_wrapped(), text_draw(), text_draw_wrapped(), text_font_draw_character_utf8(), text_get_char_pos(), text_get_cursor_rel(), text_get_visible_lines(), text_insert_invoke(), txt_format_line(), txt_move_right(), txt_utf8_get_nth(), txt_utf8_index_to_offset(), txt_utf8_len(), txt_utf8_offset_to_index(), txt_wrap_move_bol(), txt_wrap_move_eol(), ui_do_but_textedit(), ui_textedit_type_ascii(), wm_event_add_ghostevent(), WM_event_print(), wrap_offset(), and wrap_offset_in_line().
size_t BLI_strlen_utf8 | ( | const char * | strc | ) |
Definition at line 235 of file string_utf8.c.
References len().
Referenced by BKE_text_to_curve(), and insert_text_exec().
char* BLI_strncat_utf8 | ( | char * | dst, |
const char * | src, | ||
size_t | maxncpy | ||
) |
Definition at line 193 of file string_utf8.c.
References BLI_STR_UTF8_CPY.
Referenced by BLI_uniquename_cb().
char* BLI_strncpy_utf8 | ( | char * | dst, |
const char * | src, | ||
size_t | maxncpy | ||
) |
Definition at line 183 of file string_utf8.c.
References BLI_STR_UTF8_CPY.
Referenced by set_engine(), ui_but_anim_expression_create(), ui_but_anim_expression_set(), ui_but_copy_paste(), and ui_set_but_string().
size_t BLI_strncpy_wchar_as_utf8 | ( | char * | dst, |
const wchar_t * | src, | ||
const size_t | maxcpy | ||
) |
Definition at line 210 of file string_utf8.c.
References BLI_str_utf8_from_unicode(), and len().
Referenced by insert_text_invoke(), and update_string().
size_t BLI_strncpy_wchar_from_utf8 | ( | wchar_t * | dst, |
const char * | src, | ||
const size_t | maxcpy | ||
) |
Definition at line 258 of file string_utf8.c.
References BLI_str_find_next_char_utf8(), BLI_str_utf8_as_unicode_and_size(), BLI_UTF8_ERR, len(), NULL, and step().
Referenced by BKE_text_to_curve(), BPY_python_start(), insert_text_exec(), insert_text_invoke(), make_editText(), paste_file(), and PyC_SetHomePath().
int BLI_utf8_invalid_byte | ( | const char * | str, |
int | length | ||
) |
Definition at line 59 of file string_utf8.c.
References p, str, and trailingBytesForUTF8.
Referenced by BLI_utf8_invalid_strip(), and txt_extended_ascii_as_utf8().
int BLI_utf8_invalid_strip | ( | char * | str, |
int | length | ||
) |
Definition at line 125 of file string_utf8.c.
References BLI_utf8_invalid_byte().
Referenced by new_id(), and ui_textedit_end().
size_t BLI_wstrlen_utf8 | ( | const wchar_t * | src | ) |
Definition at line 223 of file string_utf8.c.
References BLI_str_utf8_from_unicode(), len(), and NULL.
Referenced by update_string().