[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: HTML mail + PDF attachments (with șurubelniță)



On Fri 27 Mar 2020 at 17:35:19 (+0300), Reco wrote:
> 	Hi.
> 
> On Fri, Mar 27, 2020 at 02:22:18PM +0200, Andrei POPESCU wrote:
> > > or an attachment was named using non-Latin characters.
> > 
> > Is that non-Latin or non-ASCII?
> 
> I'm not that familiar with the languages to qualify Romanian as a Latin
> or a non-Latin language,

I think we can agree that the Romans spoke Latin!

> but your attachment really is:
> 
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: attachment; filename*=utf-8''%C8%99urubelni%C8%9B%C4%83_empty%2Etxt
> 
> So, that's Unicode, at least a part of it, namely - \uc899, \uc89b and
> \uc483 glyphs.
> rfc2047_parameters works on it as intended btw.

Yes, that looks entirely conformant with RFC 2231.

filename	the parameter
*		is encoded
<empty>		no count, as in one chunk
=		assignment
utf-8		charset
'		delimiter
<empty>		language irrelevant
'		delimiter
%C8%99ur…	header text

> > The former would imply about half of the 
> > world's population, the latter something like two thirds or more (just 
> > guessing, didn't check numbers).

It seems that you might be conflating base64 and utf-8.

AIUI headers with structured information (with parameters) are meant
to use the RFC 2231 spec which is designed so that values can be
broken up when long, have their character set specified, and also
their language so that screen readers know how to pronounce the
letters within that character set. Obviously, utf-8 can express all
the written languages of the world, both real and fictitious.

Unstructured fields can use the =?utf-8?B?KHdpdGggyJl1cnViZWxuacibxIMp?=
type of encoding, and this post's subject line actually uses both: the
B method (above) and the Q method, =?utf-8?Q?attachments_?=.

> Even for those cases there's a legitimate need to attach a file which
> name conforms to ASCII. Source code, patches, images with names like
> 20200327143420.jpg etc.

Cheers,
David.
Topped up.

Reply to: