[Qt-interest] problem with accents

mierdatutis mi mmm286 at gmail.com
Mon Aug 3 23:15:54 CEST 2009


Thanks!

No, I don't use QtextStream. I do:

 while (!file.atEnd()) {

QTableWidgetItem *item = new QTableWidgetItem;

QByteArray line = file.readLine();

item->setText(line);

tabla->setItem(b,0,item);

tabla->setRowHeight(b,20);

b++;

 }


2009/8/3 Brad Howes <howes at ll.mit.edu>

> On Aug 3, 2009, at 4:23 PM, mierdatutis mi wrote:
>
>  I have a file with text with accents.
>>
>> When I pass the information of the file to a qtablewidget, the text have
>> strange characters instead of accents.
>>
>> How could I have the same text that the file in my qtablewidget?
>>
>
> Apparently, you have a Unicode format mismatch: your file's data is encoded
> in one format and Qt expects data in another. Are you using QTextStream to
> do the reading of the file?
>
> Brad
>
> --
> Brad Howes
> Group 42
> MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
> Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090803/e7598334/attachment.html 


More information about the Qt-interest-old mailing list