diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2015-08-18 07:36:48 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2015-08-18 07:36:48 +0200 |
commit | 46a9d17ac331b1df9fbd33a7c23f87fd58246a2e (patch) | |
tree | 1a4bd97bade2b4977683fa2c07f639ace3f5e5c0 /doc/en/weechat_plugin_api.en.asciidoc | |
parent | fd1886e883968dbf372157644ce5664e75a6ff4b (diff) | |
download | weechat-46a9d17ac331b1df9fbd33a7c23f87fd58246a2e.zip |
api: add argument "length" in function utf8_is_valid()
Diffstat (limited to 'doc/en/weechat_plugin_api.en.asciidoc')
-rw-r--r-- | doc/en/weechat_plugin_api.en.asciidoc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/en/weechat_plugin_api.en.asciidoc b/doc/en/weechat_plugin_api.en.asciidoc index 13fabe3df..2398e45e7 100644 --- a/doc/en/weechat_plugin_api.en.asciidoc +++ b/doc/en/weechat_plugin_api.en.asciidoc @@ -2151,18 +2151,22 @@ This function is not available in scripting API. ==== utf8_is_valid +_Updated in 1.4._ + Check if a string is UTF-8 valid. Prototype: [source,C] ---- -int weechat_utf8_is_valid (const char *string, char **error); +int weechat_utf8_is_valid (const char *string, int length, char **error); ---- Arguments: * 'string': string +* 'length': max number of UTF-8 chars to check; if ≤ 0, the whole string is + checked _(WeeChat ≥ 1.4)_ * 'error': if not NULL, '*error*' is set with pointer to first non valid UTF-8 char in string, if any @@ -2175,7 +2179,7 @@ C example: [source,C] ---- char *error; -if (weechat_utf8_is_valid (string, &error)) +if (weechat_utf8_is_valid (string, -1, &error)) { /* ... */ } |