+ Start a Discussion
Reza Sarwari 7Reza Sarwari 7 

Problems with German Characters (Ä, Ö, Ü)

Hello All,

we send an email to salesforce with a content generated from a HTML form. The form includes content what website visitors can type in fields like "Firstname" "Lastname" etc.

A Salesforce Email Service (with an apex class) reads the content and saves it in the salesforce database. (Below is the code) 

The problem is that characters like "ä" are stored in salesforce like "�".

I tried already this before saving the content in the database: EncodingUtil.urlEncode(sBody, 'utf-8');

But it still dont work.

Many thanks in advance for your help!


global class EmailServiceKontact implements Messaging.InboundEmailHandler {
    // public static String emailFormat; 
    global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
        Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
        String emailSender = email.replyTo;
        String emailSub = email.subject;  
        // <Contact Start>
        String emailBody = email.htmlBody;

Blake TanonBlake Tanon
Try ISO-8859-1 instead of utf-8
Blake TanonBlake Tanon
Also, I think you want to use EncodingUtil.urlDecode