summaryrefslogtreecommitdiff
path: root/src/core/wee-utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/wee-utf8.c')
-rw-r--r--src/core/wee-utf8.c42
1 files changed, 1 insertions, 41 deletions
diff --git a/src/core/wee-utf8.c b/src/core/wee-utf8.c
index 085e6e6dc..9e52dd6b3 100644
--- a/src/core/wee-utf8.c
+++ b/src/core/wee-utf8.c
@@ -226,7 +226,7 @@ utf8_next_char (char *string)
}
/*
- * utf8_char_size: return UTF-8 char size
+ * utf8_char_size: return UTF-8 char size (in bytes)
*/
int
@@ -455,43 +455,3 @@ utf8_pos (char *string, int real_pos)
}
return count;
}
-
-/*
- * utf8_get_wide_char: get wide char from string (first char)
- */
-
-wint_t
-utf8_get_wide_char (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;
-}