On Saturday, 27 November 2021 at 13:54:11 UTC, Coder wrote:
My application is receiving data over a socket as immutable(ubyte)[]. How to validate them and transform them to utf8 string? What is the best way?
If they're already supposed to be utf8, just cast it to char[] then you can call std.utf.validate on it if you want and idup it into a string to keep.
If it is some other encoding... then it depends on what encoding.
