6 /* go from url with escaped utf to utf */
8 hurlunesc(HConnect *cc, char *s)
15 u = halloc(cc, strlen(s)+1);
16 for(t = u; c = *s; s++){
19 if(n >= '0' && n <= '9')
21 else if(n >= 'A' && n <= 'F')
23 else if(n >= 'a' && n <= 'f')
29 if(n >= '0' && n <= '9')
31 else if(n >= 'A' && n <= 'F')
33 else if(n >= 'a' && n <= 'f')
44 /* convert to valid utf */
45 v = halloc(cc, UTFmax*strlen(u) + 1);
49 /* in decoding error, assume latin1 */
50 if((n=chartorune(&r, s)) == 1 && r == Runeerror)
53 t += runetochar(t, &r);