Encoding - quoted-printable & charset utf-16 how to read
hi,
I have this following Multipart request comes from a system. Our application has to receive this part and process.
=_Part_26425_3101246.1109752031682
Content-Type: text/plain; name=Mojo.txt; charset=utf-16
Content-Transfer-Encoding: quoted-printable
Content-Location: Mojo.txt
=FE=FF=00M=00o=00j=00o
=_Part_襧%B梧
I could able to receive and save the file locally. As it mentioned, it is encoded using "quoted-printable", so I decoded using the following method.
MimeUtility.decode(fInputStream, "quoted-printable");
and can able to decode the file. Once the decode process is done, I need to read the value of the text file. I understand from the headers(charset=utf-16), I assume it is a UTF-16 file, so i reading the text using the following code but getting some extra ? characters in front of the actual text.
BufferedReader bufferedReader =new BufferedReader(new InputStreamReader(fis,"utf-16"));
String nextLine;
while((nextLine = bufferedReader.readLine()) !=null)
{
System.out.println(nextLine);
}
How to read this correctly?.
rgds
-VK Bala Murali-

