digitalmars.D - toStringz for UTF-16
- Katayama Hirofumi MZ (1/1) Oct 12 2012 Why doesn't D have toStringz function for UTF-16 encoding?
- Jonathan M Davis (5/6) Oct 12 2012 It does. std.utf.toUTFz will do every combination of char type and const...
- Jacob Carlborg (5/8) Oct 13 2012 Shouldn't we deprecate "toUTF16z" if "toUTFz" can handle all cases that
- Andrej Mitrovic (6/9) Oct 13 2012 This was already proposed before, but it would break too much code.
- Jacob Carlborg (4/9) Oct 14 2012 Fair enough.
- Jonathan M Davis (4/5) Oct 12 2012 std.utf.toUTFz will do every combination of char type and constness. And...
- Katayama Hirofumi MZ (2/2) Oct 12 2012 Thanks.
Why doesn't D have toStringz function for UTF-16 encoding?
Oct 12 2012
On Saturday, October 13, 2012 01:58:15 Katayama Hirofumi MZ wrote:Why doesn't D have toStringz function for UTF-16 encoding?It does. std.utf.toUTFz will do every combination of char type and constness. And std.utf.toUTF16z will convert any string to a null-terminated const(wchar)*. - Jonathan M Davis
Oct 12 2012
On 2012-10-13 02:04, Jonathan M Davis wrote:It does. std.utf.toUTFz will do every combination of char type and constness. And std.utf.toUTF16z will convert any string to a null-terminated const(wchar)*.Shouldn't we deprecate "toUTF16z" if "toUTFz" can handle all cases that "toUTF16z" does? -- /Jacob Carlborg
Oct 13 2012
On 10/13/12, Jacob Carlborg <doob me.com> wrote:On 2012-10-13 02:04, Jonathan M Davis wrote: Shouldn't we deprecate "toUTF16z" if "toUTFz" can handle all cases that "toUTF16z" does?This was already proposed before, but it would break too much code. Anyway there's nothing wrong in having an alias that makes typing simpler, e.g. toUTF16z vs toUTF!(const(wchar)*). Phobos has many helper auto functions which make instantiating templates simpler, toUTF16z has that same kind of role.
Oct 13 2012
On 2012-10-13 15:45, Andrej Mitrovic wrote:This was already proposed before, but it would break too much code. Anyway there's nothing wrong in having an alias that makes typing simpler, e.g. toUTF16z vs toUTF!(const(wchar)*). Phobos has many helper auto functions which make instantiating templates simpler, toUTF16z has that same kind of role.Fair enough. -- /Jacob Carlborg
Oct 14 2012
On Saturday, October 13, 2012 01:58:15 Katayama Hirofumi MZ wrote:Why doesn't D have toStringz function for UTF-16 encoding?std.utf.toUTFz will do every combination of char type and constness. And std.utf.toUTF16z will convert any string to a null-terminated const(wchar)*. - Jonathan M Davis
Oct 12 2012
Thanks. ---- END OF THREAD ----
Oct 12 2012