Gnus development mailing list
 help / color / mirror / Atom feed
From: Andrei Elkin <astro@sbor.ru>
Cc: astro@sbor.ru
Subject: Re: mime-charset determination
Date: 21 Aug 2000 22:43:57 +0400	[thread overview]
Message-ID: <m3wvhafo9e.fsf@himmel.dune.ru> (raw)
In-Reply-To: elkin@astro.spbu.ru's message of "21 Aug 2000 16:22:00 +0400"

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 <rbelenov@my-deja.com> 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




  parent reply	other threads:[~2000-08-21 18:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m37l9b2o5t.fsf@himmel.dune.ru>
2000-08-21 12:22 ` elkin
2000-08-21 13:29   ` Roman Belenov
2000-08-21 18:43   ` Andrei Elkin [this message]
2000-08-20 18:21 Andrei Elkin
2000-08-20 18:38 ` ShengHuo ZHU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3wvhafo9e.fsf@himmel.dune.ru \
    --to=astro@sbor.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).