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

List:       kde-devel
Subject:    writing utf8 docs
From:       Koos Vriezen <koos.vriezen () xs4all ! nl>
Date:       2005-06-29 22:21:08
Message-ID: 20050629222108.GB60433 () xs4all ! nl
[Download RAW message or body]

Hi,

I'm trying to get an utf8 doc w/o luck so far. Eg. the degree
symbool (B0 in latin1), both with kcharselect as with kate ,and using
its utf8 encoding, they keep insisting on C2B0 (which might be utf16,
but not utf8, IIRC the last byte should be <= 7f).

Now kcharselect does QClipboard::setText(linetxt->str().utf8()) and that
get translated back by QString?

Anyhow, this test src already doesn't work like I expect.

#include <qstring.h>
#include <qfile.h>

int main () {
    QFile in, out;
    //in.open (IO_ReadOnly, stdin);
    out.open (IO_WriteOnly, stdout);
    //QCString cs (QString::fromLocal8Bit (in.readAll ()).utf8 ());
    QCString cs (QString (QChar (0xC2B0)).utf8 ());
    out.writeBlock (cs, cs.length ());
    return 0;
}


$ ./a.out |hd
00000000  eb 83 82                                          |...|
00000003

Nor did the commented piping. So, what am I missing?

(BTW, my lang setting is:
$ env | grep -i lang
LANG=en_US.UTF-8
)

Tia,

Koos
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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