[Issue 10191] New: std.array.array and Unicode strings
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue May 28 03:27:41 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10191
Summary: std.array.array and Unicode strings
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2013-05-28 03:27:40 PDT ---
import std.stdio: writeln;
import std.algorithm: map;
import std.array: array;
void main() {
string a = "\u03A9\u03A9ab";
a.map!(a => "<"d ~ a ~ ">"d).writeln;
a.map!(a => "<"d ~ a ~ ">"d).array.writeln;
}
Prints (dmd 2.063beta7):
["<Omega>", "<Omega>", "<a>", "<b>"]
["<Omega>", "<Omega>", "<a>", "<b>", "", ""]
Expected output:
["<Omega>", "<Omega>", "<a>", "<b>"]
["<Omega>", "<Omega>", "<a>", "<b>"]
Found by Timothee Cour:
http://forum.dlang.org/post/mailman.301.1369735563.13711.digitalmars-d-learn@puremagic.com
--
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