This topic is locked

EmailReader-Template - special character

1/31/2014 6:22:59 AM
PHPRunner General questions
T
taumic author

If I pick up emails with the EmailReader-Template (getmail.php) and the emails contain german special character (Umlaute: ÖÄÜß öäü), they will be displayed incorrectly.

In Miscellaneous/OutputCodePage I have tried UTF-8, WesternEurope(ISO) and WesternEurope(Windows) - without success.
What can I do to display the special character korrect?
Thanks in advance
Michael

Sergey Kornilov admin 1/31/2014

Just in case make sure that you use the latest version of EmailReader template. You can see it working at http://xlinesoft.com/livedemo/emailreader/mail_messages_list.php

Send a test email to test@xlinesoft.com to see if encoding is correct.
If this doesn't help contact support team directly and we'll figure out the way to troubleshoot it.

A
Anapolis 2/20/2014

[size="4"]Here's a test you can try just to see if it makes a difference.
You may have to use Html encoding to replace the umlauts.
As in this example:
Ä Ä
ä ä
Ö Ö
ö ö
Ü Ü
ü ü
ß ß
This is never a completely solved issue.
For instance, how it turns out depends on the email reader, too.
Outlook Express, Gmail, Yahoo .... all may help you or mess the final message up.
However, if you are sending HTML enabled email and that is the preference of the User's Email settings and the Email provider agrees to respect UTF8 and all that jazz then you may achieve the German characters as you intended.
So, if you are sending an email with the word Möbelträgerfüße
then in your Email PHPRunner script it would be MÖbelträgerfüße
I haven't checked out the email scripting but I know that it can also be modified to take each umlaut character and dynamically replace those with the html friendly string.
I have seen this method used successfully for the BODY of an html email but in some cases the Header field of the same email might render the characters in a different "ugly" manner.
And I have seen enough cases where the exact same email looks fine in Gmail but makes ugly characters in Yahoo.

[/size]

T
taumic author 2/21/2014

Hello everybody, hello Maverick,
I have tested as Maverick has proposed.

The result you can see on the screenshot:

  • In BODY-field the german Umlaute are wrong,


  • but in the SUBJECT-field everything is displayed correctly
    So the problem in the GETMAIL.PHP file should be in the region of the body-handling.

    Because I am not well versed, I've already tried a lot - but unfortunately received no satisfactory result.

    Is there no one from Northern Europe or from a spanish-speaking country with the same problems - or am I the only one who uses the good in itself template?
    Thanks for all feedback!
    Michael

A
Anapolis 3/1/2014



Hello everybody, hello Maverick,
I have tested as Maverick has proposed.

The result you can see on the screenshot:

  • In BODY-field the german Umlaute are wrong,

  • but in the SUBJECT-field everything is displayed correctly
    So the problem in the GETMAIL.PHP file should be in the region of the body-handling.

    Because I am not well versed, I've already tried a lot - but unfortunately received no satisfactory result.

    Is there no one from Northern Europe or from a spanish-speaking country with the same problems - or am I the only one who uses the good in itself template?
    Thanks for all feedback!
    Michael


In a PHPRunner 7.1 application my problem with the html (browser) display of German umlauts was solved by this utf8_encode( )
so the data has to be processed differently in the body of an html email than it is processed in the body...
without seeing the email script you are working with I can not say which method goes where.... but maybe my example of a problem solved dealing with umlauts

might give you some further ideas.
A city such as München even though it was stored in the database in utf8_general_ci unicode universal non case sensitive when pulled out of the following PHPRunner code would be rendered as M�nchen when displayed in the body of a PHPRunner Form ... the same for all umlauts in a PHPRunner form.
So I had to wrap that data field with-- utf8_encode($data["ort"])
I had thought it should be utf8_decode since the field was already in utf8. But it apparently is changed when it is pulled by php from the mysql database.
It depends at what part of the process this code wrap function will work properly.

$data = $pageObject->getCurrentRecord();
global $conn;

$strSQLExists = "select * from alesapo where kdnr=" .$data["kdnr"]."" ;

$rsExists = db_query($strSQLExists,$conn);

$data=db_fetch_array($rsExists);

if($data)

{

$message= "Inhaber: " .$data["inhaber"]."
". $data["strasse"] . "
" . $data["kunde"]."
" .$data["plz"]."
" .utf8_encode($data["ort"]) ;
}

$_SESSION["myspecialmessage"]=$message;


this can also be done at the final concatenated $message
like this



$_SESSION["myspecialmessage"]= utf8_encode($message );


but first remove the function wrap from an individual string value like the utf8_encode($data["ort"])

so that it is just-- $data["ort"]
then the utf8 encoding only happens in one place as I point out here again..



$_SESSION["myspecialmessage"]= utf8_encode($message);


When I put the results into a PHP Code snippet in an Edit Page of a Form with this

echo $_SESSION["myspecialmessage"];


it will produce all umlauts correctly such as -- Herr Dr. Thomas Döring, München