[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: Warwick Allison <warwick () troll ! no>
Date: 1999-04-30 18:14:31
[Download RAW message or body]
On Fri, 30 Apr 1999, pbrown@redhat.com wrote:
>Is the preferred method for getting data out of QStrings and into char
>arrays in Qt 2.0 via the ::ascii() method or with a (const char *) cast?
>And why?
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&.
--
Warwick
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic