Hello,

On Wed, 12 Mar 2008 18:41:57 +0100, Y Giridhar Appaji Nag <[EMAIL PROTECTED]> wrote:

On 08/03/12 14:07 +0100, Jiří Paleček said ...
BTW I noticed xxdiff uses Qt, so it might be something like "fromUtf8
used instead of fromLocal8bit" or something similar.

But that would still not explain why I am not able to reproduce it.

Could you please try the attached program, and try changing the LOCAL #define? For me, if LOCAL is 1, it outputs

[EMAIL PROTECTED]:/var/tmp$ mkdir /tmp/Jiří
[EMAIL PROTECTED]:/var/tmp$ /tmp/tmp /tmp/Jiří/
/tmp/Ji?í/
1

if LOCAL is 0:

[EMAIL PROTECTED]:/var/tmp$ mkdir /tmp/Jiří
[EMAIL PROTECTED]:/var/tmp$ /tmp/tmp /tmp/Jiří/
/tmp/Jiří/
0

Also, what is your locale?

I think s/latin1/local8bit/g would solve the issue, but am not sure why it works for you.

Regards
    Jiri Palecek
#include <qstring.h>
#include <qfileinfo.h>
#include <iostream>
using namespace std;

#define LOCAL 0

int main(int argc, char** argv)
{
#if LOCAL
  QString s(QString::fromLocal8Bit(argv[1]));
#else
  QString s(QString::fromLatin1(argv[1]));
#endif
  QFileInfo fi(s);
  cout << s.latin1() << endl << fi.exists() << endl;
}

Reply via email to