Skip to main content
BBlad.1
Associate II
March 13, 2022
Question

UTF-8?

  • March 13, 2022
  • 4 replies
  • 2910 views

Hi,

A colleague need to send me strings via Uart.

He asked me whether I work with UTF-8, and I was unable to find this information or how to configure it...

(I know that at the end of the day to display it I'll have to convert to Unicode).

Does anyone know?

I work with stm32l496g

Thank you

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
March 13, 2022

The UART can send any 8-bit values you want to send. What they represent is up to you. UTC-8 is just a superset of ASCII as I recall.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
BBlad.1
BBlad.1Author
Associate II
March 13, 2022

yes, but is the 'unsgined char' c datatype encoded with utf-8?

that's what I can't find

Tesla DeLorean
Guru
March 13, 2022

Guess you'd need to look at the TouchGFX​ font mappings. C string functions are mostly agnostic, just expect NUL termination, and can work with control characters and extended characters.

Might need to check sort criterion.

Check compiler comand line options.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Alexandre RENOUX
Visitor II
March 14, 2022

Hello BBlad.1,

You are right, characters in a string in TouchGFX are considered as Unicode characters as 16-bit unsigned integers.

If you want to convert to UTF-8, you can call the functions fromUTF8() or toUTF8() that you can find in Unicode.hpp.

0693W00000KcRnGQAV.png/Alexandre