1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 11:13:12 +02:00

Fixed bug with iso2022jp locale (bug #18719)

This commit is contained in:
Sebastien Helleu
2007-05-02 09:19:35 +00:00
parent eb2e8891cb
commit c74cf01b63
8 changed files with 68 additions and 6 deletions
+16
View File
@@ -55,6 +55,22 @@ utf8_init ()
local_utf8 = (ascii_strcasecmp (local_charset, "UTF-8") == 0);
}
/*
* 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