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
>
> [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
#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
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::
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
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
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
--
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
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