1 ;;; rfc1843.el --- HZ (rfc1843) decoding
3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 ;; 2005, 2006 Free Software Foundation, Inc.
6 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
7 ;; Keywords: news HZ HZ+ mail i18n
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published
13 ;; by the Free Software Foundation; either version 2, or (at your
14 ;; option) any later version.
16 ;; GNU Emacs is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ;; General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02110-1301, USA.
30 ;; (rfc1843-gnus-setup)
33 ;; (rfc1843-decode-string "~{<:Ky2;S{#,NpJ)l6HK!#~}")
37 (eval-when-compile (require 'cl))
40 (defvar gnus-decode-encoded-word-function)
41 (defvar gnus-decode-header-function)
42 (defvar gnus-newsgroup-name)
44 (defvar rfc1843-word-regexp
45 "~\\({\\([\041-\167][\041-\176]\\| \\)+\\)\\(~}\\|$\\)")
47 (defvar rfc1843-word-regexp-strictly
48 "~\\({\\([\041-\167][\041-\176]\\)+\\)\\(~}\\|$\\)")
50 (defvar rfc1843-hzp-word-regexp
51 "~\\({\\([\041-\167][\041-\176]\\| \\)+\\|\
52 \[<>]\\([\041-\175][\041-\176]\\| \\)+\\)\\(~}\\|$\\)")
54 (defvar rfc1843-hzp-word-regexp-strictly
55 "~\\({\\([\041-\167][\041-\176]\\)+\\|\
56 \[<>]\\([\041-\175][\041-\176]\\)+\\)\\(~}\\|$\\)")
58 (defcustom rfc1843-decode-loosely nil
59 "Loosely check HZ encoding if non-nil.
60 When it is set non-nil, only buffers or strings with strictly
61 HZ-encoded are decoded."