I tested this on sdk-1.30.0-64bit. I wrote a sample program below:
#include <stdio.h>
#include <string>
#include <clocale>
using namespace std;
int main(int argc, const char * argv[])
{
// insert code here...
printf("Hello, World!\n");
char* locale = setlocale(LC_ALL, NULL);
wchar_t smallE = L'é';
wchar_t bigE = towupper(smallE);
return 0;
}
I tested this on XCode and the result is the same as Visual Studio. I then
ran the code against sdk 1.34.1 and emscripten-tag-1.34.3-64bit and both
versions return the uppercase É which differs from both XCode and Visual
Studio.
On Thursday, July 30, 2015 at 2:43:13 AM UTC+8, Alon Zakai wrote:
>
> On which branch do you see the problem? On incoming (1.34.3) we now use
> more musl code for locale stuff, so it might be different there.
>
>
> On Wed, Jul 29, 2015 at 6:36 AM, awt <[email protected] <javascript:>>
> wrote:
>
>> Hi,
>>
>> I was trying to convert the Latin small letter e with acute (é) into
>> uppercase with the default 'C' locale using the following code:
>>
>> std::setlocale <http://en.cppreference.com/w/cpp/locale/setlocale>(LC_ALL
>> <http://en.cppreference.com/w/cpp/locale/LC_categories>, "C");
>>
>> wchar_t upperChar = std::towupper(L'é')
>>
>>
>> Using Visual Studio, I get back the lowercase character é but with
>> Emscripten, I get the uppercase É when I inspect the hex value of upperChar.
>> This comes as a surprise to me because my understanding is that the default
>> 'C' locale does not support extended ASCII so the Visual Studio behaviour
>> seems to be correct for this case. Is my understanding correct and how did
>> Emscripten manage to do the uppercase conversion even though the locale is
>> still the default 'C' locale? Thanks.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.