Bug 24126 – toStringz does not support wchar and dchar

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2023-08-31T16:42:52Z
Last change time
2023-09-01T10:01:36Z
Assigned to
Adam Wilson
Creator
Adam Wilson

Comments

Comment #0 by flyboynw — 2023-08-31T16:42:52Z
The std.string.toStringz function currently only works with char strings and not strings of wchar or dchar.
Comment #1 by issues.dlang — 2023-09-01T10:01:36Z
std.utf.toUTFz handles the general case, allowing flexibility with regards to both constness and character width: https://dlang.org/phobos/std_utf.html#toUTFz