[vlc-devel] Checking for __STDC_ISO_10646__ in Qt4 module

Juho Vähä-Herttua juhovh at iki.fi
Thu Nov 4 08:55:16 CET 2010


3.11.2010 23:43, Rémi Denis-Courmont kirjoitti:
> 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?
>    

I did, but I hurried too much and didn't have focus on the correct 
window, sorry about that...

>> 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.
>    

if (qtk >= 'A' && qtk <= 'Z') i_vlck = qtk+32;
else if (qtk >= 0xC0 && qtk <= 0xDE && qtk != 0xD7) i_vlck = qtk+32;
else i_vlck = qtk;

This seemed to return identical results for all values 0 <= qtk <= 255 
on my locale inside Qt4 module while VLC running. Looking at the latin1 
table, that was what I originally expected before my flawed tests. I 
didn't take into account that towlower actually uses the locale 
information to do the translation instead of some predefined BMP lookup 
table. Would this kind of fix be acceptable (except that it doesn't put 
pressure on upstream to fix it)?


Juho




More information about the vlc-devel mailing list