how to cast to char when value over 127

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
 
A

Alexey Smirnov

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);
 
T

Tamas Demjen

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top