help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Char code to Emacs string.


From: Oleksandr Gavenko
Subject: Re: Char code to Emacs string.
Date: Thu, 02 Jun 2011 15:31:46 +0300
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

On 01.06.2011 16:12, Eli Zaretskii wrote:
From: Oleksandr Gavenko<gavenko@bifit.com.ua>
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.




reply via email to

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