Does the NodeJS N-API have any concept or support for C++ wstring? I can't find entries for something like
Napi::WString
The documentation makes no mention of a WString. But wstring is commonly used on Windows APIs. I'm curious how it's typically handled?
Napi types match the internal V8 types - and there is only one internal string type - which happens to use UTF-16 encoding. There are multiple definitions for
Napi::String::Newand one of them expects achar16_t *input. If your encoding is the same - which is usually the case for 16 bit chars - then you don't need anything else. But still, take care becausewchardoes not specify an encoding - only a character size.