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

List:       kde-core-devel
Subject:    Re: [PATCH] Add select encoding in Control Center (for CVS HEAD)
From:       Ilya Konstantinov <kde-core-devel () future ! shiny ! co ! il>
Date:       2001-09-30 12:04:29
[Download RAW message or body]

On Sun, Sep 30, 2001 at 08:47:50PM +0900, Toshitaka Fujioka wrote:
> On Saturday 29 September 2001 02:06, Ilya Konstantinov wrote:
> > On Sat, Sep 29, 2001 at 01:22:28AM +0900, Toshitaka Fujioka wrote:
> > > I remade a patch. Please review.
> >
> > You still compare the encoding names in loadCurrentEncoding() with
> > contains(). How about the way I proposed in my previous message?
> >
> > I meant something like:
> >
> > QTextCodec *currentCodec = QTextCodec::codecForName(encoding);
> > int count = 0;
> > QStringList encodings = KGlobal::charsets()->availableEncodingNames();
> > QStringList::Iterator it;
> > for( it = encodings.begin(); it != encodings.end(); ++it ) {
> >    QTextCodec *codec = KGlobal::charsets()->codecForName(*it);
> >    if (qstrcmp(codec->name(), currentCodec->name()) == 0)
> >      return count;
> >    count++;
> > }
> 
> Hmm... Sorry. This does not work correctly.
> I tried this:
>  QTextCodec *currentCodec = QTextCodec::codecForName(encoding.latin1());
>  int count = 0;
>  QStringList encodings = KGlobal::charsets()->descriptiveEncodingNames();
>  QStringList::Iterator it;
>  for( it = encodings.begin(); it != encodings.end(); ++it ) {
>     QTextCodec *codec = KGlobal::charsets()->codecForName(KGlobal::charsets()->encodingForName(*it));
>     if (qstrcmp(codec->name(), currentCodec->name()) == 0)
>       return count;
>     count++;
>  }
> 
> But, this does not work correctly, too.
> Because, when iso 8859-6, ibm852, pt 154 and utf16,  iso 8859-1 returned.

Only for those encodings?
Are you trying with Qt2 or Qt3?

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

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