FLTK logo

Re: [fltk.coredev] RFC: Disable Visual Studio warning about

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: RFC: Disable Visual Studio warning about Greg Ercolano Feb 17, 2021  
 


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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.