may be std.string.representation() may help?
https://dlang.org/phobos/std_string.html#.representation

byteSize = representation(myString).length;

Reply via email to