diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2007-05-02 09:19:35 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2007-05-02 09:19:35 +0000 |
commit | c74cf01b632efe94e5a4d5b7b1c2cbcaa251849e (patch) | |
tree | 2beb25dc80b33a68bd825868d83d510c1e83ebde /src/common/utf8.c | |
parent | eb2e8891cb72ac0ffd2f2f523295dedd899c2724 (diff) | |
download | weechat-c74cf01b632efe94e5a4d5b7b1c2cbcaa251849e.zip |
Fixed bug with iso2022jp locale (bug #18719)
Diffstat (limited to 'src/common/utf8.c')
-rw-r--r-- | src/common/utf8.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/common/utf8.c b/src/common/utf8.c index 89744d6bd..33d96ec17 100644 --- a/src/common/utf8.c +++ b/src/common/utf8.c @@ -56,6 +56,22 @@ utf8_init () } /* + * utf8_has_8bits: return 1 if string has 8-bits chars, 0 if only 7-bits chars + */ + +int +utf8_has_8bits (char *string) +{ + while (string && string[0]) + { + if (string[0] & 0x80) + return 1; + string++; + } + return 0; +} + +/* * utf8_is_valid: return 1 if UTF-8 string is valid, 0 otherwise * if error is not NULL, it's set with first non valid UTF-8 * char in string, if any |