We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 014982c commit 6c5f8a4Copy full SHA for 6c5f8a4
std/utf.d
@@ -3609,8 +3609,16 @@ template byUTF(C) if (isSomeChar!C)
3609
}
3610
else
3611
{
3612
- fill = cast(ushort)encode!(UseReplacementDchar.yes)(
3613
- buf, decodeFront!(UseReplacementDchar.yes)(r));
+ static if (is(RC == dchar))
+ {
3614
+ fill = cast(ushort) encode!(UseReplacementDchar.yes)(buf, c);
3615
+ r.popFront;
3616
+ }
3617
+ else
3618
3619
+ fill = cast(ushort) encode!(UseReplacementDchar.yes)(
3620
+ buf, decodeFront!(UseReplacementDchar.yes)(r));
3621
3622
3623
3624
return buf[pos];
0 commit comments