C++ Extended Ascii characters

ilan picture ilan · Mar 6, 2009 · Viewed 18.1k times · Source

How to detect the presence of Extended ASCII values (128 to 255) in a C++ character array.

Answer

Joachim Sauer picture Joachim Sauer · Mar 6, 2009

Please remember that there is no such thing as extended ASCII. ASCII was and is only defined between 0 and 127. Everything above that is either invalid or needs to be in a defined encoding other than ASCII (for example ISO-8859-1).

Please read The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!).

Other than that: what's wrong with iterating over it and check for any value > 127 (or <0 when using signed chars)?