Character encoding in text edit and llne edit
Hi!
I programming in qt for half year, but still now I made just english-language software. Today I would like to make something with hungarian characters, so I should use utf8 or iso 8859-2.
I found this:
Code:
QString QObject::trUtf8 ( const char * sourceText,
const char * comment
= 0,
int n
= -1 )
and
- these are good for settings, but how can I get the text of a text edit or a line edit in utf8 format?
Thank you,
greenvirag
Re: Character encoding in text edit and llne edit
Why dont u use Qt Translations ? Your work wud be much easier.
Have a look at Internationalization with Qt in Qt Assistant
Re: Character encoding in text edit and llne edit
Sorry greenvirag but what is a problem ? QT internaly is working in Unicode. All is described in documentation
Re: Character encoding in text edit and llne edit
Sorry, I asked wrong question.
I don't need Qt Translation, because the language of the software will be english. But maybe, some user will upload some string using special characters. I get this string:
Code:
QString description
= ui.
textEdit->toPlainText
();
QString sname
= ui.
nameLineEdit->text
();
and ok, it can really show these characters. But I need to convert these variables to char*, keeping the special characters.
My problem, that I didn't see at the first time, is that after the QString --> char* conversation the special characters will be lost.