[Haskell-i18n] Unicode in source

Glynn Clements glynn.clements@virgin.net
Thu, 22 Aug 2002 20:08:54 +0100


Sven Moritz Hallberg wrote:

> > The other interpretation is that all glyphs have widths which are an
> > integral number of "columns". Western (latin, cyrillic, Greek)
> > characters are a single column wide, while CJK characters are
> > typically two columns wide. The (Unix98) wcwidth() function can be
> > used to obtain the width (in columns) of a given wide character
> > (wchar_t) in the current locale.
> 
> I see, I wasn't aware of this, thanks for pointing it out. In this case,
> we should get some way of obtaining the width in columns of a Char in
> Haskell and let the layout rule talk about columns, correct?

I would think so. Although it might be preferable to simply require
line breaks, so that you only need to deal with spaces.

My suspicion is that the existing layout rules were decided with an
implicit assumption of "one character equals one column". If that
ceases to be the case, maybe the decision should be revisited.

-- 
Glynn Clements <glynn.clements@virgin.net>