#include <Defn.h>
#include <ctype.h> /* for isspace */
#include <pcre.h>
#undef COMPILING_R
Rboolean utf8Valid(const char *str)
{
return (_pcre_valid_utf8(str, strlen(str)) < 0);
return (_pcre_valid_utf8(str, strlen(str))==PCRE_UTF8_ERR0);
}