JSValue with std::wstring or hstring possible? #9399
-
Hi there, I've recently run into a Problem with react-native-fs windows implementation and paths/filenames which contain umlaute/accentuated character as these were passed std::string from JS --> Native. I've created a PR (wwimmo/react-native-fs#9) which changed most of the methods from receiving a After a quick look I haven't found a way to get a value out of the JSValueObject as wstring/hstring, it only seems to support Is this not possible? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
JSValue::AsString
gives back the UTF-8std::string
, thenwinrt::to_hstring
is supposed to convert that to a UCS-2 string; however in your PR you are creating thestd::filesystem::path
object from the UTF8 bytes instead of converting the UTF8 string to wstring then creating thepath
object with thewstring
, can you try that?