Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #950 from sinkuu/buf_out
Browse files Browse the repository at this point in the history
toUTF16 should take buffer as out parameter
  • Loading branch information
DmitryOlshansky committed Sep 8, 2014
2 parents 0390e36 + 9c0e843 commit 25e5483
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rt/util/utf.d
Expand Up @@ -682,7 +682,7 @@ string toUTF8(in dchar[] s)

/* =================== Conversion to UTF16 ======================= */

wchar[] toUTF16(wchar[2] buf, dchar c)
wchar[] toUTF16(out wchar[2] buf, dchar c)
in
{
assert(isValidDchar(c));
Expand Down Expand Up @@ -896,4 +896,8 @@ unittest
assert(c == "he\U000BAAAAllo");
w = toUTF16(d);
assert(w == "he\U000BAAAAllo");

wchar[2] buf;
auto ret = toUTF16(buf, '\U000BAAAA');
assert(ret == "\U000BAAAA");
}

0 comments on commit 25e5483

Please sign in to comment.