[Users] Questions regarding character encoding of text/plain attachments

Ricardo Mones ricardo at mones.org
Tue Oct 2 14:28:25 CEST 2012


On Mon, Oct 01, 2012 at 12:25:23AM +0200, Michael Gmelin wrote:
> Hi,
> 
> I noticed the following issue:
> 
> When sending a text file attachment, claws uses content-type text
> plain, even if it is encoded in UTF-8 and ends up base64-encoded.
> 
> So the mime header of the attachment looks like this:
> 
> Content-Type: text/plain
> Content-Transfer-Encoding: base64
> Content-Disposition: attachment; filename=china.txt
> 
> In some cases it would be preferable to have a header like this:
> 
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: base64
> Content-Disposition: attachment; filename=china.txt

  Maybe it should be set to UTF-8 always for text/plain in the cases where
the current code does not add a charset. ASCII only attachments would work
anyway as that's a subset of UTF-8.
   
> Questions:
> 1. Is there a reasonable way to auto-detect and set the encoding?

  http://code.google.com/p/uchardet/

> 2. If not, is there a way to make this happen on user request (like,
>    selecting the encoding)?

  Not currently, but a patch is welcome :)

> 3. If not, what is the rationale for not doing this. I could imagine
>    something like "the receiving system should assume UTF-8 in the
>    absence of a character encoding specification" or "the receiving
>    system should handle encodings transparently". In this case it would
>    be good to get some reference supporting one or both of these
>    arguments (RFC anyone?)

  My response to your other mail has several RFC references, and UTF-8
is not the default assumption for text/plain without charset. Anyway,
since automatic charset detection is equally flawed on any side, I don't
think such transparent handling is possible. At most all the MUAs can do
would be a) suggest some encoding for sending, and b) allow changing it,
and c) suggest some encoding for reading, and d) allow changing it.

  Claws Mail currently lacks b), and a) probably can be improved.
  AFAIK c) and d) are fully covered.

  regards,
-- 
  Ricardo Mones 
  ~
  Physics is like sex: sure, it may give some practical results, but 
  that's not why we do it.                            Richard Feynman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20121002/256a2299/attachment.sig>


More information about the Users mailing list