Relaxing the definition of isSomeString and isNarrowString

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 24 21:28:05 PDT 2014


On Mon, Aug 25, 2014 at 02:40:19AM +0000, Vladimir Panteleev via Digitalmars-d wrote:
> On Monday, 25 August 2014 at 01:31:35 UTC, H. S. Teoh via Digitalmars-d
> wrote:
> >In D, an array of char, wchar, or dchar always means a Unicode
> >encoding.  Non-Unicode encodings should be represented as ubyte[]
> >(resp. ushort[] or ulong[], if such exist) instead.
> 
> This doesn't get you far in practice if you want to actually operate
> on the text.

We need a major revamp of std.encoding.

I envision it to use CTFE and template magic to make it possible to
statically optimize manipulating strings of any supported encoding via
statically-wrapped non-UTF string types, as well as dynamic types for
dealing with runtime-decided encodings. If possible, I envision being
able to use std.conv.to to convert between encodings via compile-time
customization hooks for to!().


T

-- 
Век живи - век учись. А дураком помрёшь.


More information about the Digitalmars-d mailing list