Summary: | Send Cart via Email corrupts some Unicode characters | ||
---|---|---|---|
Product: | Koha | Reporter: | Pongtawat <pongtawat> |
Component: | OPAC | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P3 | CC: | f.demians, f.kolovos, jonathan.druart |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Thai character that has problem
Screenshot of Sent Cart page, showing how the comment should read Screenshot of email received Screenshot of cart email form Screenshot of cart email received Screenshot of list email form Screenshot of list email received Patch for correcting the cart email encoding Patch for correcting the list email encoding |
Description
Pongtawat
2014-11-13 11:25:42 UTC
> - Enter your email address and enter "ออ" as the comment. > - View your email, you will get something like "�¸ �" as comment. > > This is a known bug from HTML-Format used by html2text TT filter which was > used to format email message: > > https://rt.cpan.org/Public/Bug/Display.html?id=9700 It works on master with French accented characters. Could your provide the culprit characters in an attached text file, and in a screenshot? > We may also fix this problem on Koha side as well by not using html2text and > turn the template into plain text (or turn the email into HTML). It's not an option. The template is in HTML in order to be translatable: see bug 8062. Created attachment 33605 [details]
Thai character that has problem
Created attachment 33606 [details]
Screenshot of Sent Cart page, showing how the comment should read
Created attachment 33607 [details]
Screenshot of email received
Screenshot of email received, notice the broken letter. Some browser will just remove this character, while some other will switch to non-UTF8 encoding (which is worse)
Thank you for make it clear why we need HTML there. I have attached an example and screenshots. The letter we have problem with is Thai character "อ" which is encoded in UTF8 as E0 B8 AD. The following code in HTML-Format will simply remove A0 and AD: $text =~ tr/\xA0\xAD/ /d; Hence the comment in the received email source in the example above is as follow: -------------------------------------------------------------------- =E0=B8=E0=B8=B2 - =E0=B9=80=E0=B8 - =E0=B9=82=E0=B8 - =E0=B8=E0=B8 -------------------------------------------------------------------- while the correct one should be: -------------------------------------------------------------------- =E0=B8=AD=E0=B8=B2 - =E0=B9=80=E0=B8=AD - =E0=B9=82=E0=B8=AD - =E0=B8=AD=E0=B8=AD -------------------------------------------------------------------- In my installation, I have switched Send Cart to HTML email, avoiding html2text, since HTML emails should be the norm now. IMO, it would be great if send cart could use easily-to-change template just like notice and slip. Is this bug still valid? I appears to be working correctly in master, but I'm not entirely sure I'm testing correctly. (In reply to Owen Leonard from comment #6) > Is this bug still valid? I appears to be working correctly in master, but > I'm not entirely sure I'm testing correctly. Yes I guess it is still an issue as we use HTML-Format 2.11. I'd opt to close this bug as it's not a bug from Koha. Goodmorning to all, There is also another problem concerning the cart (and lists) when they are sent via email nad contain Greek characters at the subject and at the name of the sender. The subject and the sender's name arrive unintelligible to the end user, but only the greek characters. However, the message's content arrives correctly. Steps to Reproduce for the cart: - Go to the OPAC environment and login (preferably the full name of the logged in user should contain non-english characters as well) - Change to greek language, or a language that will contain unicode characters at the subject line - Add some items to your cart - View your cart - Click "Send" - Enter the email address of the recipient and a comment (the comment is optional) - Click "Send" Steps to reproduce for the List: - Go to the OPAC environment and login (preferably the full name of the logged in user should contain non-english characters as well) - Change to greek language, or a language that will contain unicode characters at the subject line - Select a list from your lists, or create one giving it a name with non-english characters - Click "Send" - Enter the email address of the recipient and a comment (the comment is optional) - Click "Send" The subjects of the emails received for each cart / lists are unintelligible. The are supposed to read "Your Cart" and "Your List: name of list" in Greek. Also, the sender's name, if it is Greek, or I suppose non-english, it is also unintelligible. I attach: - Four screenshots concerning the send form for each case and the email received for each case. - Two proposed patches, one for each case (opac-sendbasket.pl and opac-sendshelf.pl). It seems that the subject and sender's encoding has to be in MIME-Q and not in UTF-8, as they have to be quoted-printable "encoded". Created attachment 56836 [details]
Screenshot of cart email form
Created attachment 56837 [details]
Screenshot of cart email received
In here you can see that the subject and the sender's name are unintelligible. This happens to any mailer I have tried.
Created attachment 56838 [details]
Screenshot of list email form
This is a test list, with a greek name that is ready to be sent via the form in opac
Created attachment 56839 [details]
Screenshot of list email received
This is the email received for the list sent, with the subject line unintelligible as well.
Created attachment 56840 [details] [review] Patch for correcting the cart email encoding This proposed patch corrects the encoding of the user's name and the subject of the email. Created attachment 56841 [details] [review] Patch for correcting the list email encoding This proposed patch corrects the encoding of the email's subject. Hi Filippos, Thanks for you patch but have a look at our wiki page (https://wiki.koha-community.org/wiki/Submitting_A_Patch) to know how format it correctly. When it's done you can change the status of this bug report to "Needs Signoff". Dear Jonathan goodafternoon! Thank you for your comment! I am a first-timer and I apologize if I do some miss-steps. Only one question, how will I be able to change the published comments and/or patches, since it does not let me edit my comments and patches? Thank again you very much for your help! (In reply to Filippos Kolovos from comment #16) > Only one question, how will I be able to change the published comments > and/or patches, since it does not let me edit my comments and patches? You cannot, just attach the new patches and obsolete the old ones (details > edit details > tick "obsolete" > submit) (In reply to Owen Leonard from comment #6) I just revisit this bug and my original problem was already gone (tested with 16.11). This is probably due to unicode clean up sometimes ago. However, I leave this bug open since Filippos add another problem with send cart here. *** Bug 18845 has been marked as a duplicate of this bug. *** We've also had reports about this problem in 16.11 and 3.22 - Filippos, will you be able to work on this again? (In reply to Pongtawat from comment #18) > However, I leave this bug open since Filippos add another problem with send > cart here. I don't know what problem this refers to. If anyone knows, please open a new bug for it. |