Does MLGetUTF8String() return a null-terminated string?

The C MathLink function MLGetUTF8String() returns a pointer to a UTF-8 string, the length of the string and the number of characters. UTF-8 is desgined in a way to be compatible with null-terminated strings, and it appears that this function does return a null-terminated string, but this is not explicitly documented.

Can I safely assume that MLGetUTF8String will always return a null-terminated string, or was it just an accident that in my test it appeared to return one? If would spare having to copy the whole string just to insert a ‘\0’ at the end.

Note: I actually received an answer to this [here from another user but I was hoping for some more ‘official’ reassurance, considering that this is undocumented. Or perhaps suggest that it be documented, if possible.](https://groups.google.com/d/msg/comp.soft-sys.math.mathematica/itzZDR2aOx0/Y94BOgFG1gEJ)

MLGetUTF8String() is not guaranteed to return a null-terminated string and one should not rely on that behavior. One should always copy the contents of a string returned
by MathLink into the applications own memory so that the library can free that resource as soon as possible.