[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    local8Bit
From:       Stephan Kulow <coolo () kde ! org>
Date:       2001-05-30 7:54:54
[Download RAW message or body]

Hi!

I just figured local8Bit is fixed to what Qt figures from $LANG. Klocale sets 
the codec to the one used by KDE, but as local8Bit uses a static object the 
first call counts and that's in:

#0  QString::local8Bit (this=0xbffff5bc) at tools/qstring.cpp:14452
#1  0x40751c74 in locale_encoder (fileName=@0xbffff5bc) at tools/qfile.cpp:466
#2  0x40751cac in QFile::encodeName (fileName=@0xbffff5bc)
    at tools/qfile.cpp:496
#3  0x4074398b in QFile::open (this=0xbffff5ac, m=1)
    at tools/qfile_unix.cpp:212
#4  0x4078b1a8 in qt_init_internal (argcptr=0x405b62f0, argv=0xbffff88c,
    display=0x0) at kernel/qapplication_x11.cpp:1253
#5  0x4078bd75 in qt_init (argcptr=0x405b62f0, argv=0xbffff88c)
    at kernel/qapplication_x11.cpp:1489

So I see not many chances. 
1. create KLocale::local8Bit() which does the right thing and overwrite 
   locale_encoder using that function 
2. set LANG _before_ QApplication() is called, but the only code that runs in 
    typical KDE applications before the KApp constructor is KCmdlineoptions  
   and using that sounds wrong. 

Any other options? The way it's now makes local8Bit useless and as this KDE 
in russian useless unless you set LANG to the value used in kcontrol before 
you start KDE.

Greetings, Stephan

-- 
People in cars cause accidents. Accidents in cars cause people.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic