[Haskell-cafe] Re: String vs ByteString

Tako Schotanus tako at codejive.org
Tue Aug 17 07:36:32 EDT 2010


On Tue, Aug 17, 2010 at 13:29, Ketil Malde <ketil at malde.org> wrote:

> Tako Schotanus <tako at codejive.org> writes:
>
> >> Just like Char is capable of encoding any valid Unicode codepoint.
>
> > Unless a Char in Haskell is 32 bits (or at least more than 16 bits) it
> con
> > NOT encode all Unicode points.
>
> And since it can encode (or rather, represent) any valid Unicode
> codepoint, it follows that it is 32 bits (and at least more than 16
> bits).
>
> :-)
>
> (Char is basically a 32bit value, limited valid Unicode code points, so
> it corresponds to UCS-4/UTF-32.)
>
>
Yeah, I tried looking it up but I could find the technical definition for
Char, but in the end I found that "maxBound" was "0x10FFFF" making it
basically 24 bits :)

I know for example that Java uses only 16 bits for its Chars and therefore
can NOT give you all Unicode code points with a single Char, with Strings
you can because of the extension points.

-Tako
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100817/840f07df/attachment.html


More information about the Haskell-Cafe mailing list