-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
This is a crazy one.
I pass Base64 strings like eyJuYW1lIjogIkphc29uIiwgImFnZSI6ICI0OCJ9
to JavaScript side.
Basically,
std::string text = "eyJuYW1lIjogIkphc29uIiwgImFnZSI6ICI0OCJ9";
// Call C-extern function
printSomething(text.c_str());
Now Javascript side try convert the pointer passed to JS function to UTF8 string using this way,
printSomething: async function(pText) {
let converted = UTF8ToString(pText);
console.log(converted)
}
But it returns an empty string as a result instead eyJuYW1lIjogIkphc29uIiwgImFnZSI6ICI0OCJ9
.
I've ran the Javascript debugger over UTF8ToString and I find that it returns "\u0001" so for naked eye it's an empty string..
Metadata
Metadata
Assignees
Labels
No labels