One Star

convert UTF_8 String to Ascii

Hallo,
I have received an e-mail with TPOP. Within this e-Mail the subject line looks as follows:
Subject: =?UTF-8?B?VGVzdG1haWwgdm9uIFN1bm55IFdlYkJveCBQVi1BbmxhZ2UgVW50aWVkdCBIZXJyc2NoaW5n?=
how can I decode this String to show readable Text?
Any help very welcome.
1 REPLY
Employee

Re: convert UTF_8 String to Ascii

Hi:
the content between the third and the last question mark is base64 encoding.
http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/
convert result: "Testmail von Sunny WebBox PV-Anlage Untiedt Herrsching"
or you can try the followed example java code to decode it by yourself:
String s = "VGVzdG1haWwgdm9uIFN1bm55IFdlYkJveCBQVi1BbmxhZ2UgVW50aWVkdCBIZXJyc2NoaW5n";
try {
System.out.println(new String(new sun.misc.BASE64Decoder().decodeBuffer(s)));
} catch (IOException e) {
e.printStackTrace();
}