t { import std.range; import std.utf; const str = "abc-ЭЮЯ"; const wlen = toUTF16(str).length; const dlen = walkLength(str); assert(wlen >= minLength!wchar(str) && wlen <= maxLength!wchar(str)); assert(dlen >= minLength!dchar(str) && dlen <= maxLength!dchar(str)
Returns minimum/maximum possible length of string conversion to another Unicode Transformation Format result.