Making all strings UTF ranges has some risk of WTF

Chad J chadjoan at __spam.is.bad__gmail.com
Thu Feb 4 03:57:36 PST 2010


Michel Fortin wrote:
> ...
> 
> As for .length, I'll say that removing this property would make it hard
> to write low-level code. For instance, if I copy a string into a buffer,
> I need to know the length in bytes (array.length * sizeof(array[0])),
> not the number of characters. So it doesn't make much sense to disable
> .length.
> 
> ...
> 

This would be under the condition that there is another property that
does the same (or similar) thing.  It's the part where he said, "and
define a different name for that".

You could also just reinterpret them as byte[] or ubyte[].  Then they
will behave in a low level way.  No surprises.



More information about the Digitalmars-d mailing list