I have a QString as input. The string may contain Unicode text as well. I want to check whether a character is in Extended ASCII range (0-255). How to do this...pls help
I have a QString as input. The string may contain Unicode text as well. I want to check whether a character is in Extended ASCII range (0-255). How to do this...pls help
QChar::toLatin1()!=0
Last edited by MarekR22; 29th April 2011 at 15:45.
So I guess you mean you want to know if a char value is greater than 127, since below that its not extended ascii.I want to check whether a character is in Extended ASCII range (0-255).
Iterating over the string char by char as Mark suggested is not very efficient, specially for larger strings.
You can use QRegExp to match all char above 127 with \\0x80-\\0x255.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Bookmarks