bug-lilypond
[Top][All Lists]
Advanced

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

Re: wide-char is wide


From: Hans Aberg
Subject: Re: wide-char is wide
Date: Thu, 26 Mar 2009 09:57:49 +0100

On 26 Mar 2009, at 00:55, Trevor Daniels wrote:

The manual says that \char #65 produces the letter "A". Here, 65 is an ordinary integer. Which position number basis? The ASCII hexadecimal number for "A" is 41, in languages like C/C++ written as 0x41, and in Unicode U+0041. What is the decimal number? In decimal, 4*16+1 = 65. What is the representation in the computer? All ASCII characters are translated as binary numbers. Since the hexadecimal form is 41, 0x4 is binary 0100, and 0x1 is binary 0001, 0x41 is binary 01000001. So 0x41 is one 8-bit byte.

So the manual is a bit short: it should say that the number is a decimal integer representing the Unicode code point.

No, the argument to \char is a hex number.

No, the argument is an integer: Robin Bannister pointed out that Guile, which LilyPond calls, has syntax for different number basis:
  http://www.gnu.org/software/guile/manual/html_node/Number-Syntax.html

So when you have used it, you probably have written
  \char #x41
Right?

  Hans






reply via email to

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