From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/32247 Path: main.gmane.org!not-for-mail From: Andrei Elkin Newsgroups: gmane.emacs.gnus.general Subject: Re: mime-charset determination Date: 21 Aug 2000 22:43:57 +0400 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035168550 18671 80.91.224.250 (21 Oct 2002 02:49:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:49:10 +0000 (UTC) Cc: astro@sbor.ru Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by mailhost.sclp.com (Postfix) with ESMTP id 48119D051E for ; Mon, 21 Aug 2000 14:46:27 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id NAC20856; Mon, 21 Aug 2000 13:45:38 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 21 Aug 2000 13:44:10 -0500 (CDT) Original-Received: from mailhost.sclp.com (postfix@66-209.196.61.interliant.com [209.196.61.66] (may be forged)) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id NAA14482 for ; Mon, 21 Aug 2000 13:43:51 -0500 (CDT) Original-Received: from relay2.sbor.ru (sb1.alkor.ru [195.239.62.113]) by mailhost.sclp.com (Postfix) with ESMTP id 9DA6BD051E for ; Mon, 21 Aug 2000 14:44:11 -0400 (EDT) Original-Received: from relay.sbor.ru (relay.sbor.ru [194.220.19.4]) by relay2.sbor.ru (8.9.3/8.9.2) with ESMTP id WAA60963 for ; Mon, 21 Aug 2000 22:44:18 +0400 (MSD) (envelope-from astro@sbor.ru) Original-Received: from himmel.sbor.ru (IDENT:root@[10.2.28.7]) by relay.sbor.ru (8.9.3/8.9.1) with ESMTP id WAA95940; Mon, 21 Aug 2000 22:44:03 +0400 (MSD) Original-Received: (from elkin@localhost) by himmel.sbor.ru (8.9.3/8.9.3) id WAA01243; Mon, 21 Aug 2000 22:43:57 +0400 X-Authentication-Warning: himmel.dune.ru: elkin set sender to astro@sbor.ru using -f Original-To: ding@gnus.org In-Reply-To: elkin@astro.spbu.ru's message of "21 Aug 2000 16:22:00 +0400" Original-Lines: 83 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.5 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:32247 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:32247 Let me proceed with the subject because some correction for my last post should be done. I should underline here that my subject correspont to unibyte mode with some language environment. That's exactly my situation. ShengHuo ZHU writes: > > select-message-coding-system might not be the answer for all > > situations, especially when a message contains characters in the > > charset other than the default one. [ ... ] elkin@astro.spbu.ru writes: > thanks, I've seen that. Nor we can deduce mime-charset with > current-language-environment's coding-system's property. Charset property analysis for unibyte mode don't get the true result without a hint like ShengHuo ZHU's: > > Anyway, the solution for KOI8-R encoding is > > > > (if (fboundp 'put-charset-property) > > (put-charset-property 'cyrillic-iso8859-5 > > 'preferred-coding-system 'koi8-r)) > > So I propose small changes in `mm-find-mime-charset-region' that don't require for charset property for the case of (and (not (mm-multibyte-p)) (boundp current-language-environment)) Another part of the code is kept unchanged. ;; proposed definition (defun mm-find-mime-charset-region (b e) "Return the MIME charsets needed to encode the region between B and E." (let ((charsets (if (or (mm-multibyte-p) (not (boundp 'current-language-environment))) (mapcar 'mm-mime-charset (delq 'ascii (mm-find-charset-region b e))) ;; here we avoid calling to both `mm-find-charset-region' ;; and `mm-mime-charset' (list (coding-system-get (first (detect-coding-with-language-environment b e current-language-environment)) 'mime-charset))))) (when (memq 'iso-2022-jp-2 charsets) (setq charsets (delq 'iso-2022-jp charsets))) (setq charsets (mm-delete-duplicates charsets)) (if (and (> (length charsets) 1) (fboundp 'find-coding-systems-region) (memq 'utf-8 (find-coding-systems-region b e))) '(utf-8) charsets))) > IMHO most Linux cyrillic emacsers really preferred koi8-r. > Would it better to change > the default cons (at characters.el) > (cyrillic-iso8859-5 . cyrillic-iso-8bit) > to > (cyrillic-iso8859-5 . cyrillic-koi8) > according to your advice? > > Maybe such setting should be > done at emacs building/configuration time (e.g thru locale variables value)? Roman Belenov writes: >>Linux is not the only system Emacs runs on. Other encodings like >>cp1251 or cp866 may suit better for some people - and it doesn't >>... I mean that some configuration tools are able to detect depended on whatever encoding value. E.g from locales that Linux have. But that doesnt a matter if we do not need for (put-charset-property 'cyrillic-iso8859-5 'preferred-coding-system 'koi8-r) anymore (that is an example of configuration in gnus.info :) ______________ Andrei.Elkin P.S still i should get mime-charset=koi8r (λοι8 :) in this message