2015-06-29 19:16 GMT+02:00 <p...@arbolone.ca>:

>   The standard C++ has major, and I mean MAJOR draw-back!!
> It cannot handle any other stream format that ASCII. 1988 standards in
> 2015? I cannot believe it!!
> I am sure that there are 3rd or 4th party libraries that can handle this
> issue, but than again, that is that... a 3rd || 4th party library.
> I am sure that the Win64 API has a way to handle this, if not, those guys
> at boost seem to be very smart and provably have solved the problem in a
> way that is portable.
>
> Thanks for the help Ruben.
>

Well, what you're saying isn't entirely true, although the C++ Standard
library is indeed somewhat archaic in some aspects.
Let me set all this straight:
1. C++ nor any standard algorithm/function/class/...  (except of course the
locale related things) has no idea about character encoding whatsoever.
This means that any C++ iostream or string (be it with char or wchar_t) can
handle unicode just fine; it just doesn't do anything for you. Which might
be the same as saying it doesn't handle it at all. Well, the standard
classes are certainly not useless for unicode (nor do they prevent you from
using them for this purpose). Just not very useful...
2. This missing function (open an ifstream with a "Windows native" wchar_t
pathname) is stupid for two reasons: a) Windows is stupid in not
implementing a UTF-8 interface to its C and C++ standard library. All other
(modern) OSes work just fine with the 8-bit char and UTF-8. And b) C++ is
stupid in not making things easier. Work is being done in the form of the
Filesystem library that has been implemented in Boost (mostly like the
proposal) and the most recent Visual Studio 2015 (VS2013 has Filesystem v2,
which is slightly different).
3. There is no such thing as the Win64 API. It's still the Win32 API. And
yes, these C-style functions can handle all of this just fine, if you use
the proper encodings yourself. (small footnote: a valid Win32 filename is
not per se a valid UTF-16 string, but the reverse is true. And as far as I
know, the Unicode normalization isn't specified, so it's a can of worms any
way you want to put it)
4. Boost indeed has the aforementioned Filesystem library, which gives you
an interface to interact with files and filenames in a portable way.
5. There are only 3rd party (not even Boost) Unicode solutions. Make sure
you really need this before going into this. Full Unicode correctness is
expensive and hard.
6. wchar_t does not solve the unicode problem. It has the exact same
drawbacks UTF-8 has. UTF-32 has most of those drawbacks as well. Unicode is
hard.

Yes C++ sucks. You haven't even seen half of it. It is also quite good at
doing things you didn't know it could do.
Enjoy learning it, think about platform compatibility before you start
writing code.
Compile with several compilers.
st don't mind MSVC too much, it tends to not get C++ well, although the
newest versions are significant improvements with each step.

Cheers,

Ruben


>  *From:* p...@arbolone.ca
> *Sent:* Monday, June 29, 2015 5:20 AM
> *To:* mingw-w64-public@lists.sourceforge.net
> *Subject:* [Mingw-w64-public] no function
> forstd::ifstream<wchar_t>::open(const wchar_t*)?
>
>   Nice, thank you, I took your advice. I have now modify the code. I have
> other problems, though.
> This code:
> *std::wifstream infile;*
> *infile.open( getFileName().c_str() );*
>
> error: no matching function for call to
> 'std::basic_ifstream<wchar_t>::open(const wchar_t*)'
>
>
> I found this discussion
>
> http://stackoverflow.com/questions/821873/how-to-open-an-stdfstream-ofstream-or-ifstream-with-a-unicode-filename
>
> It is a bit old, but I think it's still concurrent with today's reality
> and although the answers are very much correct I am left with the same
> question as the OP -> are there no any options if MinGw compiler is used?
>
>
> I have changed the subject of this email to better reflect my predicament
>
>  *From:* Ruben Van Boxem <vanboxem.ru...@gmail.com>
> *Sent:* Monday, June 29, 2015 4:10 AM
> *To:* mingw-w64-public@lists.sourceforge.net
> *Subject:* Re: [Mingw-w64-public] throw(...) in MinGW
>
>   2015-06-29 9:54 GMT+02:00 <p...@arbolone.ca>:
>
>>   Thanks Ruben for the help.
>> To answer your question, yes, I am.
>> I was also using -std=gnu++14. However, I am now compiling only with
>> –std::c++11, but to no avail. [image: Sad smile]
>>
>
> This is a microsoft extension, as Clang informs us:
> http://coliru.stacked-crooked.com/a/49f77148f1e54ba7
>
> There is probably no way to convert this, other than to just remove it.
> Reading the Microsoft documentation
> <https://msdn.microsoft.com/en-us/library/vstudio/wfa0edys.aspx>, it
> seems all this construct does is inform the compiler the function in
> question can throw an exception.
> That sounds quite useless to me IMHO.
> Just remove it, or ifdef a THROWS macro or some such.
>
> Cheers,
>
> Ruben
>
>
>>
>>  *From:* Ruben Van Boxem <vanboxem.ru...@gmail.com>
>> *Sent:* Monday, June 29, 2015 2:27 AM
>> *To:* mingw-w64-public@lists.sourceforge.net
>> *Subject:* Re: [Mingw-w64-public] throw(...) in MinGW
>>
>>
>> Op 29-jun.-2015 07:32 schreef <p...@arbolone.ca>:
>> >
>> > In VS2013, I declare the member functions like this:
>> > void setString(const std::wstring& _str) throw(...);
>> >
>> > But now that I am switching to MinGW, I get a complain from the
>> compiler saying:
>> > error: expected type-specifier before '...' token
>> > throw(...) {
>> >
>> > How can I fix this problem?
>>
>> Are you compiling in C++11 mode? Add -std=c++11 to your commandline
>> invocation.
>>
>> Ruben
>>
>> >
>> > Thanks
>> >
>> >
>> > ________________________________
>> >
>> > This email has been checked for viruses by Avast antivirus software.
>> > www.avast.com
>> >
>> >
>> >
>> >
>> ------------------------------------------------------------------------------
>> > Monitor 25 network devices or servers for free with OpManager!
>> > OpManager is web-based network management software that monitors
>> > network devices and physical & virtual servers, alerts via email & sms
>> > for fault. Monitor 25 devices for free with no restriction. Download now
>> > http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
>> > _______________________________________________
>> > Mingw-w64-public mailing list
>> > Mingw-w64-public@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>> >
>> ------------------------------
>>
>> ------------------------------------------------------------------------------
>> Monitor 25 network devices or servers for free with OpManager!
>> OpManager is web-based network management software that monitors
>> network devices and physical & virtual servers, alerts via email & sms
>> for fault. Monitor 25 devices for free with no restriction. Download now
>> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
>> ------------------------------
>> _______________________________________________
>> Mingw-w64-public mailing list
>> Mingw-w64-public@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>
>>
>> ------------------------------
>>   [image: Avast logo] <http://www.avast.com/>
>>
>> This email has been checked for viruses by Avast antivirus software.
>> www.avast.com
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Monitor 25 network devices or servers for free with OpManager!
>> OpManager is web-based network management software that monitors
>> network devices and physical & virtual servers, alerts via email & sms
>> for fault. Monitor 25 devices for free with no restriction. Download now
>> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
>> _______________________________________________
>> Mingw-w64-public mailing list
>> Mingw-w64-public@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>>
>>
>
> ------------------------------
>
> ------------------------------------------------------------------------------
> Monitor 25 network devices or servers for free with OpManager!
> OpManager is web-based network management software that monitors
> network devices and physical & virtual servers, alerts via email & sms
> for fault. Monitor 25 devices for free with no restriction. Download now
> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
>
> ------------------------------
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
>
> ------------------------------
>   [image: Avast logo] <http://www.avast.com/>
>
> This email has been checked for viruses by Avast antivirus software.
> www.avast.com
>
>  ------------------------------
>
> ------------------------------------------------------------------------------
> Monitor 25 network devices or servers for free with OpManager!
> OpManager is web-based network management software that monitors
> network devices and physical & virtual servers, alerts via email & sms
> for fault. Monitor 25 devices for free with no restriction. Download now
> http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
>
> ------------------------------
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
>
> ------------------------------
>   [image: Avast logo] <http://www.avast.com/>
>
> This email has been checked for viruses by Avast antivirus software.
> www.avast.com
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to