PC Review


Reply
Thread Tools Rate Thread

how to cast to char when value over 127

 
 
Dica
Guest
Posts: n/a
 
      4th Jun 2007
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


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      4th Jun 2007
On Jun 4, 10:23 pm, "Dica" <genp...@hotmail.com> 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.
>
> 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);

 
Reply With Quote
 
Tamas Demjen
Guest
Posts: n/a
 
      4th Jun 2007
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to permanently delete char char char char style in MS Word? =?Utf-8?B?Q3Jpcw==?= Microsoft Word Document Management 6 12th Jun 2011 09:47 PM
how to cast byte to char Daniel Microsoft VC .NET 12 18th Jul 2008 09:27 AM
Ever seen "Char Char Char Char Char Char1 Char Char Ch" style? =?Utf-8?B?TWFyaWx5bg==?= Microsoft Word Document Management 2 4th Oct 2006 04:47 PM
Formatting changed to Char Char Char Char... =?Utf-8?B?TWVsaXNzYQ==?= Microsoft Word Document Management 10 14th Apr 2006 07:32 AM
error LNK2019: unresolved external symbol "public: static class ATL::CStringT<char,class StrTraitMFC<char,class ATL::ChTraitsCRT<char> > > danip Microsoft VC .NET 0 5th Dec 2005 10:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:34 AM.