[Issue 4483] foreach over string or wstring, where element type not specified, does not support unicode

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 24 02:23:11 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=4483


Daniel Kozak <kozzi11 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kozzi11 at gmail.com


--- Comment #9 from Daniel Kozak <kozzi11 at gmail.com> 2014-01-24 02:22:51 PST ---
(In reply to comment #8)
> I'm very much opposed to this. The way it works now has been that way from the
> beginning, and an unknowably vast amount of code depends on it.
> 
> Furthermore, I don't like the inherent slowdowns it causes. Only rarely does
> one need decoded chars, the rest of the time working with bytes is fast and
> correct.

Yes, I agree with this. string is just an alias for immutable array of chars,
there is nothing special about it. (I am not happy with this, but this is
current situation)

What I really hate is this:

char[] a = cast(char[])"asdsad";
writeln(typeid(typeof(a.front))) // prints dchar instead char;

This is really unexpected behavior :(.

I think new special type lets call it `EncodeString` should be added.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list