I want to develop an application on Linux. I want to use wstring beacuse, my application must support unicode, and I don't want to use UTF-8 strings.
On Windows, using wstring is very simple. beacuse any ANSI API is unicode. for example, there are two CreateProcess APIs, the first API is CreateProcessA, and the second API is CreateProcessW.
wstring app = L"C:\\test.exe";
CreateProcess
(
app.c_str(), // EASY!
....
);
But it seems that working with wstring on Linux is complicated! for example, there is an API on Linux called parport_open (This is just an example).
and I donβt know how to send my wstring to this API (or APIs like parport_open that take a string parameter).
wstring name = L"myname";
parport_open
(
0, // or a valid number. It is not important in this question.
name.c_str(), // Error: because type of this parameter is char* not wchat_t*
....
);
My question is: how can I use wstring in Linux API?
Note . I do not want to use UTF-8 strings.
thank