import std.algorithm.comparison : equal; import std.utf : byChar, byWchar; auto hello = RCString("你好"); assert(hello.by!char.equal("你好".byChar)); assert(hello.by!wchar.equal("你好".byWchar)); assert(hello.by!dchar.equal("你好"));
See Implementation