[Issue 391] New: .sort and .reverse break utf8 encoding

Derek Parnell derek at psyc.ward
Tue Oct 3 14:44:14 PDT 2006


On Tue, 03 Oct 2006 21:43:46 +0100, Stewart Gordon wrote:

> d-bugmail at puremagic.com wrote:
> <snip>
>> import std.utf;
>> import std.stdio;
>> void main()
>> {
>>     char[] a;
>>     a = "\u3026\u2021\u3061\n";
>>     writefln("plain");    validate(a);
>>     writefln("sorted");   validate(a.sort);  // fails
>>     writefln("reversed"); validate(a.reverse); // fails
>> }
> 
> AIUI sort and reverse are defined to sort/reverse the individual 
> elements of the array, rather than the Unicode characters that make up a 
> string.  But hmm....

Yes, I realize that but it makes Walter's statements that char[] is all we
need and we do not need a 'string' a bit weaker.

-- 
Derek Parnell
Melbourne, Australia
"Down with mediocrity!"



More information about the Digitalmars-d-bugs mailing list