|
|
On 2/17/21 11:29 PM Greg Ercolano wrote:
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;
}
Ah, yes, L"./UTF8-作藩于外/foo/foo.txt" is what I expected.
While that worked with mingw, it didn't with VS for some reason,
not sure why.
Neither do I. And I won't try!
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.
Maybe you need to define "Unicode" (how exactly I do not know). It's
always a mystery...
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..
I can do it and I can also test it on my systems. There are enough
examples like fl_access() to show how to do it (assuming fl_access() is
doing it right).
--
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/08dfb608-7a77-98aa-5e5b-ffc3eb4bda53%40online.de.
[ Direct Link to Message ] | |
|
| |