how to cast to char when value over 127

  • Thread starter Thread starter Dica
  • Start date Start date
D

Dica

i need to pass special characters to my application in the extended ascii
range. however, anything above 127 fails when i try like this:
(char)184.

unsigned char should be able to do this in another language, but it's not
supported in c#. any ideas how to do this?

tks
 
i need to pass special characters to my application in the extended ascii
range. however, anything above 127 fails when i try like this:
(char)184.

unsigned char should be able to do this in another language, but it's not
supported in c#. any ideas how to do this?

tks

The code below is working well for me

char x = (char)184;
Response.Write(x);
 
Dica said:
i need to pass special characters to my application in the extended ascii
range. however, anything above 127 fails when i try like this:
(char)184.

Your example should work fine. In C# the char type is an alias for
System.Char, which is a 16-bit Unicode character, unlike in C/C++, where
char 8-bit.

Tom
 
Back
Top