/* Returns a pointer to a newly created string or NULL if any problem  */
xmlChar* xmlUTF8Strsub(const xmlChar *utf, int start, int len)
/* Returns a pointer to a newly created string or NULL if any problem  */
xmlChar* xmlUTF8Strsub(const xmlChar *utf, int start, int len)
{
        if ((ch=*utf++) == 0) return(NULL);
        if ( ch & 0x80 ) {
            if ( (ch & 0xc0) != 0xc0 )
                return(NULL);
            while ( (ch <<= 1) & 0x80 )
                if ( (*utf++ & 0xc0) != 0x80 )
                    return(NULL);
        }
    }
    return(xmlUTF8Strndup(utf, len));
}