cancel
Showing results for 
Search instead for 
Did you mean: 

Unicodechar to char

heyo
Senior

How to change type from Unicodechar to char? I'm trying to pass char to model like this, but it only passes one character. What I am doing wrong?

heyo_0-1689660758663.png

 

 

2 REPLIES 2

Hello @heyo,

Based on the amount of information you have provided it's a bit difficult to judge, however, there are some functions that you can use to convert Unicode to char. For instance, you can use the wcstombs() function from the <cstdlib> header to convert a wide character string to a multibyte character string. Or using wstring_convert class from the <locale> header.

Hope this would help you.

Mohammad MORADI
ST Software Developer | TouchGFX
t.decker
Senior II

As you have created this question in the TouchGFX forum, I assume you are using TouchGFX. Then you can use the function

 

Unicode::toUTF8(unicode, utf8, maxbytes)

 

provided by Unicode.hpp.

When this account seems to be inactive, try @tdecker2 - ST can't change mail addresses, so I had to create a new account.