Content-Type: multipart/mixed; boundary="1"
MIME-Version: 1.0

--1
Content-Transfer-Encoding: binary
Content-Type: text/plain; charset=utf-16le

T e s t   m e s s a g e 
 
--1
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset=utf-16be

AFQAZQBzAHQAIABtAGUAcwBzAGEAZwBlAAo=

--1
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset=utf-16le

VABlAHMAdAAgAG0AZQBzAHMAYQBnAGUACgA=

--1
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset=EUC-JP

odjApLOmv824osDruMCh2Q==

--1
Content-Transfer-Encoding: binary
Content-Type: text/plain; charset=UTF-8

invalid--1--

---- EXPECTED STRUCTURE ----
{
  "headers": {
    "values": {
      "content_type": {
        "ContentType": {
          "c_type": "multipart",
          "c_subtype": "mixed",
          "attributes": {
            "boundary": "1"
          }
        }
      },
      "mime_version": {
        "Text": "1.0"
      }
    },
    "offsets": [
      {
        "name": {
          "Rfc": "content_type"
        },
        "start": 13,
        "end": 44
      },
      {
        "name": {
          "Rfc": "mime_version"
        },
        "start": 57,
        "end": 62
      }
    ]
  },
  "html_body": [
    0,
    1,
    2,
    3
  ],
  "text_body": [
    0,
    1,
    2,
    3
  ],
  "attachments": [
    {
      "Attachment": 4
    }
  ],
  "parts": [
    {
      "Text": {
        "headers": {
          "values": {
            "content_transfer_encoding": {
              "Text": "binary"
            },
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain",
                "attributes": {
                  "charset": "utf-16le"
                }
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_transfer_encoding"
              },
              "start": 93,
              "end": 101
            },
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 114,
              "end": 144
            }
          ]
        },
        "contents": "Test message\n",
        "is_html": false
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_transfer_encoding": {
              "Text": "base64"
            },
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain",
                "attributes": {
                  "charset": "utf-16be"
                }
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_transfer_encoding"
              },
              "start": 202,
              "end": 210
            },
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 223,
              "end": 253
            }
          ]
        },
        "contents": "Test message\n",
        "is_html": false
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain",
                "attributes": {
                  "charset": "utf-16le"
                }
              }
            },
            "content_transfer_encoding": {
              "Text": "base64"
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_transfer_encoding"
              },
              "start": 322,
              "end": 330
            },
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 343,
              "end": 373
            }
          ]
        },
        "contents": "Test message\n",
        "is_html": false
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_transfer_encoding": {
              "Text": "base64"
            },
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain",
                "attributes": {
                  "charset": "EUC-JP"
                }
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_transfer_encoding"
              },
              "start": 442,
              "end": 450
            },
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 463,
              "end": 491
            }
          ]
        },
        "contents": "『世界人権宣言』",
        "is_html": false
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_transfer_encoding": {
              "Text": "binary"
            },
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain",
                "attributes": {
                  "charset": "UTF-8"
                }
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_transfer_encoding"
              },
              "start": 548,
              "end": 556
            },
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 569,
              "end": 596
            }
          ]
        },
        "contents": "invalid--1--\n",
        "is_html": false
      }
    }
  ],
  "structure": {
    "List": [
      {
        "Part": 0
      },
      {
        "Part": 1
      },
      {
        "Part": 2
      },
      {
        "Part": 3
      },
      {
        "Part": 4
      }
    ]
  },
  "offset_header": 0,
  "offset_body": 63,
  "offset_end": 610
}