Skip to content

Commit eae47bf

Browse files
allow format to accept utf16+32 c strings
1 parent d6a716f commit eae47bf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

source/numem/format.d

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@ private {
1111
static if(isStringable!T) {
1212

1313
return nstring(element.toString());
14-
} else static if (isSomeString!T) {
14+
} else static if (isSomeSafeString!T) {
1515

1616
return nstring(element);
17+
} else static if (isSomeCString!T) {
18+
19+
// First convert to a n*string
20+
// then, if needed convert it to a nstring.
21+
auto tmp = basic_string!(StringCharType!T)(element);
22+
static if (StringCharSize!T == 1)
23+
return tmp;
24+
else
25+
return nstring(tmp);
26+
1727
} else static if (isBasicType!T) {
1828

1929
return toString!T(element);

0 commit comments

Comments
 (0)