Auto-generated mail messages unreadable (Character set problem)

Auto-generated mail messages unreadable (Character set problem)

Paul Shew-mit -
Antal besvarelser: 4
I'm using Moodle in Japanese, with character encoding as "euc-jp" -- the encoding for the Japanese lang files. But the mail messages sent out by the server are garbled. I discovered that if I manually change the character encoding on each message to Japanese-EUC, I can read them. I'm using MS Outlook Express and MS Entourage (for Mac).

I checked the source code of the messages, and noticed that the character set is being defined within each multipart header, but not the main header. MS Entourage recognizes the characterset when it's set in the main header, but not when it's set later in multipart headers.

SO, how can I get the server to include the characterset as a part of the main header of the mail messages?
Gennemsnitsbedømmelse: -
I svar til Paul Shew

Good News, Bad News

Paul Shew-mit -
Well, I spent this morning figuring out how to add the charset to the header. The good news is, I succeeded. smiler

I changed lines 989 of php.mailer.php to this:
 
$header[] = sprintf("\tboundary="%s";%s", $this->boundary[1], $this->LE);
$header[] = sprintf("\tcharset="%s"%s", $this->CharSet, $this->LE);

Now the primary header of the mail messages look like this:
Content-Type: multipart/alternative;
boundary="b1_e607a92c290050b525412bd5399cc034";
charset="euc-jp"

The bad news is that this didn't help. trist

I then doubled checked to see what happens when it's sent out as plain-text instead of HTML mail -- same thing. The charset is not recognized by MS Entourage, so it's unreadable. A quick check in Mozilla's mail reader showed no problems, so maybe this is a Microsoft problem. But even if it is, being MS compatible is a necessity.


I've got to do something because I can't expect my students to have to change the character encoding on every message Moodle sends out. But I'm at a loss as to what to do...

Any ideas?
I svar til Paul Shew

Re: Good News, Bad News

Paul Shew-mit -
After more testing and research, I've determined that the problem is with Microsoft's software. The mail headers are formed correctly (from the beginning), but Microsoft Entourage doesn't recognize them. Apparently MS software on Windows works correctly (tested in Win98 and WinXP), so most of my students shouldn't have problems.