NS_COM PRBool NS_UnescapeURL(const char *str, PRInt32 len, PRInt16 flags, nsACString &result)
NS_COM PRBool NS_UnescapeURL(const char *str, PRInt32 len, PRUint32 flags, nsACString &result)
NS_COM PRBool NS_UnescapeURL(const char *str, PRInt32 len, PRInt16 flags, nsACString &result){    if (!str) {        NS_NOTREACHED("null pointer");        return PR_FALSE;    }    if (len < 0)        len = strlen(str);    PRBool ignoreNonAscii = (flags & esc_OnlyASCII);    PRBool ignoreAscii = (flags & esc_OnlyNonASCII);    PRBool writing = (flags & esc_AlwaysCopy);    PRBool skipControl = (flags & esc_SkipControl);     static const char hexChars[] = "0123456789ABCDEFabcdef";    const char *last = str;    const char *p = str;    for (int i=0; i<len; ++i, ++p) {        //printf("%c [i=%d of len=%d]\n", *p, i, len);        if (*p == HEX_ESCAPE && i < len-2) {            unsigned char *p1 = ((unsigned char *) p) + 1;            unsigned char *p2 = ((unsigned char *) p) + 2;            if (ISHEX(*p1) && ISHEX(*p2) &&                 ((*p1 < '8' && !ignoreAscii) || (*p1 >= '8' && !ignoreNonAscii)) &&                !(skipControl &&                   (*p1 < '2' || (*p1 == '7' && (*p2 == 'f' || *p2 == 'F'))))) {                //printf("- p1=%c p2=%c\n", *p1, *p2);                writing = PR_TRUE;                if (p > last) {                    //printf("- p=%p, last=%p\n", p, last);                    result.Append(last, p - last);                    last = p;                }                char u = (UNHEX(*p1) << 4) + UNHEX(*p2);                //printf("- u=%c\n", u);                result.Append(u);                i += 2;                p += 2;                last += 3;            }        }    }    if (writing && last < str + len)        result.Append(last, str + len - last);    return writing;}