Re: [Mingw-w64-public] wchar_t vs char

2015-06-30 Thread Greg Jung
In my programming instead of "multibytetowide" conversion preparing for a windows API inside #ifdef UNICODE blocks, I just call the ANSI mode of the function with ascii c-strings passed in, and let microsoft perform the A->W conversions. When does this simpler approach break? - Only use Win3

Re: [Mingw-w64-public] toUpper()

2015-06-30 Thread Alexandre Pereira Nunes
> > [cut] > This may also help in future: http://lmgtfy.com/?q=c%2B%2B+toupper > > ROTFL! I didn't know that one. As for std::toupper, IIRC there's an override which takes a locale argument. But I'm not sure mingw-w64 support locales other than C in that case. Last time I checked libstdc++ didn't

Re: [Mingw-w64-public] toUpper()

2015-06-30 Thread Riot
#include #include std::string str = "Hello World"; std::transform(str.begin(), str.end(), str.begin(), std::toupper); See also: http://www.cplusplus.com/reference/locale/toupper/ This may also help in future: http://lmgtfy.com/?q=c%2B%2B+toupper -Riot On 30 June 2015 at 23:5

[Mingw-w64-public] toUpper()

2015-06-30 Thread papa
I would like to write a function to capitalize letters, say... std::wstring toUpper(const std::wstring wstr){ for ( auto it = wstr.begin(); it != wstr.end(); ++it){ global_wapstr.append(std::towupper(&it)); } } This doesn’t work, but doesn’t the standard already have something like std::

Re: [Mingw-w64-public] wchar_t vs char

2015-06-30 Thread Alexandre Pereira Nunes
Grasp this sentence: implementation dependent. wchar_t is wide char, it's made to imply that each representable character can take more than one byte to encode a character. It was created before utf8 got mainstream. And, as there were competing encodings (UCS-2 fixed length vs what ended up being

Re: [Mingw-w64-public] wchar_t vs char

2015-06-30 Thread LRN
On 30.06.2015 19:44, p...@arbolone.ca wrote: > I have been reading that wchat_t, and therefore wstring, is neither UTF-8 nor > a UTF-16 character set. So, what is wstring good for then? Whether it's UTF-16 or UCS-2 depends on the implementation of the library that handles wstring. Sources, which

[Mingw-w64-public] wchar_t vs char

2015-06-30 Thread papa
I have been reading that wchat_t, and therefore wstring, is neither UTF-8 nor a UTF-16 character set. So, what is wstring good for then? --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com --

Re: [Mingw-w64-public] More porting problems :(

2015-06-30 Thread Alexandre Pereira Nunes
Consider this: windows is the alien os. Nowadays most operating systems has a unix core. Even apple went in that direction. Android, while having an abstract API, is also unix underneath. Gnu development tools (GCC, Binutils, autotools, etc.) was developed on unix flavors for decades now. As they

Re: [Mingw-w64-public] More porting problems :(

2015-06-30 Thread papa
Thanks for the help Alexandre. Look man, it could not have at a better time; porting the code from VC++ to g++ has not been a easy thing for me, I am so used to the flexibility of VS that now that I am using the actual C++ standard I realize the facilities and traps provided Microsoft. The last