I wanted to edit this library so that it can also display special characters (like ä, ö, ß, €) on my tft display.
My problem is that the library uses an 1 byte-identifier for charachter drawing (ASCII).
So i thought i could implement the ISO 8859-15 standard in only one byte as it has all the characters I need.
Arduino can display these special characters as it uses UTF-8.
In UTF-8 some characters are represented with more than one byte ( € is 0x E8 82 AC).
So I wrote a simple convert function that tries to solve the problem mentioned above:
String convertAscii(String input)
{
String ret = "";
Serial.println(input);
Serial.println("Length: " + String(input.length()));
for (int i = 0; i < input.length(); i ++)
{
char c = input.charAt(i);
//ret = ????
Serial.println(String(c) + " , " + String(isAscii(c)) + ", " + String((c), HEX));
}
return ret;
}
When I call the function with e.g. "€" I get this output:
€
Length: 3
⸮ , 0, e2
⸮ , 0, 82
⸮ , 0, ac
So stuff with char and String.length() doesn't work on those strings.
Now I have no clue what I should do about it.
Could You please help me?