Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
A version of UTF8ArrayToString that takes a length instead of a null-terminated string #7029
I was in a situation where I needed to be able to get UTF-8 strings with a known length and embedded NUL bytes from C. Since it didn't seem to be supported by the Emscripten libs, and I didn't want to patch them at the time, I wrote my own version of UTF8ArrayToString - but perhaps this can be integrated.
The code is at https://github.com/haukex/emperl5/blob/emperl_v5.28.0/common_preamble.js and the use is shown in https://github.com/haukex/emperl5/blob/emperl_v5.28.0/ext/WebPerl/WebPerl.xs#L42