[Qt-interest] Char format in a text file

Gian Marco Gallo gianmarco.gallo at gmail.com
Fri Apr 16 09:04:58 CEST 2010


The problem is this: I want to read a txt file and to wrtie a utf-8 xml.
Obviously if the txt file is in ascii or in another format the xml reports
strange chars. So my idea was to try to understand via c++ and qt the format
of the file and then write a xml file in the same format.

2010/4/15 Thiago Macieira <thiago at kde.org>

> Em Quinta-feira 15 Abril 2010, às 18:05:14, Gian Marco Gallo escreveu:
> > Good afternoon
> >
> > Is there a way to understand via Qt the character set of a text file? I
> > mean: how can i understand via Qt if the file is UTF-8 or ASCII or so on
> > encoded?
>
> Not really.
>
> You can try and decode as UTF-8 and see if you succeed. And if you see no
> high-byte characters, it's probably ASCII.
>
> But it's always "probably". There's no way to know for certain.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>  Senior Product Manager - Nokia, Qt Development Frameworks
>      PGP/GPG: 0x6EF45358; fingerprint:
>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>


-- 
Gian Marco Gallo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100416/34d77eee/attachment.html 


More information about the Qt-interest-old mailing list