[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: Locale Dependent Downcasing in smtpmail]
From: |
Chong Yidong |
Subject: |
Re: address@hidden: Locale Dependent Downcasing in smtpmail] |
Date: |
Tue, 03 Apr 2007 12:30:37 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
>> nndoc.el:511: (intern (downcase (mail-header-strip encoding))))))
>> nndoc.el:905: subtype (downcase (match-string 2 content-type))
>> rfc2047.el:674: (concat "=?" (downcase (symbol-name mime-charset))
>>
>> Failing Cases:
>> (downcase "ISO-8859-1") ==> ıso-8859-1
>> (downcase "text/plain") ==> text-plaın
>
> Perhaps we should have something like downcase-ascii for such
> situations.
Yeah.
How about the following approach? At the beginning of characters.el,
save the standard case table (which AFAICT hasn't been modified at
that point), as a variable ascii-case-table. Then downcase-ascii can
use it.
*** emacs/lisp/international/characters.el.~1.65.~ 2007-03-05
02:00:16.000000000 -0500
--- emacs/lisp/international/characters.el 2007-04-03 12:18:07.000000000
-0400
***************
*** 43,48 ****
--- 43,54 ----
;;; Predefined categories.
+ ;; Save ASCII case table.
+
+ (require 'case-table)
+ (defvar ascii-case-table (copy-case-table (standard-case-table))
+ "Case table for the ASCII character set.")
+
;; For each character set.
(define-category ?a "ASCII graphic characters 32-126 (ISO646 IRV:1983[4/0])")
*** emacs/lisp/subr.el.~1.549.~ 2007-03-19 14:37:19.000000000 -0400
--- emacs/lisp/subr.el 2007-04-03 12:26:04.000000000 -0400
***************
*** 2804,2809 ****
--- 2804,2819 ----
;; Reconstruct a string from the pieces.
(setq matches (cons (substring string start l) matches)) ; leftover
(apply #'concat (nreverse matches)))))
+
+ (defun downcase-ascii (string)
+ "Convert ASCII argument to lower case and return that.
+ The argument may be a character or string. The result has the same type.
+ The argument object is not altered--the value is a copy."
+ (let ((old-case-table (current-case-table)))
+ (unwind-protect
+ (progn (set-case-table ascii-case-table)
+ (downcase string))
+ (set-case-table old-case-table))))
;;;; invisibility specs
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], (continued)
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Kenichi Handa, 2007/04/03
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Werner LEMBERG, 2007/04/03
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Eli Zaretskii, 2007/04/03
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Simon Josefsson, 2007/04/03
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Volkan YAZICI, 2007/04/03
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Eli Zaretskii, 2007/04/03
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], David Kastrup, 2007/04/03
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Andreas Schwab, 2007/04/03
- Message not available
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], David Kastrup, 2007/04/03
- Message not available
- Message not available
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], David Kastrup, 2007/04/03
- Re: address@hidden: Locale Dependent Downcasing in smtpmail],
Chong Yidong <=
- with-case-table / ascii-case-table (was: address@hidden: Locale Dependent Downcasing in smtpmail]), Reiner Steib, 2007/04/03
- Re: with-case-table / ascii-case-table, Chong Yidong, 2007/04/04
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Richard Stallman, 2007/04/04
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Andreas Schwab, 2007/04/04
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Richard Stallman, 2007/04/05
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Kenichi Handa, 2007/04/06
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Werner LEMBERG, 2007/04/06
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Kenichi Handa, 2007/04/06
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Werner LEMBERG, 2007/04/06
- Re: address@hidden: Locale Dependent Downcasing in smtpmail], Eli Zaretskii, 2007/04/06