java - Javamail ISO-8859-1 formatting -


i made e- mail client android phone javamail api. if try sender's mail address , recipients mail address following methods:

address[] froma = m.getfrom();         string = internetaddress.tostring(froma);          address[] toa = m.getrecipients(message.recipienttype.to);         string = internetaddress.tostring(toa); 

i string back:

"georg =?iso-8859-1?q?sp=e4the?= , has georg späthe or georg spaethe.

i think problem german mails encoding. can me solve problem?

mime headers encoded per rfc 2047, therefore need decode them first.

string decoded = mimeutility.decodetext("georg =?iso-8859-1?q?sp=e4the?="); 

jdk import:

import javax.mail.internet.mimeutility; 

for android:

import com.android.email.mail.internet; 

see javadoc of mimeutility


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -