[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TUTORIAL.bg and windows-1251

From: Ognyan Kulev
Subject: Re: TUTORIAL.bg and windows-1251
Date: Wed, 07 Jan 2004 18:22:33 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4

Kenichi Handa wrote:
(let ((lang-env current-language-environment)
      (mirror-R (string (decode-char 'ucs #x42f)))
(hex-print #'(lambda (head str) (insert head)
                     (dotimes (i (length str))
                       (let ((ch (aref str i)))
                         (if (< ch 128)
                             (insert ch)
                           (insert (format "\\x%X" (aref str i))))))
                     (insert "\n")))
      encoded decoded)
  (funcall hex-print "original:" mirror-R)
  (set-language-environment "Bulgarian")
  (setq encoded (encode-coding-string mirror-R 'ctext-with-extensions))
  (funcall hex-print "encoded: " encoded)
  (setq decoded (decode-coding-string encoded 'ctext-with-extensions))
  (funcall hex-print "decoded: " decoded)
  (set-language-environment "English")
  (setq encoded (encode-coding-string mirror-R 'ctext-with-extensions))
  (funcall hex-print "encoded: " encoded)
  (setq decoded (decode-coding-string encoded 'ctext-with-extensions))
  (funcall hex-print "decoded: " decoded)
  (set-language-environment lang-env))

The result I got is this.

encoded: %/1\x80\x92microsoft-cp1251\xDF
decoded: \x5144F
encoded: %G\xD0\xAF%@
decoded: \x5144F

It seems that the coding system ctext-with-extensions is
working as expected here.

I get the same here.

By the way, for rendering, I installed the code I proposed a
while ago which forces *-microsoft-cp1251 fonts to be used
for Cyrillic letters of the charset mule-unicode-0100-24ff
in Bulgarian environment on 2003-12-29.  Have you noticed

Wait! My report is exactly about that change not working. What you sent[1] in pure elisp works as expected though.

[1] http://mail.gnu.org/archive/html/emacs-devel/2003-11/msg00452.html

When in current (2004-01-07) emacs I eval the following elisp (written by you), microsoft-cp1251 font is used for cyrillic characters. But just setting language environment to bulgarian doesn't work and iso10646-1 is used.

(defun use-microsoft-cp1251-font ()
  (let ((fontspec '(nil . "microsoft-cp1251")))
     #'(lambda (k v)
         (if (and v (> k 128))
             (set-fontset-font "fontset-default" k fontspec)))
     (get 'encode-windows-1251 'translation-table))))

Ognyan Kulev <address@hidden,fsa-bg.org,jabber.org}>
7D9F 66E6 68B7 A62B 0FCF  EB04 80BF 3A8C A252 9782

reply via email to

[Prev in Thread] Current Thread [Next in Thread]