From bc836c1a57a408431071cf4242158c3ff1c0fd10 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 20 Sep 2014 12:38:17 +0200 Subject: add verify_utf8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/info/mds.texinfo | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'doc/info') diff --git a/doc/info/mds.texinfo b/doc/info/mds.texinfo index e191a73..6648760 100644 --- a/doc/info/mds.texinfo +++ b/doc/info/mds.texinfo @@ -3990,6 +3990,18 @@ Wrapper around @code{waitpid} that never returns on an interruption unless it is interrupted one hundred times within the same clock second. The parameters and return value are exactly those of @code{waitpid}. + +@item @code{verify_utf8}[(@code{const char* string, int allow_modified_nul}) @arrow{} @code{int}] +Checks whether a NUL-terminated string's encoding +matches UTF-8. This function will reject the string +if it does not use the shorted possible +byte-combination for each character. However, if +@code{allow_modified_nul} is set, it will allow +@code{192 128} in place of @code{0} for a +NUL-character.@footnote{Remember @code{0} is used +to terminated the string, but @code{192 128} is not.} +This function returns zero if the @code{string} is +properly formatted, and @code{-1} otherwise. @end table -- cgit v1.2.3-70-g09d2