Proposed Phobos equivalent of wcswidth()

Jonathan M Davis newsgroup.d at jmdavisprog.com
Mon Jan 15 18:54:19 UTC 2018


On Monday, January 15, 2018 10:37:14 H. S. Teoh via Digitalmars-d wrote:
> On Mon, Jan 15, 2018 at 06:20:16PM +0000, Jack Stouffer via Digitalmars-d 
wrote:
> > On Monday, 15 January 2018 at 17:32:40 UTC, H. S. Teoh wrote:
> > > On Mon, Jan 15, 2018 at 02:14:56PM +0000, Simen Kjærås via
> > > Digitalmars-d
> > >
> > > wrote:
> > > > On Monday, 15 January 2018 at 13:34:09 UTC, Jack Stouffer wrote:
> > > > > std.utf.displayWidth
> > > >
> > > > +1
> > >
> > > [...]
> > >
> > > Why std.utf rather than std.uni, though?
> >
> > The way I understand it is that std.uni is (supposed to be) for
> > functions on individual unicode units (be they code units/points or
> > graphemes) and std.utf is for functions which handle operating on
> > unicode strings.
>
> Are you sure?  I thought std.utf was specifically dealing with UTF-*
> encodings, i.e., code units and conversions to/from code points, and
> std.uni was supposed to be for implementing Unicode algorithms and
> Unicode compliance in general, i.e., stuff that works at the code point
> level.

Your understanding of the division more or less matches mine, though I'm not
sure that the line is entirely clearcut. I would definitely think that
std.uni was the more appropriate place for such a function.

- Jonathan M Davis




More information about the Digitalmars-d mailing list