Since nobody seems to have actually answered your question:
if you have a u8 string, here's how you decode (to the best of your ability) such a string in C++. (Spoiler: you use the C library.) (Double-spoiler: This doesn't work on MacOS because.... actually I don't know why they suck at this.)
https://github.com/soasis/text/blob/main/benchmarks/conversion_speed/source/standard_c.cpp#L290-L342