[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: To make your program work well with non-Latin1 letters,
From: Woohyun JANG <louis () mizi ! co ! kr>
Date: 1999-06-09 3:50:18
[Download RAW message or body]
I modified a few programs to work well with Korean letters. and then I found
a common problem that broke Korean(I think it is similar to other letters that
use 8bit.) letters. :(
1. convert QString to char *.
As warwick said before, If you use it once, it's like sticking fork
into someone's eye(who use a non-Latin1 letters)
Use QString itself. If you have to convert QString to char *, use
QString::local8Bit() function like the following.
(If you are sure there isn't any 8bit character in string, you don't
need to use QString::local8Bit())
QString a;
...
char *temp;
temp=(char *)a.local8Bit();
2. convert char * to QString.
QString::QString(char *, ...) works well only with Latin1 letters.
QString::fromLocal8Bit(char *) works well with Latin1 and non-Latin1
letters. (It depends on a current locale)
char *buf = "some string";
QString qstr = QString::fromLocal8Bit(buf);
Anyway I can see Korean letters in menu, tootip, kwm's title bar, and kpanel's
task bar. And I make kfiledialog to work well with file and directory that
it's name is Korean.
Here is a screen shot. <http://terri.mizi.co.kr/kde/notes/>
Regards,
--
Woohyun JANG, louis@mizi.co.kr MIZI Research, Inc.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic