There are data :
batiment:Kube D
etage:4ème
description:some_description
I want to get these data through InputStreamReader stuff :
SharedByteArrayInputStream sbais = (SharedByteArrayInputStream) content;
Reader reader = new InputStreamReader(sbais, Charset.forName("UTF8"));
int size = sbais.available();
char[] theChars = new char[size];
int data = reader.read();
int i = 0;
while (data != -1) {
theChars[i] = (char) data;
i++;
data = reader.read();
}
String parse = new String(theChars);
String[] parties = parse.split("Content-Transfer-Encoding: quoted-printable");
String partie = (parties[1]).trim();
parties = partie.split("\\R");
String ret = "";
for(String ligne : parties) {
if (ligne == null || ligne.trim().equals(""))
break;
ret = ret.concat(ligne).concat(System.lineSeparator());
}
return ret;
At runtime the data 4ème
is transformed to 4=E8me
So what is wrong ?
edit :
here is the headers of the content :
--_008_DB6P190MB0166B6F4DE5E31397B4A7B558C3C9DB6P190MB0166EURP_
Content-Type: multipart/alternative;
boundary="_000_DB6P190MB0166B6F4DE5E31397B4A7B558C3C9DB6P190MB0166EURP_"
--_000_DB6P190MB0166B6F4DE5E31397B4A7B558C3C9DB6P190MB0166EURP_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
batiment:KUBE D
etage:4=E8me
description:andrana
Cordialement,
...