adafruit / Adafruit_SSD1306

Arduino library for SSD1306 monochrome 128x64 and 128x32 OLEDs
http://www.adafruit.com/category/63_98
Other
1.75k stars 964 forks source link

[Feature Request] Improve print / println for special character like umlauts #181

Open bitboy85 opened 3 years ago

bitboy85 commented 3 years ago

Currently its not handy using special characters with the display print method.

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
//Works fine:
display.print("Hello World!");
//shows garbage
display.print("Ä Ü Ö ä ü ö ß");
// Is possible with
display.print("\224 \201 \204");  //Using octal ASCII
//or
display.print("\x94 \x81");  //Using hex ASCII
//or
display.write(0x94);

It would be very user friendly if umlauts in strings would be automatically converted by the library as it reads much better and is more easy to use.

mzero commented 3 years ago

Please see my extensive comment in #190 Adafruit_GFX (and by extension Adafruit_SSD1306) does bring characters with umlauts. The Issue is that you are using the wrong encoding.