Hello. I have made a text analyser program which counts the different characters. One feature is that it needs to count the number of printing characters (as opposed to non-printing such as spaces, tabs and line returns).
I am testing my program, but have just realised that the program does not recognise non-ascii characters such as ¬ and £ (British pound sterling sign).
I used this routine to process a string of text to count the number of printable characters:
for (int z=0; z<testString.length() ;z++)
{
charray[z]=testString.charAt(z);
if ((int)charray[z]>32 && (int)charray[z]<=126)
// Please note ascii codes for printing characters are from 32 to 126 (32 is space).
{
numberofprintables=numberofprintables+1;
}
}
I have one idea to get around the problem which is to test if the character is a non-printable character (i.e. <32 in the ascii codes). Hence if it is not then the character must be a printing character.
Would this resolve the issue or are there non-ascii characters that are non-printable i.e. forms of spaces?
Many thanks!

