mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2024-09-21 10:27:11 +00:00
Implement UTF8 switch #1108
This commit is contained in:
parent
018c884312
commit
233b98aa05
15
TFT_eSPI.cpp
15
TFT_eSPI.cpp
@ -3730,14 +3730,14 @@ uint8_t TFT_eSPI::getAttribute(uint8_t attr_id) {
|
||||
** Function name: decodeUTF8
|
||||
** Description: Serial UTF-8 decoder with fall-back to extended ASCII
|
||||
*************************************************************************************x*/
|
||||
#define DECODE_UTF8 // Test only, comment out to stop decoding
|
||||
uint16_t TFT_eSPI::decodeUTF8(uint8_t c)
|
||||
{
|
||||
#ifdef DECODE_UTF8
|
||||
if (!_utf8) return c;
|
||||
|
||||
// 7 bit Unicode Code Point
|
||||
if ((c & 0x80) == 0x00) {
|
||||
decoderState = 0;
|
||||
return (uint16_t)c;
|
||||
return c;
|
||||
}
|
||||
|
||||
if (decoderState == 0) {
|
||||
@ -3754,7 +3754,7 @@ uint16_t TFT_eSPI::decodeUTF8(uint8_t c)
|
||||
return 0;
|
||||
}
|
||||
// 21 bit Unicode Code Point not supported so fall-back to extended ASCII
|
||||
// if ((c & 0xF8) == 0xF0) return (uint16_t)c;
|
||||
// if ((c & 0xF8) == 0xF0) return c;
|
||||
}
|
||||
else {
|
||||
if (decoderState == 2) {
|
||||
@ -3770,9 +3770,8 @@ uint16_t TFT_eSPI::decodeUTF8(uint8_t c)
|
||||
}
|
||||
|
||||
decoderState = 0;
|
||||
#endif
|
||||
|
||||
return (uint16_t)c; // fall-back to extended ASCII
|
||||
return c; // fall-back to extended ASCII
|
||||
}
|
||||
|
||||
|
||||
@ -3785,7 +3784,8 @@ uint16_t TFT_eSPI::decodeUTF8(uint8_t *buf, uint16_t *index, uint16_t remaining)
|
||||
uint16_t c = buf[(*index)++];
|
||||
//Serial.print("Byte from string = 0x"); Serial.println(c, HEX);
|
||||
|
||||
#ifdef DECODE_UTF8
|
||||
if (!_utf8) return c;
|
||||
|
||||
// 7 bit Unicode
|
||||
if ((c & 0x80) == 0x00) return c;
|
||||
|
||||
@ -3801,7 +3801,6 @@ uint16_t TFT_eSPI::decodeUTF8(uint8_t *buf, uint16_t *index, uint16_t remaining)
|
||||
|
||||
// 21 bit Unicode not supported so fall-back to extended ASCII
|
||||
// if ((c & 0xF8) == 0xF0) return c;
|
||||
#endif
|
||||
|
||||
return c; // fall-back to extended ASCII
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
#ifndef _TFT_eSPIH_
|
||||
#define _TFT_eSPIH_
|
||||
|
||||
#define TFT_ESPI_VERSION "2.3.65"
|
||||
#define TFT_ESPI_VERSION "2.3.66"
|
||||
|
||||
// Bit level feature flags
|
||||
// Bit 0 set: viewport capability
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "TFT_eSPI",
|
||||
"version": "2.3.65",
|
||||
"version": "2.3.66",
|
||||
"keywords": "Arduino, tft, ePaper, display, Pico, RP2040, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9481, ILI9486, ILI9488, ST7789, RM68140, SSD1963, ILI9225, HX8357D",
|
||||
"description": "A TFT and ePaper SPI graphics library with optimisation for Raspberry Pi Pico, ESP8266, ESP32 and STM32",
|
||||
"repository":
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=TFT_eSPI
|
||||
version=2.3.65
|
||||
version=2.3.66
|
||||
author=Bodmer
|
||||
maintainer=Bodmer
|
||||
sentence=TFT graphics library for Arduino processors with performance optimisation for RP2040, STM32, ESP8266 and ESP32
|
||||
|
Loading…
Reference in New Issue
Block a user