Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

...
  • 1 commit
  • 1 file changed
  • 1 commit comment
  • 1 contributor
Commits on Apr 09, 2012
Simon Chopin laarmen Transcode the HTML text to native encoding before writing the tmp file
This way, any HTML interpreter should read the file using the default
locale and while get the non-ASCII characters right.
72f6d0d
Showing with 2 additions and 1 deletion.
  1. +2 −1  alot/db/utils.py
3  alot/db/utils.py
View
@@ -9,6 +9,7 @@
from email.iterators import typed_subpart_iterator
import logging
import mailcap
+import locale
import alot.helper as helper
from alot.settings import settings
@@ -94,7 +95,7 @@ def extract_body(mail, types=None):
prefix=template_prefix,
suffix=template_suffix)
# write payload to tmpfile
- tmpfile.write(raw_payload)
+ tmpfile.write(unicode(raw_payload, enc).encode(locale.getdefaultlocale()[1]))
tmpfile.close()
# read parameter, create handler command

Showing you all comments on commits in this comparison.

Patrick Totzke
Owner

hi!

i think this has been discussed before here: pazz#134 (search for html in the tracker).
The consensus was to not alter the msg content at all and only provide hints for the renderer (w3m most likely)
how to interpret the content:
alot will decode the quoted printable and hand over the 'charset' content-type parameter (via mailcap parameter sequences).
The renderer then interprets the given string as having this input encoding and is expected to output utf8 encoded strings.

this should work as is, i am reluctant to recode anything in between. please let me know what exactly your problem is with the
html renderer set as mentioned in the doc.
thank you,
/p

Something went wrong with that request. Please try again.