;ELC   
;;; Compiled by amu@daemon on Thu Jan 11 15:04:17 2001
;;; from file /afs/sipb.mit.edu/contrib/emacs/packages/gnus-5.8.8/lisp/utf7.el
;;; in Emacs version 20.7.2
;;; with bytecomp version 2.56
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`utf7.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(require 'base64)
#@55 Character ranges which do not need escaping in UTF-7.
(defvar utf7-direct-encoding-chars " -%'-*,-[]-}" (#$ . 636))
#@75 Character ranges which do not need escaping in the IMAP variant of UTF-7.
(defvar utf7-imap-direct-encoding-chars (concat utf7-direct-encoding-chars "+\\~") (#$ . 758))
#@70 Return required length of padding for IMAP modified base64 fragment.
(defalias 'utf7-imap-get-pad-length #[(len modulus) "\302[	\"\207" [len modulus mod] 3 (#$ . 933)])
(put 'utf7-imap-get-pad-length 'byte-optimizer 'byte-compile-inline-expand)
#@91 Encode text in (temporary) buffer as UTF-7.
Use IMAP modification if FOR-IMAP is non-nil.
(defalias 'utf7-encode-internal #[(&optional for-imap) "ed\211}\210	b\210\n\203 \306\202 \307\n\203 \202 \fm?\205b \310w\210m\204  c\210`g\311P\310wU\203T \312U\203T \313\312!\210\202[ \314`\n#\210\315c\210+\202  ,\207" [end start for-imap utf7-imap-direct-encoding-chars utf7-direct-encoding-chars direct-encoding-chars 38 43 nil "^" 1 delete-backward-char utf7-fragment-encode "-" esc-char run-length fc p] 5 (#$ . 1185)])
#@113 Encode text from START to END in buffer as UTF-7 escape fragment.
Use IMAP modification if FOR-IMAP is non-nil.
(defalias 'utf7-fragment-encode #[(start end &optional for-imap) "\214	}\210\304\305! \210\306d\"\210b\210d\203' \307\310\311\312#\203' \313\314!\210\202 \315\nw\210`\n|*\207" [start end pm for-imap utf7-get-u16char-converter to-utf-16 base64-encode-region search-forward "/" nil t replace-match "," "^= 	\n"] 4 (#$ . 1736)])
#@88 Decode UTF-7 text in (temporary) buffer.
Use IMAP modification if FOR-IMAP is non-nil.
(defalias 'utf7-decode-internal #[(&optional for-imap) "ed\211b\210\306\307\n\203 \310\202 \311!P\312\307\n\203 \313\202  \314!Pm?\205c \315w\210m\204# \315u\210`\f\315wm\204H g\316U\203H \317\320!\210\321U\204_ \212\322`\n#\210b\210\323\320!\210)*\202# ,\207" [end start for-imap esc-pattern base64-chars run-length "^" char-to-string 38 43 "A-Za-z0-9+" 44 47 nil 45 delete-char 1 0 utf7-fragment-decode delete-backward-char p] 5 (#$ . 2186)])
#@121 Decode base64 encoded fragment from START to END of UTF-7 text in buffer.
Use IMAP modification if FOR-IMAP is non-nil.
(defalias 'utf7-fragment-decode #[(start end &optional for-imap) "\214	}\210\n\203 b\210\306\307\310\311#\203 \312\313!\210\202\f 	Z\314\315\f[\"*\316\317\"c\210\320	\\\"\210)\321\322! )\207" [start end for-imap modulus len pl search-forward "," nil move-to-end replace-match "/" 4 mod make-string 61 base64-decode-region utf7-get-u16char-converter from-utf-16] 4 (#$ . 2741)])
#@72 Return a function to convert between UTF-16 and current character set.
(defalias 'utf7-get-u16char-converter #[(which-way) "\301=\203 \302\207\303\207" [which-way to-utf-16 utf7-latin1-u16-char-converter utf7-u16-latin1-char-converter] 2 (#$ . 3257)])
#@123 Convert latin 1 (ISO-8859.1) characters to 16 bit Unicode.
Characters are converted to raw byte pairs in narrowed buffer.
(defalias 'utf7-latin1-u16-char-converter #[nil "eb\210m?\205 \300c\210\301u\210\202 \207" [0 nil] 1 (#$ . 3518)])
#@113 Convert 16 bit Unicode characters to latin 1 (ISO-8859.1).
Characters are in raw byte pairs in narrowed buffer.
(defalias 'utf7-u16-latin1-char-converter #[nil "eb\210m?\205 g\300U\203 \301\302!\210\202 \303\304!\210\305u\210\202 \207" [0 delete-char 1 error "Unable to convert from Unicode" nil] 2 (#$ . 3764)])
#@69 Encode UTF-7 STRING.  Use IMAP modification if FOR-IMAP is non-nil.
(defalias 'utf7-encode #[(string &optional for-imap) "\304\305\306\307!!\310\216r	q\210\nc\210\311!\210\312 ,\207" [default-enable-multibyte-characters #1=#:temp-buffer string for-imap nil get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) utf7-encode-internal buffer-string] 3 (#$ . 4087)])
#@69 Decode UTF-7 STRING.  Use IMAP modification if FOR-IMAP is non-nil.
(defalias 'utf7-decode #[(string &optional for-imap) "\304\305\306\307!!\310\216r	q\210\nc\210\311!\210\312 ,\207" [default-enable-multibyte-characters #1=#:temp-buffer string for-imap nil get-buffer-create generate-new-buffer-name " *temp*" ((byte-code "\301!\203\n \302!\210\301\207" [#1# buffer-name kill-buffer] 2)) utf7-decode-internal buffer-string] 3 (#$ . 4538)])
(provide 'utf7)
