Gnus development mailing list
 help / color / mirror / Atom feed
From: Vladimir Volovich <vvv@vvv.vsu.ru>
Subject: Re: setting default MIME charset not works with emacs 20.4
Date: 01 Aug 1999 14:24:54 +0400	[thread overview]
Message-ID: <m3672zajd5.fsf@vvv.vsu.ru> (raw)
In-Reply-To: Vladimir Volovich's message of "30 Jul 1999 04:16:11 +0400"

[-- Attachment #1: Type: text/plain, Size: 2678 bytes --]

"VV" == Vladimir Volovich writes:

 VV> Hi, with emacs-20.3.6, i had

 VV> (set-language-environment "Cyrillic-KOI8") ;...
 VV> (coding-system-put (get-charset-property 'cyrillic-iso8859-5
 VV> 'prefered-coding-system) 'mime-charset 'koi8-r)

 VV> to set the default MIME charset for posting messages with
 VV> cyrillic in KOI8-R (instead of ISO-8859-5). This worked fine; but
 VV> when i upgraded to emacs 20.4, this no longer works (yes, i
 VV> renamed prefered-coding-system to preferred-coding-system): my
 VV> messages are sent in iso-8859-5 instead of koi8-r.

 VV> what should i do in emacs 20.4 to get things working? :-)

(1) well, finally the following works:

(put-charset-property 'cyrillic-iso8859-5 'prefered-coding-system 'koi8-r)

i.e. instead of coding-system-put, use put-charset-property. i wonder,
why that change was needed, i.e. what changed between emacs-20.3.6 and
emacs-20.4?

(2) mm-util.el reads:

(defun mm-preferred-coding-system (charset)
  ;; A typo in some Emacs versions.
  (or (get-charset-property charset 'prefered-coding-system)
      (get-charset-property charset 'preffered-coding-system)))

in emacs-20.3, the name was prefered-coding-system, in emacs-20.4, it
was corrected: preferred-coding-system; but gnus does not check for
this name, but instead checks for preffered-coding-system, which seems
to be a typo in _gnus_, not in emacs (or is preffered-coding-system
really used somewhere?). [i.e. it seems that in mm-util.el, one should
either change preffered-coding-system to preferred-coding-system, or
add a check for preferred-coding-system].

(3) files in emacs/<version>/language/ define preferred mime charsets
    for coding systems, so gnus probably could extract that info from
    there instead of insisting to use such things as
    put-charset-property in .emacs file.

    i.e. (coding-system-get 'cyrillic-koi8 'mime-charset) returns
    koi8-r.

    Also, emacs/<version>/lisp/international/ contains some useful
    stuff for charsets, e.g. mule-cmds.el contains
    find-coding-systems-for-charsets which could be used in gnus.

(find-coding-systems-for-charsets (find-charset-string "test тест"))
(cyrillic-koi8 cyrillic-iso-8bit x-ctext iso-2022-7bit iso-2022-7bit-lock iso-2022-8bit-ss2 emacs-mule raw-text cyrillic-alternativnyj thai-tis620-with-esc tibetan-iso-8bit-with-esc lao-with-esc korean-iso-8bit-with-esc japanese-iso-8bit-with-esc in-is13194-devanagari-with-esc chinese-iso-8bit-with-esc iso-latin-5-with-esc hebrew-iso-8bit-with-esc greek-iso-8bit-with-esc cyrillic-iso-8bit-with-esc iso-latin-4-with-esc iso-latin-3-with-esc iso-latin-2-with-esc iso-latin-1-with-esc compound-text iso-2022-7bit-ss2)


[-- Attachment #2: Type: text/plain, Size: 563 bytes --]

(find-coding-systems-for-charsets (find-charset-string "test êãõëå"))
(iso-latin-1 iso-2022-jp-2 x-ctext iso-2022-7bit iso-2022-7bit-lock iso-2022-8bit-ss2 emacs-mule raw-text thai-tis620-with-esc tibetan-iso-8bit-with-esc lao-with-esc korean-iso-8bit-with-esc japanese-iso-8bit-with-esc in-is13194-devanagari-with-esc chinese-iso-8bit-with-esc iso-latin-5-with-esc hebrew-iso-8bit-with-esc greek-iso-8bit-with-esc cyrillic-iso-8bit-with-esc iso-latin-4-with-esc iso-latin-3-with-esc iso-latin-2-with-esc iso-latin-1-with-esc compound-text iso-2022-7bit-ss2)


[-- Attachment #3: Type: text/plain, Size: 66 bytes --]

(find-coding-systems-for-charsets (find-charset-string "test тест 

[-- Attachment #4: Type: text/plain, Size: 781 bytes --]

êãõëå"))
(x-ctext iso-2022-7bit iso-2022-7bit-lock iso-2022-8bit-ss2 emacs-mule raw-text thai-tis620-with-esc tibetan-iso-8bit-with-esc lao-with-esc korean-iso-8bit-with-esc japanese-iso-8bit-with-esc in-is13194-devanagari-with-esc chinese-iso-8bit-with-esc iso-latin-5-with-esc hebrew-iso-8bit-with-esc greek-iso-8bit-with-esc cyrillic-iso-8bit-with-esc iso-latin-4-with-esc iso-latin-3-with-esc iso-latin-2-with-esc iso-latin-1-with-esc compound-text iso-2022-7bit-ss2)

i.e. gnus should find-charset-string for the message part body, then
call find-coding-systems-for-charsets, and finally select the
appropriate charset from the returned list; it could then extract the
mime-charset to use for encoding that charset via coding-system-get.

	Best regards, -- Vladimir.

  reply	other threads:[~1999-08-01 10:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-30  0:16 Vladimir Volovich
1999-08-01 10:24 ` Vladimir Volovich [this message]
1999-09-24 17:01   ` Lars Magne Ingebrigtsen
1999-09-25 16:03     ` Vladimir Volovich
1999-09-27 17:28       ` Lars Magne Ingebrigtsen
1999-09-27 18:52         ` Vladimir Volovich
1999-09-27 19:14           ` Lars Magne Ingebrigtsen
1999-09-27 20:17             ` Arcady Genkin

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=m3672zajd5.fsf@vvv.vsu.ru \
    --to=vvv@vvv.vsu.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).