|
|
On 2/17/21 2:12 PM, Albrecht Schlosser
wrote:
On
2/17/21 10:43 PM Greg Ercolano wrote:
I was able to get _wopen() to work in
mingw by modifying that program to use a wchar_t string,
How? Did you convert the UTF-8 string or how did you provide a
wchar_t string? Which encoding?
Maybe with L"string" syntax? Yes, that would be UTF-16 encoded and
work with _wopen().
I used this:
// Assumes cwd contains the UTF8-???? subdirectory
// UTF8 -> WIDECHAR
wchar_t wcfilename[] = L"./UTF8-作藩于外/foo/foo.txt";
if ( (fd = _wopen(wcfilename, O_RDONLY)) == -1 ) { //
Visual Studio wide char open()
printf("_wopen() failed\n");
return 1;
}
While that worked with mingw, it didn't with VS for some reason,
not sure why.
Might have been a missing compiler flag; I just used "CL /TP
foo.cxx" to build it,
but perhaps VS needs some coercion to comprehend inline utf8.
I don't think I'm going to take on creating the wrapper, as I
don't know enough
about the ins and outs of all the details to make it do the
right thing at the right time..
--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/3412195f-276f-4224-4d0f-28aa4e809caf%40seriss.com.
[ Direct Link to Message ] | |
|
| |