<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-menu-disabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 skin-theme-clientpref-os vector-sticky-header-enabled skin-thumbsize-clientpref-standard" lang="ja" dir="ltr"><head>
    <meta charset="UTF-8">
    <title>MIME</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/png" href="./_res_/favicon.png">
    <link rel="canonical" href="https://ja.wikipedia.org/wiki/MIME"> <link href="./_mw_/ext.cite.parsoid.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/mediawiki.skinning.content.parsoid.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
    <meta name="ResourceLoaderDynamicStyles" content="">
    <link href="./_mw_/ext.gadget.PDFLinkIcon.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/ext.gadget.RedirectColor.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
    <link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
    <link rel="stylesheet" type="text/css" href="./_res_/footer.css">
    <link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
  </head>
  <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-MIME rootpage-MIME skin-vector-2022 action-view">
    <div class="mw-page-container">
      <div class="mw-page-container-inner">
        <div class="mw-content-container">
          <main id="content" class="mw-body">
            <header class="mw-body-header vector-page-titlebar">
              <h1 id="firstHeading" class="firstHeading mw-first-heading"><span lang="ja" dir="ltr"><span class="mw-page-title-main">MIME</span></span></h1>
            </header>
            <a id="top"></a>
            <div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
              <div id="contentSub">
                <div id="mw-content-subtitle"></div>
              </div>
              <div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="ja" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="ja" dir="ltr" data-mw-parsoid-version="0.24.0.0-alpha4" data-mw-html-version="2.8.0"><section data-mw-section-id="0" id="mwAQ"><span class="mw-empty-elt" typeof="mw:Transclusion" id="mwAg"><style data-mw-deduplicate="TemplateStyles:r101346560" typeof="mw:Extension/templatestyles">
/* start https://ja.wikipedia.org/ */


.mw-parser-output .hatnote{margin:0.5em 0;padding:3px 2em;background-color:transparent;border-bottom:1px solid #a2a9b1;font-size:90%}html.skin-theme-clientpref-night .mw-parser-output .hatnote>table{color:inherit}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .hatnote>table{color:inherit}}


/* end   https://ja.wikipedia.org/ */
</style></span>
<span class="mw-empty-elt" typeof="mw:Transclusion" id="mwBA"></span>
<span class="mw-empty-elt" typeof="mw:Transclusion" id="mwBg"><style data-mw-deduplicate="TemplateStyles:r101304250" typeof="mw:Extension/templatestyles">
/* start https://ja.wikipedia.org/ */


.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%;font-size:90%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}html.client-js body.skin-minerva .mw-parser-output .mbox-text-span{margin-left:23px!important}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}


/* end   https://ja.wikipedia.org/ */
</style></span><span class="mw-empty-elt"></span>
<p id="mwBw"><b id="mwCA">MIME</b>（<span lang="en" typeof="mw:Transclusion" id="mwCQ"><b>Multipurpose Internet Mail Extensions</b></span>、<b id="mwCg">多目的インターネットメール拡張</b>）は、規格上<a rel="mw:WikiLink" href="ASCII" title="ASCII" id="mwCw">US-ASCII</a>の<a rel="mw:WikiLink" href="%E3%83%97%E3%83%AC%E3%83%BC%E3%83%B3%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88" title="プレーンテキスト" id="mwDA">テキスト</a>しか使用できない<a rel="mw:WikiLink" href="%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%BC%E3%83%8D%E3%83%83%E3%83%88" title="インターネット" id="mwDQ">インターネット</a>の<a rel="mw:WikiLink" href="%E9%9B%BB%E5%AD%90%E3%83%A1%E3%83%BC%E3%83%AB" title="電子メール" id="mwDg">電子メール</a>でさまざまなフォーマット（書式）を扱えるようにする規格である。<style data-mw-deduplicate="TemplateStyles:r106577700" typeof="mw:Extension/templatestyles mw:Transclusion" id="mwDw">
/* start https://ja.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"“""”""‘""’"}.mw-parser-output .citation.cs-ja1 q,.mw-parser-output .citation.cs-ja2 q{quotes:"「""」""『""』"}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./_mw_/Lock-green.svg")right 0.1em center/9px no-repeat;padding-right:1em}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./_mw_/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat;padding-right:1em}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./_mw_/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat;padding-right:1em}.mw-parser-output .cs1-ws-icon.cs1-ws-icon a{background:url("./_mw_/Wikisource-logo.svg")right 0.1em center/auto 1em no-repeat;padding-right:1em}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#bf3c2c)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#bf3c2c)}.mw-parser-output .cs1-maint{display:none;color:var(--color-success,#177860);margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}}


/* end   https://ja.wikipedia.org/ */
</style><a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2045" class="external text">2045</a>、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2046" class="external text">2046</a>、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2047" class="external text">2047</a>、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc4288" class="external text">4288</a>、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc4289" class="external text">4289</a><sup class="mw-ref reference" id="cite_ref-1" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-1" id="mwFA"><span class="mw-reflink-text" id="mwFQ"><span class="cite-bracket" id="mwFg">[</span>1<span class="cite-bracket" id="mwFw">]</span></span></a></sup>、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2049" class="external text">2049</a> で規定されている。</p>

</section><section data-mw-section-id="1" id="mwGg" aria-labelledby="概要"><div class="mw-heading mw-heading2"><h2 id="概要"><span id=".E6.A6.82.E8.A6.81" typeof="mw:FallbackId"></span>概要</h2></div>
<p id="mwGw">インターネットでメールの書式を定めている <a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc5322" class="external text">5322</a> (旧 <a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc822" class="external text">822</a>、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2822" class="external text">2822</a>)では、<a rel="mw:WikiLink" href="%E8%8B%B1%E6%95%B0%E5%AD%97" title="英数字" id="mwHw">英数字</a>といくつかの記号を7 ビットで表現する「US-ASCII」と呼ばれる文字コードを利用し、1行あたり1000 バイト(改行を含む)のテキストデータしか許していない。そのため、規格に不適合になるような長い行、US-ASCIIだけで表現できない文字や、<a rel="mw:WikiLink" href="%E3%83%90%E3%82%A4%E3%83%8A%E3%83%AA" title="バイナリ" id="mwIA">バイナリデータ</a>、<a rel="mw:WikiLink" href="%E7%94%BB%E5%83%8F" title="画像" id="mwIQ">画像</a>、<a rel="mw:WikiLink" href="%E9%9F%B3%E5%A3%B0" title="音声" id="mwIg">音声</a>などの非文字データを利用することができなかった。</p>

<p id="mwIw">MIMEはこれらのデータを取り扱うために新しくいくつかのヘッダを定義し、かつUS-ASCII上でさまざまなデータタイプを表現するための<a rel="mw:WikiLink" href="%E7%AC%A6%E5%8F%B7%E5%8C%96%E6%96%B9%E5%BC%8F" title="符号化方式" id="mwJA">符号化方式</a>を規定している。</p>

<p id="mwJQ"><a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc5322" class="external text">5322</a> (旧 <a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc822" class="external text">822</a>、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2822" class="external text">2822</a>)では1 通のメールで1つの本文しか扱うことができないが、MIMEでは本文を分割して複数のコンテンツを扱うことができるようにした。これを<b id="mwKQ">マルチパート</b>と呼ぶ。MIMEヘッダには、MIMEメッセージヘッダとMIMEパートヘッダの二つがある。MIMEメッセージヘッダはメッセージ全体に適用され、MIMEパートヘッダはマルチパートメッセージの各部分に適用される。マルチパートにより、1つのメールに複数の種類のファイルを扱うことができるようになった。</p>

<p id="mwKg">また、<a rel="mw:WikiLink" href="HTTP" title="HTTP" id="mwKw">HTTP</a>におけるデータの伝送に関しても、MIMEの枠組みが援用されている。</p>

</section><section data-mw-section-id="2" id="mwLA" aria-labelledby="MIMEで導入されたヘッダ"><div class="mw-heading mw-heading2"><h2 id="MIMEで導入されたヘッダ"><span id="MIME.E3.81.A7.E5.B0.8E.E5.85.A5.E3.81.95.E3.82.8C.E3.81.9F.E3.83.98.E3.83.83.E3.83.80" typeof="mw:FallbackId"></span>MIMEで導入されたヘッダ</h2></div>
<section data-mw-section-id="3" id="mwLQ" aria-labelledby="MIME-Version"><div class="mw-heading mw-heading3"><h3 id="MIME-Version">MIME-Version</h3></div>
<p id="mwLg">従来の<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc5322" class="external text">5322</a> (<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc822" class="external text">822</a>, <a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2822" class="external text">2822</a>) 準拠のメッセージとの区別、あるいは将来MIMEが拡張されたときにバージョンを区別するためのヘッダ。現在は1.0のみが規定されている。</p>
<pre id="mwMg">Mime-Version: 1.0</pre>

</section><section data-mw-section-id="4" id="mwMw" aria-labelledby="Content-Type"><div class="mw-heading mw-heading3"><h3 id="Content-Type">Content-Type</h3></div>
<div class="rellink " style="margin-bottom: 0.5em; padding-left: 2em; font-size: 90%;" role="note" typeof="mw:Transclusion" id="mwNA">→「<a rel="mw:WikiLink" href="%E3%83%A1%E3%83%87%E3%82%A3%E3%82%A2%E3%82%BF%E3%82%A4%E3%83%97" title="メディアタイプ">メディアタイプ</a>」も参照</div>
<p id="mwNQ">このメッセージ中のデータの種類を指定する。
一般的な書式は次の通り。</p>

<pre id="mwNg">Content-Type: <i id="mwNw">type</i>/<i id="mwOA">subtype</i>; <i id="mwOQ">parameter</i></pre>

<p id="mwOg"><i id="mwOw">type</i>は大分類となるデータの種類を指定する。<i id="mwPA">subtype</i>にはより詳細な形式を指定する。<i id="mwPQ">parameter</i>は追加の情報を指定するもので、複数指定できる。電子メールメッセージにおいて使われる例を以下に示す。</p>
<ul id="mwPg"><li id="mwPw"><code id="mwQA">text/plain; charset=iso-2022-jp; format=flowed; delsp=yes</code>（<a rel="mw:WikiLink" href="%E3%83%97%E3%83%AC%E3%83%BC%E3%83%B3%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88" title="プレーンテキスト" id="mwQQ">プレーンテキスト</a>、<a rel="mw:WikiLink" href="ISO-2022-JP" title="ISO-2022-JP" id="mwQg">ISO-2022-JP</a>、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc3676" class="external text">3676</a> で規定されるflowedおよびdelspの文字列折り返し処理を適用）</li>
<li id="mwRA"><code id="mwRQ">text/html; charset=UTF-8</code>（<a rel="mw:WikiLink" href="HyperText_Markup_Language" title="HyperText Markup Language" id="mwRg">HTML</a>テキスト、<a rel="mw:WikiLink" href="UTF-8" title="UTF-8" id="mwRw">UTF-8</a>）</li>
<li id="mwSA"><code id="mwSQ">multipart/alternative</code>（<a rel="mw:WikiLink" href="HTML%E9%9B%BB%E5%AD%90%E3%83%A1%E3%83%BC%E3%83%AB" title="HTML電子メール" id="mwSg">HTMLメール</a>において、HTMLによるメッセージと同等のプレーンテキストによるメッセージを用意する場合のように、同じ情報を異なる形式で表したマルチパート）</li></ul>

<p id="mwSw"><i id="mwTA">type</i>毎に未知の<i id="mwTQ">subtype</i>の扱いが規定されており、受信側は自分の扱えない<i id="mwTg">subtype</i>であっても最低限の取り扱いが可能となる。<code id="mwTw">text</code> の場合は <code id="mwUA">text/plain</code>、<code id="mwUQ">application/octet-stream</code>、<code id="mwUg">multipart</code> の場合は <code id="mwUw">multipart/mixed</code> である。<code id="mwVA">application</code>、<code id="mwVQ">image</code>、<code id="mwVg">audio</code>、<code id="mwVw">video</code>などは、未知の<i id="mwWA">subtype</i>について<code id="mwWQ">application/octet-stream</code>として扱うよう規定している。</p>

</section><section data-mw-section-id="5" id="mwWg" aria-labelledby="Content-Transfer-Encoding"><div class="mw-heading mw-heading3"><h3 id="Content-Transfer-Encoding"><code id="mwWw">Content-Transfer-Encoding</code></h3></div>
<p id="mwXA">MIMEではUS-ASCIIだけでなくデータのさまざまな符号化方法の指定がこのヘッダで可能になっている。
書式は以下の通り。</p>
<pre id="mwXQ">Content-Transfer-Encoding: <i id="mwXg">mechanism</i></pre>
<p id="mwXw"><i id="mwYA">mechanism</i>として、<code id="mwYQ">7bit</code>、<code id="mwYg">8bit</code>、<code id="mwYw">binary</code>、<code id="mwZA">quoted-printable</code>、<code id="mwZQ">base64</code> が指定できる。一般的に利用できるのは <code id="mwZg">7bit</code>、<code id="mwZw">quoted-printable</code>、<code id="mwaA">base64</code> であり、<code id="mwaQ">8bit</code>、<code id="mwag">binary</code> は一定の条件を満たす場合しか利用できない。</p>

<section data-mw-section-id="6" id="mwaw" aria-labelledby="7bit"><div class="mw-heading mw-heading4"><h4 id="7bit"><code id="mwbA">7bit</code></h4></div>
<p id="mwbQ">デフォルト値。7 ビットのテキストを表す。<code id="mwbg">Content-Transfer-Encoding</code> ヘッダフィールドを省略した場合は、この <code id="mwbw">7bit</code> を指定したのと同じ意味となる。US-ASCIIや<a rel="mw:WikiLink" href="ISO-2022-JP" title="ISO-2022-JP" id="mwcA">ISO-2022-JP</a>は確実に7 ビットのテキストであるため、これにあたる。</p>

</section><section data-mw-section-id="7" id="mwcQ" aria-labelledby="8bit"><div class="mw-heading mw-heading4"><h4 id="8bit"><code id="mwcg">8bit</code></h4></div>
<p id="mwcw">8 ビットのテキストを表す。
<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc5322" class="external text">5322</a> (旧<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc822" class="external text">822</a>、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2822" class="external text">2822</a>)は7 ビットのテキストを前提としており、この8bitは意図的に違反するものである。メールを転送するための<a rel="mw:WikiLink" href="Simple_Mail_Transfer_Protocol" title="Simple Mail Transfer Protocol" class="mw-redirect" id="mwdw">SMTP</a>は基本的に7 ビットのテキストしか転送できないため、このエンコーディングを用いることはできない。<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc1652" class="external text">1652</a>で定義されるSMTPの拡張(ESMTP)の<b id="mweQ">8BITMIME</b>を用いるか、8 ビットを許容するような全く別のプロトコルを用いた場合のみ、利用が可能である。</p>

</section><section data-mw-section-id="8" id="mweg" aria-labelledby="binary"><div class="mw-heading mw-heading4"><h4 id="binary"><code id="mwew">binary</code></h4></div>
<p id="mwfA">データがテキストではなくバイナリであることを表す。<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc5322" class="external text">5322</a> (旧<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc822" class="external text">822</a>、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2822" class="external text">2822</a>)はテキストを前提としており、このbinaryは意図的に違反するものである。SMTPは基本的に行単位でデータを扱うため、行の概念すらないバイナリは転送できない。<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc3030" class="external text">3030</a>で定義されるESMTPの1つである<b id="mwgQ">BINARYMIME</b>を用いるか、バイナリを許容するような全く別のプロトコルを用いた場合のみ、利用が可能である。</p>

</section><section data-mw-section-id="9" id="mwgg" aria-labelledby="quoted-printable"><div class="mw-heading mw-heading4"><h4 id="quoted-printable"><code id="mwgw">quoted-printable</code></h4></div>
<p id="mwhA">US-ASCIIに存在する文字はそのまま使い、存在しない文字などを <code id="mwhQ">=</code><i id="mwhg">HH</i>のような形で符号化する。ここで、<i id="mwhw">HH</i> には文字のコードを大文字の16進数で指定する。その他、以下のような規則がある。</p>
<ul id="mwiA"><li id="mwiQ"><code id="mwig">=</code> 自体は <code id="mwiw">=3D</code> となる。</li>
<li id="mwjA">行末に空白がある場合、伝送の過程で失われるおそれがあるため、<code id="mwjQ">=20</code> としてこれを保存する。</li>
<li id="mwjg">エンコードの過程で行を折り返す（改行を挿入する）場合、<code id="mwjw">=</code> と改行の組み合わせを挿入し、もともとあった改行と区別できるようにする。</li></ul>

<p id="mwkA">ヨーロッパ系の言語では、多くの文字がUS-ASCIIと同一で一部に独自の文字を使っているものが多い。
この場合に <code id="mwkQ">quoted-printable</code> を用いると、US-ASCIIはそのままの文字を使用しているので、データがほとんど大きくならず、<code id="mwkg">quoted-pritable</code> 対応プログラムを使わなくても、大体の内容が読めるという利点がある。
しかし通常のバイナリデータや、<a rel="mw:WikiLink" href="Shift_JIS" title="Shift JIS" id="mwkw">Shift_JIS</a>や<a rel="mw:WikiLink" href="EUC-JP" title="EUC-JP" id="mwlA">EUC-JP</a>といった仮名漢字などの非ヨーロッパ系の文字のテキストデータに <code id="mwlQ">quoted-printable</code> を適用した場合は、<a rel="mw:WikiLink" href="Base64" title="Base64" id="mwlg">base64</a>を使用した場合よりも大幅にデータが大きくなる。</p>

<div class="rellink " style="margin-bottom: 0.5em; padding-left: 2em; font-size: 90%;" role="note" typeof="mw:Transclusion" id="mwlw">→詳細は「<a rel="mw:WikiLink" href="Quoted-printable" title="Quoted-printable">Quoted-printable</a>」を参照</div>

</section><section data-mw-section-id="10" id="mwmA" aria-labelledby="base64"><div class="mw-heading mw-heading4"><h4 id="base64"><code id="mwmQ">base64</code></h4></div>
<p id="mwmg">3<a rel="mw:WikiLink" href="8%E3%83%93%E3%83%83%E3%83%88" title="8ビット" id="mwmw">オクテット</a>（24 ビット）を6 ビットずつ4つに分割し、各6 ビットの値に対してそれぞれUS-ASCIIの64 文字（英字52 文字、数字10 文字、「+」、「/」）を割り当てる符号化方式。</p>

<p id="mwnA">この符号化によって、<a rel="mw:WikiLink" href="Simple_Mail_Transfer_Protocol" title="Simple Mail Transfer Protocol" class="mw-redirect" id="mwnQ">SMTP</a>などUS-ASCIIしか許されていない通信路でもバイナリデータを交換できるメリットはあるが、データ容量は約33%増加する。</p>

<div class="rellink " style="margin-bottom: 0.5em; padding-left: 2em; font-size: 90%;" role="note" typeof="mw:Transclusion" id="mwng">→詳細は「<a rel="mw:WikiLink" href="Base64" title="Base64">base64</a>」を参照</div>

</section></section></section><section data-mw-section-id="11" id="mwnw" aria-labelledby="ヘッダでの非US-ASCII_文字の扱い"><div class="mw-heading mw-heading2"><h2 id="ヘッダでの非US-ASCII_文字の扱い"><span id=".E3.83.98.E3.83.83.E3.83.80.E3.81.A7.E3.81.AE.E9.9D.9EUS-ASCII_.E6.96.87.E5.AD.97.E3.81.AE.E6.89.B1.E3.81.84" typeof="mw:FallbackId"></span>ヘッダでの非US-ASCII 文字の扱い</h2></div>
<p id="mwoA">上記のヘッダの導入によって、body部のデータタイプや符号化方式は指定できるようになったが、このままではヘッダ部は相変わらずUS-ASCIIしか利用できない。MIMEでは<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2047" class="external text">2047</a>や<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2231" class="external text">2231</a>によって、ヘッダ部分での非US-ASCII文字の扱いを規定している。<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2047" class="external text">2047</a>によれば、</p>
<pre id="mwpA">=?<i id="mwpQ">charset</i>?<i id="mwpg">encoding</i>?<i id="mwpw">encoded-text</i>?=</pre>
<p id="mwqA">という形式により、<a rel="mw:WikiLink" href="%E6%96%87%E5%AD%97%E3%82%B3%E3%83%BC%E3%83%89" title="文字コード" id="mwqQ">文字コード</a>系が<i id="mwqg">charset</i>、<a rel="mw:WikiLink" href="%E7%AC%A6%E5%8F%B7%E5%8C%96%E6%96%B9%E5%BC%8F" title="符号化方式" id="mwqw">符号化方法</a>が<i id="mwrA">encoding</i>で、<i id="mwrQ">encoded-text</i>と符号化された単語を表現できる。<i id="mwrg">charset</i>は <code id="mwrw">Content-Type:text/plain</code> における <code id="mwsA">charset</code> パラメータで指定するのと同じ、<a rel="mw:WikiLink" href="Internet_Assigned_Numbers_Authority" title="Internet Assigned Numbers Authority" id="mwsQ">IANA</a>に登録された文字列を用いる。<i id="mwsg">encoding</i> は <code id="mwsw">Q</code> または <code id="mwtA">B</code>（大文字でも小文字でもよい）であり、前者はほぼ <code id="mwtQ">quoted-printable</code> と同じ符号化方法、後者は <code id="mwtg">base64</code>を用いることを表す。</p>

<ul id="mwtw"><li id="mwuA"><a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2047" class="external text">2047</a>では、「<code id="mwug">"</code>」で囲まれた中でこのような符号化された単語を解釈することはできない、とされている。したがって、「<code id="mwuw">"=?ISO-2022-JP?B?GyRCRnxLXDhsGyhC?="</code>」は「<code id="mwvA">=?ISO-2022-JP?B?GyRCRnxLXDhsGyhC?=</code>」と解釈しなければならず、これを「日本語」と解釈することは、規格違反となる。しかし、<a rel="mw:WikiLink" href="Outlook_Express" title="Outlook Express" id="mwvQ">Microsoft Outlook Express</a>など、一部の<a rel="mw:WikiLink" href="%E9%9B%BB%E5%AD%90%E3%83%A1%E3%83%BC%E3%83%AB%E3%82%AF%E3%83%A9%E3%82%A4%E3%82%A2%E3%83%B3%E3%83%88" title="電子メールクライアント" id="mwvg">MUA</a>がこのような誤った符号化を実装してそれが普及してしまったため、それを規格違反と知っているMUAの作者も、それに対応することを余儀なくされている。</li></ul>

<ul id="mwvw"><li id="mwwA"><a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2231" class="external text">2231</a>では、MIMEパラメータの値に非US-ASCII文字を指定する方法を規定している。これによれば、<a rel="mw:WikiLink" href="%E6%B7%BB%E4%BB%98%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB" title="添付ファイル" id="mwwg">添付ファイル</a>名など、MIMEパラメータの値としての「<code id="mwww">ISO-2022-JP<span typeof="mw:Entity" id="mwxA">'</span><span typeof="mw:Entity" id="mwxQ">'</span>%1B$BF|K%5C8l%1B%28B</code>」を「日本語」と解釈することができる<sup class="mw-ref reference" id="cite_ref-2" rel="dc:references" typeof="mw:Extension/ref"><a href="#cite_note-2" id="mwxg"><span class="mw-reflink-text" id="mwxw"><span class="cite-bracket" id="mwyA">[</span>2<span class="cite-bracket" id="mwyQ">]</span></span></a></sup>。また、<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect">RFC</a><span typeof="mw:Entity">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc5322" class="external text">5322</a>に適合しない長さの文字列を短く分割して指定する方法も規定している。</li></ul>

</section><section data-mw-section-id="12" id="mwyw" aria-labelledby="脚注"><div class="mw-heading mw-heading2"><h2 id="脚注"><span id=".E8.84.9A.E6.B3.A8" typeof="mw:FallbackId"></span>脚注</h2></div>
<div class="reflist" style=" list-style-type: decimal;" typeof="mw:Transclusion" id="mwzQ">
<ol class="mw-references references" typeof="mw:Extension/references" id="mwzg"><li id="cite_note-1" data-mw-footnote-number="1"><span class="mw-cite-backlink" id="mwzw"><a href="#cite_ref-1" rel="mw:referencedBy" id="mw0A"><span class="mw-linkback-text" id="mw0Q">↑</span></a></span> <span id="mw-reference-text-cite_note-1" class="mw-reference-text reference-text">旧<a rel="mw:WikiLink" href="RFC_(%E8%AD%98%E5%88%A5%E5%AD%90)" title="RFC (識別子)" class="mw-redirect" id="mw0w">RFC</a><span typeof="mw:Entity" id="mw1A">&nbsp;</span><a rel="mw:ExtLink nofollow" href="https://datatracker.ietf.org/doc/html/rfc2048" class="external text" id="mw1Q">2048</a>。</span></li>
<li id="cite_note-2" data-mw-footnote-number="2"><span class="mw-cite-backlink" id="mw1g"><a href="#cite_ref-2" rel="mw:referencedBy" id="mw1w"><span class="mw-linkback-text" id="mw2A">↑</span></a></span> <span id="mw-reference-text-cite_note-2" class="mw-reference-text reference-text">「<code id="mw2Q"><span typeof="mw:Entity" id="mw2g">'</span><span typeof="mw:Entity" id="mw2w">'</span></code>」は、二重引用符ではなく、2 個の単引用符である。</span></li>
</ol></div>

</section><section data-mw-section-id="13" id="mw3A" aria-labelledby="関連項目"><div class="mw-heading mw-heading2"><h2 id="関連項目"><span id=".E9.96.A2.E9.80.A3.E9.A0.85.E7.9B.AE" typeof="mw:FallbackId"></span>関連項目</h2></div>
<ul id="mw3Q"><li id="mw3g"><a rel="mw:WikiLink" href="%E6%8B%A1%E5%BC%B5%E5%AD%90" title="拡張子" id="mw3w">拡張子</a></li>
<li id="mw4A"><a rel="mw:WikiLink" href="%E9%9B%BB%E5%AD%90%E3%83%A1%E3%83%BC%E3%83%AB" title="電子メール" id="mw4Q">電子メール</a></li>
<li id="mw4g"><a rel="mw:WikiLink" href="Simple_Mail_Transfer_Protocol" title="Simple Mail Transfer Protocol" class="mw-redirect" id="mw4w">SMTP</a> (Simple Mail Transfer Protocol)</li>
<li id="mw5A"><a rel="mw:WikiLink" href="MHTML" title="MHTML" id="mw5Q">MHTML</a> (MIME Encapsulation of Aggregate HTML Documents)</li>
<li id="mw5g"><a rel="mw:WikiLink" href="S/MIME" title="S/MIME" id="mw5w">S/MIME</a> (Secure / Multipurpose Internet Mail Extensions)</li></ul>

<span class="mw-empty-elt" typeof="mw:Transclusion" id="mw6A"><style data-mw-deduplicate="TemplateStyles:r96783592" typeof="mw:Extension/templatestyles">
/* start https://ja.wikipedia.org/ */


.mw-parser-output .asbox{position:relative;overflow:hidden}.mw-parser-output .asbox table{background:transparent}.mw-parser-output .asbox p{margin:0}.mw-parser-output .asbox p+p{margin-top:0.25em}.mw-parser-output .asbox{font-size:90%}.mw-parser-output .asbox-note{font-size:90%}.mw-parser-output .asbox .navbar{position:absolute;top:-0.90em;right:1em;display:none}


/* end   https://ja.wikipedia.org/ */
</style></span>

<span typeof="mw:Transclusion" id="mw6g"></span>



</section></div><!--htdig_noindex--><div><div class="zim-footer">
    This article is issued from <a class="external text" title="Last edited on 2025-12-08" href="https://ja.wikipedia.org/wiki/?title=MIME&amp;oldid=107517790">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.ja">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
            </div>
          </main>
        </div>
      </div>
    </div>
     <script src="./_webp_/webpHandler.js"></script>
  

</body></html>