D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10191 - std.array.array and Unicode strings
Summary: std.array.array and Unicode strings
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-28 03:27 UTC by bearophile_hugs
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2013-05-28 03:27:40 UTC
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
Comment 1 basile-z 2015-11-21 13:45:39 UTC
2.069 ok