static const char hexChars[] = "0123456789ABCDEF";
static const char hexChars[] = "0123456789ABCDEFabcdef";
nsURLUnescape(char* str, char **result){    if (!str) {        *result = nsnull;        return NS_OK;    }    register char *src = str;    static const char hexChars[] = "0123456789ABCDEF";    int len = PL_strlen(str);    *result = (char *)nsMemory::Alloc(len + 1);    if (!*result)        return NS_ERROR_OUT_OF_MEMORY;    register unsigned char* dst = (unsigned char *) *result;    char c1[] = " ";    char c2[] = " ";    char* const pc1 = c1;    char* const pc2 = c2;    while (*src) {        c1[0] = *(src+1);        if (*(src+1) == '\0')             c2[0] = '\0';        else            c2[0] = *(src+2);        /* check for valid escaped sequence */        if (*src != HEX_ESCAPE || PL_strpbrk(pc1, hexChars) == 0 ||                                   PL_strpbrk(pc2, hexChars) == 0 )            *dst++ = *src++;        else 			{            src++; /* walk over escape */            if (*src)            {                *dst = UNHEX(*src) << 4;                src++;            }            if (*src)            {                *dst = (*dst + UNHEX(*src));                src++;            }            dst++;        }    }    *dst = '\0';    return NS_OK;}