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 Bill Spitzak Feb 17, 2021  
 
It looks like fl_open and fl_fopen already exist in fltk

On Wed, Feb 17, 2021 at 2:44 PM Albrecht Schlosser <AlbrechtS.fltk@online.de> wrote:
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.

--
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/CAL-8oAhqjWZVu20F39Lu27hb65zO%2B6zJWAGcAkN6smei%3D5dmpA%40mail.gmail.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'.