end pointer in g_utf8_validate()



Hi,

I notice that the documentation for g_utf8_validate(const gchar *str,
gssize max_len, const gchar **end)) states, about the third (end) argument, 
that:

"If end is non-NULL, then the end of the valid range will be stored there
 (i.e. the start of the first invalid character if some bytes were invalid, or
 the end of the text being validated otherwise)."

The "or the end of the text being validated otherwise" is ambiguous.  It could 
be taken to apply to a case where a string is wholly valid, or where it is 
wholly invalid, or both.

I am writing some code which depends on the value passed to the third (end) 
argument by g_utf8_validate() if a string contains no valid utf8 characters.  
In that case, is my assumption correct that "end" will hold the same value as 
"str"?

In a case where a string is wholly valid, does "end" point to the last 
character or to the terminating null?

Regards,

Chris.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]