Pour convertir les caractères « sépciaux d’une URL en caractères (exemple { = %7B = Ascii(123)) :
#define ARRAYSIZE 29
String cCarSpec[ARRAYSIZE] = {"%20", "%22", "%27", "%23", "%25", "%26",
"%28", "%29", "%2B", "%2C", "%2E", "%2F",
"%3A", "%3B", "%3C", "%3D", "%3E", "%3F",
"%40", "%5B", "%5C", "%5D", "%5E", "%60",
"%7B", "%7C", "%7D", "%7E", "%21"
};
int nConv[ARRAYSIZE] = {32, 34, 39, 35, 37, 38,
40, 41, 43, 44, 46, 47,
58, 59, 60, 61, 62, 63,
64, 91, 92, 93, 94, 96,
123, 124, 125, 126, 33
};
String transCar(String sChaine)
{
for (int i = 0; i < ARRAYSIZE; i++)
{ char cCar = nConv[i];
String sCar = String(cCar);
sChaine.replace(cCarSpec[i], sCar);
}
return sChaine;
}
La conversion étant effectuée par exemple : new_ssid = transCar(new_ssid);