I have something like
char[] = "тест";
and i need to conver every symbol to code of this symbol. (А - 53392
Б - 53393 В - 53394 etc )
Now i use
char symb = 'у';
int number = symb - ' ';
or
int symbol = 'У'
but it works only for one symbol and i had error
warning: multi-character character constant [-Wmultichar]
I m trying using
long int str[] = { 'А' , 'Б', 'В'};
printf("char_offset:%d\n", str[1]);
and its working, but it's not easy to declare strings with many symbols this method. And i had this errors
Xlib1.c:295:17: warning: multi-character character constant [-Wmultichar]
int str[] = { 'А' , 'Б', 'В'};
^
Xlib1.c:295:24: warning: multi-character character constant [-Wmultichar]
int str[] = { 'А' , 'Б', 'В'};
^
Xlib1.c:295:30: warning: multi-character character constant [-Wmultichar]
int str[] = { 'А' , 'Б', 'В'};
^
But its working. i use this keys with gcc
-finput-charset=UTF-8 -std=c11 -fextended-identifiers
I need to use this code on stm32. Help me to convert string with cyrillic characters to array of int codes of characters in string