[vlc-devel] Checking for __STDC_ISO_10646__ in Qt4 module

Rémi Denis-Courmont remi at remlab.net
Wed Nov 3 22:43:09 CET 2010

Le mercredi 3 novembre 2010 22:36:50 Juho Vähä-Herttua, vous avez écrit :
> This means that towlower is only called for qtk values smaller or equal to
> 255. I wrote a small test to check for the functionality of towlower with
> these values:

Qt4 does not define any other meaningful character in its documented list of 
keys. They are other keys there, some of which are not supported by LibVLC at 
all. But I believe none are Unicode characters. Then again, I have not checked 

> #include <stdio.h>
> #include <wctype.h>
> #ifndef __STDC_ISO_10646__
> #error FIXME
> #endif
> main(i,c) {
>         for (i=0; i<256; i++) {
>                 c = (i >= 'A' && i <= 'Z') ? i+32 : i;
>                 if (towlower(i) != c) printf("mismatch: %d\n", i);
>         }
> }
> The result of this test was that it compiled fine on a linux machine and
> didn't print any output.

Yeah. With the POSIX locale, I sure hope it might print nothing. Did you 
actually even *test* the VLC code? Did you try to map the å, ö or ä keys on 
your Finnish-Swedish keyboard?

> To avoid any change in VLC functionality, I would therefore rewrite the
> original code as follows:
>     if( qtk <= 0xff )
>         /* VLC and X11 use lowercase whereas Qt uses uppercase */
>          i_vlck = (i >= 'A' && i <= 'Z') ? qtk+32 : qtk;

No way. This is broken.

Rémi Denis-Courmont

More information about the vlc-devel mailing list