X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Futf7.el;h=47c3b0f4c5dbbbf0e00aec0a01726aada91f6d1c;hb=7ad80d3719e53fc5e4c2c337c84f91c08ff7a2d1;hp=5f15d5465de27714c7d654efcd3f932da3d5590a;hpb=2a7fa71aba0499808ad9fe57a1b8593b69eee397;p=gnus diff --git a/lisp/utf7.el b/lisp/utf7.el index 5f15d5465..47c3b0f4c 100644 --- a/lisp/utf7.el +++ b/lisp/utf7.el @@ -1,7 +1,7 @@ ;;; utf7.el --- UTF-7 encoding/decoding for Emacs -*-coding: iso-8859-1;-*- ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -;; 2008, 2009 Free Software Foundation, Inc. +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Jon K Hellan ;; Maintainer: bugs@gnus.org @@ -78,7 +78,7 @@ (defconst utf7-utf-16-coding-system (cond ((mm-coding-system-p 'utf-16-be-no-signature) ; Mule-UCS 'utf-16-be-no-signature) - ((and (mm-coding-system-p 'utf-16-be) ; Emacs 21.3, Emacs 22 + ((and (mm-coding-system-p 'utf-16-be) ; Emacs ;; Avoid versions with BOM. (= 2 (length (encode-coding-string "a" 'utf-16-be)))) 'utf-16-be) @@ -112,7 +112,7 @@ Use IMAP modification if FOR-IMAP is non-nil." (skip-chars-forward not-direct-encoding-chars))) (if (and (= fc esc-char) (= run-length 1)) ; Lone esc-char? - (delete-backward-char 1) ; Now there's one too many + (delete-char -1) ; Now there's one too many (utf7-fragment-encode p (point) for-imap)) (insert "-"))))))) @@ -153,7 +153,7 @@ Use IMAP modification if FOR-IMAP is non-nil." (save-excursion (utf7-fragment-decode p (point) for-imap) (goto-char p) - (delete-backward-char 1))))))))) + (delete-char -1))))))))) (defun utf7-fragment-decode (start end &optional for-imap) "Decode base64 encoded fragment from START to END of UTF-7 text in buffer. @@ -205,6 +205,7 @@ Characters are in raw byte pairs in narrowed buffer." (mm-decode-coding-region (point-min) (point-max) 'iso-8859-1) (mm-enable-multibyte)) +;;;###autoload (defun utf7-encode (string &optional for-imap) "Encode UTF-7 STRING. Use IMAP modification if FOR-IMAP is non-nil." (if (and (coding-system-p 'utf-7) (coding-system-p 'utf-7-imap)) @@ -228,5 +229,4 @@ Characters are in raw byte pairs in narrowed buffer." (provide 'utf7) -;; arch-tag: 96078b55-85c7-4161-aed2-932c24b282c7 ;;; utf7.el ends here