提交 36a4f4a4 编写于 作者: B Behdad Esfahbod

Replace u_strlen() with u_countChar32()

The latter is what I meant.
上级 055fb24d
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include <unicode/uversion.h> #include <unicode/uversion.h>
#include <unicode/uchar.h> #include <unicode/uchar.h>
#include <unicode/unorm.h> #include <unicode/unorm.h>
#include <unicode/unistr.h> #include <unicode/ustring.h>
...@@ -190,8 +190,7 @@ hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED, ...@@ -190,8 +190,7 @@ hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
len = unorm_normalize (utf16, len, UNORM_NFC, 0, normalized, ARRAY_LENGTH (normalized), &icu_err); len = unorm_normalize (utf16, len, UNORM_NFC, 0, normalized, ARRAY_LENGTH (normalized), &icu_err);
if (icu_err) if (icu_err)
return FALSE; return FALSE;
normalized[len] = 0; if (u_countChar32 (normalized, len) == 1) {
if (u_strlen (normalized) == 1) {
U16_GET_UNSAFE (normalized, 0, *ab); U16_GET_UNSAFE (normalized, 0, *ab);
ret = TRUE; ret = TRUE;
} else { } else {
...@@ -227,8 +226,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, ...@@ -227,8 +226,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
if (icu_err) if (icu_err)
return FALSE; return FALSE;
normalized[len] = 0; len = u_countChar32 (normalized, len);
len = u_strlen (normalized);
if (len == 1) { if (len == 1) {
U16_GET_UNSAFE (normalized, 0, *a); U16_GET_UNSAFE (normalized, 0, *a);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册