To show or not to show french accents
Jon Fairbairn
Jon.Fairbairn at cl.cam.ac.uk
Thu Dec 18 17:40:59 EST 2003
On 2003-12-18 at 16:40+0100 francis.girard at free.fr wrote:
> Good evening,
>
> OK. I don't know Haskell enough to argue.
>
> But I can't resist pointing out that reading a single byte
> having the value 233 (that is 'é')
The problem is that if you are reading single bytes, 233 is
not necessarily é. It might be 'shch' if you are in Russia,
or iota if you are in Greece. While it's (almost) completely
reasonable to expect 233 to display as é in Western Europe,
it's completely unreasonable to hold that expectation across
borders.
> is certainly simpler than reading the four characters
> "\233", parse it, and translate it into a single byte
but it isn't a single byte internally. Indeed, if you are in
Russia you could reasonably expect reading a single byte 233
to be converted to the internal code 1257 (if I got the
arithmetic right). Since Haskell specifies unicode, if you
are operating in a Russian locale that's what ought to
happen.
What I don't understand is why you want show for this. As I
mentioned earlier, to output strings and get accented
characters, all you have to do is to output the string with
putStr, and voilà, les signes diacritiques.
Jón
--
Jón Fairbairn Jon.Fairbairn at cl.cam.ac.uk
More information about the Glasgow-haskell-users
mailing list