You are here: Foswiki>Tasks Web>Item13921 (12 Jul 2022, MichaelDaum)Edit Attach

Item13921: Mailnotify emails sent in wrong encoding

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: mailnotify
Branches:
Reported By: AndreLichtsteiner
Waiting For:
Last Change By: MichaelDaum
Foswiki 2.x is now operating in utf-8. It works fairly fine with an iso-8859-1 Store.

But when email for webnotify get generated, the data remains in store encoding and the email therefore has to be encoded in this encoding respectively.

We had hard code the encoding in /templates/mailnotify.tmpl to match $Foswiki::cfg{Store}{Encoding}, as %CHARSET% is now fixed to utf-8.

-- AndreLichtsteiner - 13 Jan 2016

I'm don't know how this can happen. Foswiki 2.0 core is always Unicode, The store converts from {Store}{Encoding} at the edge, and should always return Unicode characters and not uft-8 bytes. And MailerContrib uses Foswiki::Func and Foswiki::Meta for all I/O that I could find, so it should working with Unicode as well. The conversion back to utf-8 is done in Foswiki::Net. If you are using Sendmail, it writes using utf-8 encoding to the file handle, and if you are using Net::SMTP, it uses Email::MIME which should take care of the encoding.

-- GeorgeClark - 13 Jan 2016

We were suprised too, but the emails, sent via Net::SMTP, clearly contained iso encoding.

-- Main.AndreLichtsteiner - 14 Jan 2016 - 16:38

Any chance you could test this on the Foswiki 2.1 beta? I hope that VadimBelman might have fixed this issue on task Item13699. If that didn't fix it, then we need to investigate it further. Note that this fix introduces another dependency. CPAN:Email::MIME.

-- GeorgeClark - 14 Jan 2016

Possibly you have a situation I didn't reproduce, but it looks like the latest master or 2.1beta do fix the problem. I have set the storage encoding to iso8859-1 and played with a sandbox topic by adding/removing text and links using characters from and out of the charset – like å߃ or event cyrillic. The final emails had all these included the way they're stored in the file; i.e. those which are not valid iso8859-1 symbols are converted to #xNNN; representation.

-- VadimBelman - 15 Jan 2016

Didn't see wrong encodings in mails anymore

-- MichaelDaum - 12 Jul 2022
 

ItemTemplate edit

Summary Mailnotify emails sent in wrong encoding
ReportedBy AndreLichtsteiner
Codebase 2.0.3
SVN Range
AppliesTo Engine
Component mailnotify
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r8 - 12 Jul 2022, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy