On quarta-feira, 10 de abril de 2013 23.59.05, Scott Aron Bloom wrote: > The Loading process is as follows:
#define QT_NO_CAST_FROM_ASCII > QByteArray contents = fi.readAll(); > fi.close(); > setPlainText( contents ); The last line here will error out saying that you're converting from QByteArray to QString. Whenever you do that, you need to tell what codec to use. If your next question is "how do I detect the encoding of a file", the answer is that you don't. Detecting the encoding is a guessing scenario. Certain libs have a good guess ratio, but it's still a guess. If you must *know* the encoding, you should add the drop-down combobox to your open dialog, or you have to add a menu to change the encoding (and reload the file). -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Interest mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/interest
