http://d.puremagic.com/issues/show_bug.cgi?id=5265
Summary: std.array.back does not work correctly for wchar-based arrays Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: schvei...@yahoo.com --- Comment #0 from Steven Schveighoffer <schvei...@yahoo.com> 2010-11-24 05:11:09 PST --- In std.array, back() is the same for both char[] based and wchar[] based arrays, but wchar[] based arrays are encoded differently than char[] based ones. It appears the back() function works in most cases, but fails on a few. Here is an example (thank you to Stephan): import std.array; import std.conv; void main() { dchar c = cast(dchar) 0x10000; auto ws = to!wstring(c); assert(ws.length == 2); // decoded as surrogate pair assert(ws.back == c); // fails with decoding error } This should be added as a unit test, and back(wstring) should get its own implementation. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------