[Top][All Lists]

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

Re: Char code to Emacs string.

From: Eli Zaretskii
Subject: Re: Char code to Emacs string.
Date: Wed, 01 Jun 2011 09:12:02 -0400

> From: Oleksandr Gavenko <address@hidden>
> 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.

reply via email to

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