Re: [Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-25 Thread lars.knoll
On 5/24/12 11:38 PM, ext Thiago Macieira thiago.macie...@intel.com wrote: On quinta-feira, 24 de maio de 2012 13.15.16, 1+1=2 wrote: If we want to bootstrap tool such as qmake support utf8 Why would we want to? One reason could be paths/filenames that are encoded in the .pro file. If we

Re: [Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-25 Thread Thiago Macieira
On sexta-feira, 25 de maio de 2012 06.27.05, lars.kn...@nokia.com wrote: On 5/24/12 11:38 PM, ext Thiago Macieira thiago.macie...@intel.com wrote: On quinta-feira, 24 de maio de 2012 13.15.16, 1+1=2 wrote: If we want to bootstrap tool such as qmake support utf8 Why would we want to? One

Re: [Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-25 Thread lars.knoll
On 5/25/12 9:37 AM, ext Thiago Macieira thiago.macie...@intel.com wrote: On sexta-feira, 25 de maio de 2012 06.27.05, lars.kn...@nokia.com wrote: On 5/24/12 11:38 PM, ext Thiago Macieira thiago.macie...@intel.com wrote: On quinta-feira, 24 de maio de 2012 13.15.16, 1+1=2 wrote: If we want

Re: [Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-24 Thread 1+1=2
On Thu, May 24, 2012 at 2:51 AM, lars.kn...@nokia.com wrote: Not true. We do compile qutfcodec into qmake and the bootstrap tools, so QString::fromUtf8() does work. With the change of QString(const char *) to convert from utf8 I would assume that qmake at least partially uses utf8 by now.

Re: [Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-24 Thread Thiago Macieira
On quinta-feira, 24 de maio de 2012 10.05.50, 1+1=2 wrote: At present, when QT_NO_TEXTCODEC is defined, QTextStream use QString::fromLatin1() /QString::toLocal8Bit() to convert from/to bytes which looks like not very well. So I think it will be better to replace them with

Re: [Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-24 Thread 1+1=2
On Thu, May 24, 2012 at 10:26 AM, Thiago Macieira thiago.macie...@intel.com wrote: On quinta-feira, 24 de maio de 2012 10.05.50, 1+1=2 wrote: At present, when QT_NO_TEXTCODEC is defined, QTextStream use QString::fromLatin1() /QString::toLocal8Bit() to convert from/to bytes which looks like not

Re: [Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-24 Thread Thiago Macieira
On quinta-feira, 24 de maio de 2012 12.05.47, 1+1=2 wrote: When QT_NO_TEXTCODEC is defined, default codec is QTextCodec::codecForLocale(), but can be changed using QTextStream::setCodec(). I don't see the need to change then. It should remain the locale. When QT_NO_TEXTCODEC isn't defined,

Re: [Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-24 Thread 1+1=2
On Thu, May 24, 2012 at 12:47 PM, Thiago Macieira thiago.macie...@intel.com wrote: You misunderstand Latin 1 then. If you read the contents with Latin1 and write using Latin1, you get exactly what you had before. No data is lost. I know Latin1, I just forget that QString::toLocal8Bit() always

Re: [Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-24 Thread 1+1=2
On Thu, May 24, 2012 at 12:47 PM, Thiago Macieira thiago.macie...@intel.com wrote: For user applications (that is, other than qmake, moc, uic, etc.) that turned off QTextCodec, there's nothing that we can do. If you turn off the concept of codecs, then you can't change it. Then If we want to

[Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-23 Thread 1+1=2
Hi all, It might be a bit late for 5.0. But Qt 5 have started to enforce that source code file must be UTF-8. So perhaps it make sense to change the default codec of QTextStream to UTF-8. This won't break many things, as the old behavior can be obtained by calling QTextStream::setCodec(). I have

Re: [Development] Should we change the default codec of QTextStream to UTF-8?

2012-05-23 Thread Thiago Macieira
On quarta-feira, 23 de maio de 2012 13.30.05, 1+1=2 wrote: In addition, this will improve the unicode handling ability of Qt tools with using bootstrap. Otherwise, tools such as qmake can not deal with UTF-8 encoded files. That is irrelevant. qmake operates on Latin1 exclusively because it