diff options
Diffstat (limited to 'src/core/wee-string.c')
-rw-r--r-- | src/core/wee-string.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/src/core/wee-string.c b/src/core/wee-string.c index 2bf09bc3a..9a438f456 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -550,53 +550,13 @@ string_convert_hex_chars (const char *string) } /* - * string_get_wide_char: get wide char from string (first char) - */ - -wint_t -string_get_wide_char (const char *string) -{ - int char_size; - wint_t result; - - if (!string || !string[0]) - return WEOF; - - char_size = utf8_char_size (string); - switch (char_size) - { - case 1: - result = (wint_t)string[0]; - break; - case 2: - result = ((wint_t)((unsigned char)string[0])) << 8 - | ((wint_t)((unsigned char)string[1])); - break; - case 3: - result = ((wint_t)((unsigned char)string[0])) << 16 - | ((wint_t)((unsigned char)string[1])) << 8 - | ((wint_t)((unsigned char)string[2])); - break; - case 4: - result = ((wint_t)((unsigned char)string[0])) << 24 - | ((wint_t)((unsigned char)string[1])) << 16 - | ((wint_t)((unsigned char)string[2])) << 8 - | ((wint_t)((unsigned char)string[3])); - break; - default: - result = WEOF; - } - return result; -} - -/* * string_is_word_char: return 1 if given character is a "word character" */ int string_is_word_char (const char *string) { - wint_t c = string_get_wide_char (string); + wint_t c = utf8_wide_char (string); if (c == WEOF) return 0; |