Extract QChar from QByteArray
-
Look this page will help you
http://www.instructables.com/id/Programming--how-to-detect-and-read-UTF-8-charact/step5/How-are-UTF-8-encoded-Unicode-characters-/Greetings
-
Look this page will help you
http://www.instructables.com/id/Programming--how-to-detect-and-read-UTF-8-charact/step5/How-are-UTF-8-encoded-Unicode-characters-/Greetings
@marceloarguello700 Sorry I didn't make it clear. I know what I would need to do it myself in code. I wondered if there was a function or member function to do it in one code statement. I would think this happens all the time, and I don't want to "re-invent the wheel."
Perhaps I should not have said UTF-8. I just want to "get" the
QChar
at the current position of theQByteArray
. How do I access a possibly multibyteQChar
from aQByteArray
? -
I know my reply is for old post,but this will helpfull for new people.
Below is the example code to filter UTF-8.I hope you will get resolution for your problem.
bool istextprintable(QByteArray text_temp){
QChar chrtr; for(int i = 1; i < text_temp.size(); i++) { chrtr = text_temp.at(i); if((chrtr.isDigit() || chrtr.isLower() || chrtr.isUpper() || chrtr.unicode() == 0 || chrtr.unicode() == 32) == 0 ){ return 0; } } return 1;
}