🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
6 messages
6 total messages Started by Gregg Woodcock Tue, 02 Mar 2004 20:55
Which MIME headers are the same as non-MIME?
#68387
Author: Gregg Woodcock
Date: Tue, 02 Mar 2004 20:55
15 lines
1716 bytes
I am trying to cut down on bytes in my software and don't want to
store redundant header information if I don't have to.
I am assuming that this group of headers is the same as not having a
MIME header at all:
   MIME-Version: 1.0
   Content-Type: text/plain; charset=us-ascii
   Content-Transfer-Encoding: 7bit
I also assume that if the last line (Content-Transfer-Encoding) is
missing that it is safe to assume 7bit.

Is this correct?  Is it safe to ignore the charset value entirely if
the CTE is 7bit?  This would make sense to me (well, perhaps there
should be a subset of values that are valid like "us-*" and "ISO-*"; I
imagine the "jp-*" values and such may be 7bit but totally non-english
glyphs).
Re: Which MIME headers are the same as non-MIME?
#68389
Author: Russ Allbery
Date: Tue, 02 Mar 2004 21:10
37 lines
2733 bytes
Gregg Woodcock <woodcock@sisna.com> writes:

> I am trying to cut down on bytes in my software and don't want to store
> redundant header information if I don't have to.  I am assuming that
> this group of headers is the same as not having a MIME header at all:

>    MIME-Version: 1.0
>    Content-Type: text/plain; charset=us-ascii
>    Content-Transfer-Encoding: 7bit

> I also assume that if the last line (Content-Transfer-Encoding) is
> missing that it is safe to assume 7bit.

If your message is a valid text/plain MIME message with a character set of
us-ascii, you *do* want to include the MIME-Version header.  I believe
that so long as you include MIME-Version, declaring your message to be
MIME, you can omit the remaining headers above, since they're the
defaults.

The reason to include the MIME-Version header is the same as the reason to
put a DTD declaration at the top of your web pages.  Without it being
there, software has to assume that your message was generated by a
pre-MIME engine and will have to guess about the content of the message.
It will probably guess right, but there's no need to make it go to the
effort.

> Is this correct?  Is it safe to ignore the charset value entirely if
> the CTE is 7bit?

No.  I mean, it probably is okay in practice, but the standards don't say
that.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Which MIME headers are the same as non-MIME?
#68395
Author: Jesper Harder
Date: Wed, 03 Mar 2004 00:39
18 lines
2049 bytes
Russ Allbery <rra@stanford.edu> writes:

> If your message is a valid text/plain MIME message with a character
> set of us-ascii, you *do* want to include the MIME-Version header.
> I believe that so long as you include MIME-Version, declaring your
> message to be MIME, you can omit the remaining headers above, since
> they're the defaults.

Yup.

>> Is it safe to ignore the charset value entirely if the CTE is 7bit?
>
> No.  I mean, it probably is okay in practice, but the standards
> don't say that.

You do see UTF-7 ocasionally which is 7bit. There also the various
ISO-2022 based 7bit encodings, but outside of CJK locales they're
probably mostly seen in spam.
Re: Which MIME headers are the same as non-MIME?
#68397
Author: Gregg Woodcock
Date: Wed, 03 Mar 2004 06:56
17 lines
1751 bytes
Jesper Harder <harder@myrealbox.com> wrote in message news:<m34qt6epcf.fsf@defun.localdomain>...
> Russ Allbery <rra@stanford.edu> writes:
> 
> >> Is it safe to ignore the charset value entirely if the CTE is 7bit?
> >
> > No.  I mean, it probably is okay in practice, but the standards
> > don't say that.
> 
> You do see UTF-7 ocasionally which is 7bit.

But if it is UTF-7 (i.e. "CTE: UTF-7"), it cannot also be 7bit (i.e.
"CTE: 7bit"); or do you mean that charset is UTF-7?

> There also the various
> ISO-2022 based 7bit encodings,

You are confusing me; "encodings" or "charsets"?
Re: Which MIME headers are the same as non-MIME?
#68398
Author: Russ Allbery
Date: Wed, 03 Mar 2004 07:06
25 lines
2308 bytes
Gregg Woodcock <woodcock@SonLightSoftware.com> writes:
> Jesper Harder <harder@myrealbox.com> wrote:

>> You do see UTF-7 ocasionally which is 7bit.

> But if it is UTF-7 (i.e. "CTE: UTF-7"), it cannot also be 7bit (i.e.
> "CTE: 7bit"); or do you mean that charset is UTF-7?

In the MIME world, UTF-8 would be a charset, even though it's actually an
encoding of the Unicode character set.  It's annoying.

The problem is that there are actually three different things that
identify the mapping of the bytes in an e-mail address to characters:

 * The transfer encoding (binary, 8bit, 7bit, quoted-printable, base64).
 * The character set used (ISO 8859-1, Unicode, etc.).
 * The encoding of that character set (UTF-8, UTF-7, UCS-32BE, etc.).

MIME combines the last two into its charset parameter.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Which MIME headers are the same as non-MIME?
#68441
Author: Kai Henningsen
Date: Fri, 05 Mar 2004 21:09
19 lines
1848 bytes
woodcock@sisna.com (Gregg Woodcock)  wrote on 02.03.04 in <74f1a64.0403021255.550ffb5c@posting.google.com>:

> Is this correct?  Is it safe to ignore the charset value entirely if
> the CTE is 7bit?  This would make sense to me (well, perhaps there
> should be a subset of values that are valid like "us-*" and "ISO-*"; I
> imagine the "jp-*" values and such may be 7bit but totally non-english
> glyphs).

The iso-2022-{jp,kr,...} stuff does include ASCII as a subset; most  
versions are 7bit and switch with esc sequences between ASCII, Japanese,  
and whatever else.

To _me_, this says it is _not_ safe to ignore the charset values.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads