From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: Re: Char code to Emacs string. Date: Thu, 02 Jun 2011 15:31:46 +0300 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1307018968 6529 80.91.229.12 (2 Jun 2011 12:49:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 2 Jun 2011 12:49:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 02 14:49:25 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QS7L1-0005OU-6S for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Jun 2011 14:49:23 +0200 Original-Received: from localhost ([::1]:48646 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS7Kz-0002VA-CF for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Jun 2011 08:49:21 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS747-00076q-68 for help-gnu-emacs@gnu.org; Thu, 02 Jun 2011 08:31:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QS745-0004G5-7B for help-gnu-emacs@gnu.org; Thu, 02 Jun 2011 08:31:55 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:35306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QS744-0004Fq-Nk for help-gnu-emacs@gnu.org; Thu, 02 Jun 2011 08:31:53 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QS742-0005Eh-KT for help-gnu-emacs@gnu.org; Thu, 02 Jun 2011 14:31:50 +0200 Original-Received: from 91.193.68.214 ([91.193.68.214]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Jun 2011 14:31:50 +0200 Original-Received: from gavenko by 91.193.68.214 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Jun 2011 14:31:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 91.193.68.214 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81276 Archived-At: On 01.06.2011 16:12, Eli Zaretskii wrote: >> From: Oleksandr Gavenko >> Date: Wed, 01 Jun 2011 10:59:29 +0300 >> >> This code not work because 'make-char' do not understand 'unicode' arg >> (which intended to print chars with it unicode code): >> >> (let (i (start ?\x1B6) (end ?\x1B7C)) >> (setq i start) >> (while (<= i end) >> (message "%s - %x" (make-char 'unicode i) i) >> (setq i (+ 1 i)) >> ) ) >> >> How I can get list of possible CHARSET for 'make-char' >> and how this code must be fixed to work properly? > > make-char is an obsolete function that makes no sense at all in > Unicode-based Emacs. Don't use it. And it wouldn't have helped you, > because it returns the numerical code point of the character. That's > because in Emacs, a character is just an integer, so every function > that _creates_ characters always returns an integer value. > > What you want is not the character, but its string representation. > That's what prin1-char is for. > Thanks for answer. I always have more generic question about string coding conversion. What if I have some bytes and know its charset/coding and want convert to Emacs string? I search for such functions and also how get list of coding names for they. Any point to existing code or ather help welcome. 'info elisp' take a few knowledge in this area.