Windows/Mac file path using std::wstring

Windows/Mac file path using std::wstring

sophiadoan
Contributor Contributor
383 Views
1 Reply
Message 1 of 2

Windows/Mac file path using std::wstring

sophiadoan
Contributor
Contributor

Most API in Fusion use std::string such as sendInfoToHTML. How do we support directory paths that require std::wstring?

0 Likes
384 Views
1 Reply
Reply (1)
Message 2 of 2

BrianEkins
Mentor
Mentor

I didn't know the answer to this either but asked one of the Fusion API developers. Here's his response:

 

The API always deals in utf8 strings. You can convert to and from other standards as necessary with std::codecvt (or any other utility). Windows SDKs use utf16, so you could use std::codecvt_utf8_utf16 to convert back and forth with utf16 wide strings. Or use std::codecvt_utf8 if you need to go between utf32 (or ucs2).

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes