[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: getting char data out of QStrings in Qt 2.0
From: Matthias Ettrich <ettrich () troll ! no>
Date: 1999-04-30 23:35:26
[Download RAW message or body]
On Sat, 01 May 1999, Alex Zepeda wrote:
>On Fri, 30 Apr 1999, Warwick Allison wrote:
>
>> The preferred method is simply NOT TO DO IT. When converting to "ascii" you
>> need to consider WHY. For example, if you want to write a "text file", should
>> that be in UTF-8, UTF-16, or the user's locale-specific 8-bit encoding?
>>
>> Whenever you call QString::ascii() you poke a stick in the eye of a non-Latin1
>> user.
>>
>> When you call:
>>
>> foo(bar.ascii())
>>
>> you're probably better off fixing foo() to take const QString&.
>
>Well how else are we going to get at a bytearray useable for such things
>as write(2). Some of us don't like using QFile or QTextStreams quite yet.
If you are thinking about an applications own "proprietary" write and read
format, then QString::utf8() and QString::fromUtf8(...) is what you want.
This way your program will work for non-latin1 users as well (what wouldn't be
the case if you convert unicode to ascii )
Matthias
>
>- alex
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic