On Tuesday, 14 October 2014 at 19:56:29 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 14 Oct 2014 19:46:57 +0000
jicman via Digitalmars-d-learn
<[email protected]>
wrote:
char[] s = "ABCabc";
foreach (char c; s)
{
// how do I convert c to something an Unicode code? ie.
\u9999.
}
string res;
foreach (dchar ch; s) res ~= "\\u%04X".format(ch);
// here we have the result in res
note "dchar" instead of "char". with "dchar" foreach() does
utf-8
decoding (as 's' is in utf-8).
Thanks. This is a missing function in std.uni or std.string.
josé