Is there any way to convert extended ASCII charters(from the range 128-255) to its corresponding decimal values programmatically?
Brief:: standard ASCII charters ranging from 0-127 we can store it in simple character variable and we do the conversion like below example.
e.x:1) for Standard ASCII charter to decimal conversion
char myString [] = "+"; // input is '+' corresponding decimal value is 43.
printf("myString decimal val = %d, size = %d, %d\n",myString[0], sizeof(tmpBuffer));
O/p: myString decimal val = 43, size = 2
2) e.x: for Extended ASCII charter to decimal conversion
char myString [] = "á"; // input is 'á' corresponding decimal value is 160.
printf("myString decimal val = %d, size = %d, %d\n",myString[0], sizeof(tmpBuffer));
O/p: myString decimal val = -61, size = 3
in the above 2) e.x i am getting the decimal output value is -61 but actual is 160.
Can anyone help me out how can i get the o/p as exact decimal value?
Thanks in Advance..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
Is there any way to convert extended ASCII charters(from the range 128-255) to its corresponding decimal values programmatically?
Brief:: standard ASCII charters ranging from 0-127 we can store it in simple character variable and we do the conversion like below example.
e.x:1) for Standard ASCII charter to decimal conversion
char myString [] = "+"; // input is '+' corresponding decimal value is 43.
printf("myString decimal val = %d, size = %d, %d\n",myString[0], sizeof(tmpBuffer));
O/p: myString decimal val = 43, size = 2
2) e.x: for Extended ASCII charter to decimal conversion
char myString [] = "á"; // input is 'á' corresponding decimal value is 160.
printf("myString decimal val = %d, size = %d, %d\n",myString[0], sizeof(tmpBuffer));
O/p: myString decimal val = -61, size = 3
in the above 2) e.x i am getting the decimal output value is -61 but actual is 160.
Can anyone help me out how can i get the o/p as exact decimal value?
Thanks in Advance..
Hi Please find the attached code for the issue i faced. Can anyone hel me out from this.