By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,829 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,829 IT Pros & Developers. It's quick & easy.

how to cast to char when value over 127

P: n/a
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
Jun 4 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jun 4, 10:23 pm, "Dica" <genp...@hotmail.comwrote:
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);

Jun 4 '07 #2

P: n/a
Dica wrote:
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
Jun 4 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.