From my understanding the fromPtr and fromPtr0 functions do not do any validation of the source array contents, and since Text values are internally UTF-8 arrays, if the source array passed to these functions is not valid UTF-8, then bad things can happen somewhere else in the code. Despite this, neither function explicitly says in the docs that no validation is performed nor that valid UTF-8 is expected, and both functions are listed under the Safe conversion functions section.
Is my understanding of the behavior of these functions correct? And if so, should the documentation be updated to make the behavior of these functions and the potential for errors more explicit?
From my understanding the
fromPtrandfromPtr0functions do not do any validation of the source array contents, and sinceTextvalues are internally UTF-8 arrays, if the source array passed to these functions is not valid UTF-8, then bad things can happen somewhere else in the code. Despite this, neither function explicitly says in the docs that no validation is performed nor that valid UTF-8 is expected, and both functions are listed under theSafe conversion functionssection.Is my understanding of the behavior of these functions correct? And if so, should the documentation be updated to make the behavior of these functions and the potential for errors more explicit?