From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ognyan Kulev Newsgroups: gmane.emacs.devel Subject: Re: TUTORIAL.bg and windows-1251 Date: Wed, 07 Jan 2004 18:22:33 +0200 Organization: Faculty of Mathematics and Informatics, University of Sofia Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <3FFC3249.3010501@fmi.uni-sofia.bg> References: <3FB52552.6090302@fmi.uni-sofia.bg> <200311170721.QAA11735@etlken.m17n.org> <3FBA3F81.4010602@fmi.uni-sofia.bg> <200311242355.IAA24563@etlken.m17n.org> <3FC45367.6070504@fmi.uni-sofia.bg> <200311260747.QAA27236@etlken.m17n.org> <3FC464C2.7010504@fmi.uni-sofia.bg> <200311261317.WAA27673@etlken.m17n.org> <200312030834.RAA03004@etlken.m17n.org> <3FCF60C9.8060009@fmi.uni-sofia.bg> <200312042328.IAA06933@etlken.m17n.org> <3FF2E5DF.4090906@fmi.uni-sofia.bg> <200401050414.NAA00014@etlken.m17n.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1073492916 1617 80.91.224.253 (7 Jan 2004 16:28:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Jan 2004 16:28:36 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jan 07 17:28:30 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AeGXm-0007TL-00 for ; Wed, 07 Jan 2004 17:28:30 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AeGXm-0000g6-00 for ; Wed, 07 Jan 2004 17:28:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AeHTB-0002GB-2G for emacs-devel@quimby.gnus.org; Wed, 07 Jan 2004 12:27:49 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AeHSB-0001yS-H6 for emacs-devel@gnu.org; Wed, 07 Jan 2004 12:26:47 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AeHRX-0001e3-KS for emacs-devel@gnu.org; Wed, 07 Jan 2004 12:26:38 -0500 Original-Received: from [62.44.101.6] (helo=ds.fmi.uni-sofia.bg) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AeHNR-0008JQ-7P for emacs-devel@gnu.org; Wed, 07 Jan 2004 12:21:54 -0500 Original-Received: from fmi.uni-sofia.bg (magid.fmi.uni-sofia.bg [62.44.101.57]) by ds.fmi.uni-sofia.bg (iPlanet Messaging Server 5.2 (built Feb 21 2002)) with ESMTP id for emacs-devel@gnu.org; Wed, 07 Jan 2004 19:17:39 +0200 (E. Europe Standard Time) In-reply-to: <200401050414.NAA00014@etlken.m17n.org> Original-To: Kenichi Handa X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031221 Thunderbird/0.4 X-Enigmail-Version: 0.82.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19079 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19079 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. > > original:\x5144F > 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 > it? 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"))) (map-char-table #'(lambda (k v) (if (and v (> k 128)) (set-fontset-font "fontset-default" k fontspec))) (get 'encode-windows-1251 'translation-table)))) Regards -- Ognyan Kulev 7D9F 66E6 68B7 A62B 0FCF EB04 80BF 3A8C A252 9782