[Issue 10203] std.string.toUpperInPlace is... not in place

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 21 13:58:21 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10203


Dmitry Olshansky <dmitry.olsh at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh at gmail.com


--- Comment #4 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2013-09-21 13:58:19 PDT ---
(In reply to comment #3)
> Wait, this example is wrong, corrected as:
> 
> take the string "aİ"
> auto a = "\x61\xC4\xB0";

auto a = "\x61\xC4\xB0".dup;

> auto b = a;
> toLowerInPlace(a);
> 
> //Now:
> //a == "\x61\x69"
> //b == "\x61\x69\xB0" Oops: Trailing code unit :/
> 
> Sorry.

I belive we now should have solid treatment of toUpper/toLower (pending a
bugfix in the works).

For me this gives now:

//a == 61  69  CC  87
//b == 61  C4  B0

i.e. toLowerInPlace fails to do this in place because resulting length
increases.
Should it try to extend if a.capacity allows it? (I bet it has about 15 bytes
of storage)

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


More information about the Digitalmars-d-bugs mailing list