I have just been reading through the Haskell report to refresh my memory of the language. I was surprised to see this: The character type Char is an enumeration and consists of 16 bit values, conforming to the Unicode standard [10]. Unicode uses 24-bit values to identify characters. -- Colin Paul Adams Preston Lancashire
At 12:20 PM -0500 9/29/01, Colin Paul Adams wrote:
I have just been reading through the Haskell report to refresh my memory of the language. I was surprised to see this:
The character type Char is an enumeration and consists of 16 bit values, conforming to the Unicode standard [10].
Unicode uses 24-bit values to identify characters.
According to the official Unicode web site [0], The Unicode Standard defines three encoding forms that allow the same data to be transmitted in a byte, word or double word oriented format (i.e. in 8, 16 or 32-bits per code unit). [0] http://www.unicode.org/unicode/standard/principles.html ------------------------------------------------------------------ Hamilton Richards, PhD Department of Computer Sciences Senior Lecturer Mail Code C0500 512-471-9525 The University of Texas at Austin Taylor Hall 5.138 Austin, Texas 78712-1188 ham@cs.utexas.edu hrichrds@swbell.net ------------------------------------------------------------------
Hamilton Richards
At 12:20 PM -0500 9/29/01, Colin Paul Adams wrote:
I have just been reading through the Haskell report to refresh my memory of the language. I was surprised to see this:
The character type Char is an enumeration and consists of 16 bit values, conforming to the Unicode standard [10].
Unicode uses 24-bit values to identify characters.
According to the official Unicode web site [0],
The Unicode Standard defines three encoding forms that allow the same data to be transmitted in a byte, word or double word oriented format (i.e. in 8, 16 or 32-bits per code unit).
You have to distinguish between encodings (you refer to utf-8, utf-16 and utf-32) and the unicode (iso-10646) tables of codepoints themselves. 16 bits is enough to describe the Basic Multilingual Plane and I think 24 bits all the currently defined extended planes. So I guess the report just refers to the BMP. Jens
"Jens" == Jens Petersen
writes:
Jens> 16 bits is enough to describe the Basic Multilingual Plane Jens> and I think 24 bits all the currently defined extended Jens> planes. So I guess the report just refers to the BMP. I guess it does, and I think back in 1998 that may still have been identical to Unicode. But the revision of the report that SPJ is preparing is unchanged in this respect, and so is factually inaccurate. I think it should either be amended to mention the BMP subset of Unicode, or, better, change the reference from 16-bit to 24-bit. -- Colin Paul Adams Preston Lancashire
Colin Paul Adams
"Jens" == Jens Petersen
writes: Jens> 16 bits is enough to describe the Basic Multilingual Plane Jens> and I think 24 bits all the currently defined extended Jens> planes. So I guess the report just refers to the BMP.
I guess it does, and I think back in 1998 that may still have been identical to Unicode. But the revision of the report that SPJ is preparing is unchanged in this respect, and so is factually inaccurate. I think it should either be amended to mention the BMP subset of Unicode, or, better, change the reference from 16-bit to 24-bit.
Actually ISO 10646 defines formally a 31-bit character set. [1] Is it still possible to update the latest revision of the Haskell 98 report to this effect? (There was some unicode discussion earlier, about upper and lower case if I remember correctly, but I am surprised noone has raised this point again.) Jens ps We need better unicode support in the implementations too. At least ghc-5 has 31 bit Char's now! Hurrah! Footnotes: [1] http://www.cl.cam.ac.uk/~mgk25/unicode.html
participants (3)
-
Colin Paul Adams -
Hamilton Richards -
Jens Petersen