digitalmars.D.learn - How to use encode and decode of std.utf
- solidstate1991 (2/2) Sep 09 2017 There's not much deep documentation about the functions, and I'm
- ag0aep6g (9/11) Sep 09 2017 toUTF16 can transcode from UTF-8. As linked there, byUTF!wchar does the
- Jonathan M Davis via Digitalmars-d-learn (5/16) Sep 09 2017 You can also just do to!wstring on a string, though I think that that ca...
There's not much deep documentation about the functions, and I'm interested if it can decode into UTF16 from UTF8.
Sep 09 2017
On 09/09/2017 11:54 PM, solidstate1991 wrote:There's not much deep documentation about the functions, and I'm interested if it can decode into UTF16 from UTF8.toUTF16 can transcode from UTF-8. As linked there, byUTF!wchar does the same but lazily. ---- import std.utf; string s8 = "foobär"; /* UTF-8 */ wstring s16_eager = s8.toUTF16; /* UTF-16 */ auto s16_lazy = s8.byUTF!wchar; /* also UTF-16, but a range */ ----
Sep 09 2017
On Sunday, September 10, 2017 00:05:42 ag0aep6g via Digitalmars-d-learn wrote:On 09/09/2017 11:54 PM, solidstate1991 wrote:You can also just do to!wstring on a string, though I think that that calls toUTF16 internally. - Jonathan M DavisThere's not much deep documentation about the functions, and I'm interested if it can decode into UTF16 from UTF8.toUTF16 can transcode from UTF-8. As linked there, byUTF!wchar does the same but lazily. ---- import std.utf; string s8 = "foobär"; /* UTF-8 */ wstring s16_eager = s8.toUTF16; /* UTF-16 */ auto s16_lazy = s8.byUTF!wchar; /* also UTF-16, but a range */ ----
Sep 09 2017