Bind `process-connection-type' to nil, so that CRLF doesn't get translated to \n.
[gnus] / lisp / mm-bodies.el
1 ;;; mm-bodies.el --- Functions for decoding MIME things
2
3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
5
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
7 ;;      MORIOKA Tomohiko <morioka@jaist.ac.jp>
8 ;; This file is part of GNU Emacs.
9
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
14
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
22
23 ;;; Commentary:
24
25 ;;; Code:
26
27 ;; For Emacs < 22.2.
28 (eval-and-compile
29   (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
30
31 (require 'mm-util)
32 (require 'rfc2047)
33 (require 'mm-encode)
34
35 (defvar mm-uu-yenc-decode-function)
36 (defvar mm-uu-decode-function)
37 (defvar mm-uu-binhex-decode-function)
38
39 ;; 8bit treatment gets any char except: 0x32 - 0x7f, LF, TAB, BEL,
40 ;; BS, vertical TAB, form feed, and ^_
41 ;;
42 ;; Note that CR is *not* included, as that would allow a non-paired CR
43 ;; in the body contrary to RFC 2822:
44 ;;
45 ;;   - CR and LF MUST only occur together as CRLF; they MUST NOT
46 ;;     appear independently in the body.
47
48 (defvar mm-7bit-chars "\x20-\x7f\n\t\x7\x8\xb\xc\x1f")
49
50 (defcustom mm-body-charset-encoding-alist
51   '((iso-2022-jp . 7bit)
52     (iso-2022-jp-2 . 7bit)
53     ;; We MUST encode UTF-16 because it can contain \0's which is
54     ;; known to break servers.
55     ;; Note: UTF-16 variants are invalid for text parts [RFC 2781],
56     ;; so this can't happen :-/.
57     ;; PPS: Yes, it can happen if the user specifies UTF-16 in the MML
58     ;; markup. - jh.