comment
[bpt/emacs.git] / lisp / gnus / rfc2045.el
CommitLineData
c113de23
GM
1;;; rfc2045.el --- Functions for decoding rfc2045 headers
2
3;; Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
4
5;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6;; This file is part of GNU Emacs.
7
8;; GNU Emacs is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation; either version 2, or (at your option)
11;; any later version.
12
13;; GNU Emacs is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details.
17
18;; You should have received a copy of the GNU General Public License
19;; along with GNU Emacs; see the file COPYING. If not, write to the
20;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21;; Boston, MA 02111-1307, USA.
22
23;;; Commentary:
24
25;;; Code:
26
27(require 'ietf-drums)
28
29(defun rfc2045-encode-string (param value)
30 "Return and PARAM=VALUE string encoded according to RFC2045."
31 (if (or (string-match (concat "[" ietf-drums-no-ws-ctl-token "]") value)
32 (string-match (concat "[" ietf-drums-tspecials "]") value)
33 (string-match "[ \n\t]" value)
34 (not (string-match (concat "[" ietf-drums-text-token "]") value)))
35 (concat param "=" (format "%S" value))
36 (concat param "=" value)))
37
38(provide 'rfc2045)
39
40;;; rfc2045.el ends here