Tim Huffam

Dotting the I and crossing the T of I.T.

  Home  |   Contact  |   Syndication    |   Login
  153 Posts | 0 Stories | 2747 Comments | 653 Trackbacks

News

Archives

Post Categories

Interesting Blogs/Links

For each character in the string this displays:

  1. The character
  2. It's unicode character code in hex
  3. It's unicode character code number

   string text = "0 a+…”";
   foreach (char c in text)
   {
      Console.WriteLine("{0} U+{1:x4} {2}", c, (int)c, (int)c);
   }

HTH

Tim

posted on Thursday, May 25, 2006 12:28 PM

Feedback

# re: How to get ascii/unicode character codes using C#.NET 10/25/2006 8:01 AM ta
pls. send me code.

# re: How to get ascii/unicode character codes using C#.NET 2/14/2007 5:20 AM Tanzeel
I need the code

# re: How to get ascii/unicode character codes using C#.NET 4/23/2007 8:14 AM Prasad
Thanks Champ,
I was damn stucked in this UNICODE stuff. But good hint in your example solved my many problems.

Thanks again : )

Prasad.

# re: How to get ascii/unicode character codes using C#.NET 6/29/2007 5:20 AM maks
I need the code also

# re: How to get ascii/unicode character codes using C#.NET 8/28/2007 8:39 PM Junias
Need your code urgently.

# re: How to get ascii/unicode character codes using C#.NET 9/4/2007 1:36 PM Thank you
Hi, Thanks a lot (*_*)

# re: How to get ascii/unicode character codes using C#.NET 9/10/2007 5:32 AM Meetu
U can try this
char[] characters = System.Text.Encoding.ASCII.GetChars(new byte[] {65});


# re: How to get ascii/unicode character codes using C#.NET 9/11/2007 6:31 AM Vinod

Dear ,
Please send the code sample if u have it .

Thanks in advance


# re: How to get ascii/unicode character codes using C#.NET 11/9/2007 5:55 PM Luke
Lol,

^ That IS the code!

# re: How to get ascii/unicode character codes using C#.NET 12/6/2007 10:39 AM george
where is the code?????// I am too dumb to see it right there in the message!!!!1

# re: How to get ascii/unicode character codes using C#.NET 3/18/2008 1:48 PM dwadwa
are you fuckin blind? the code is right there.

# re: How to get ascii/unicode character codes using C#.NET 3/25/2008 5:31 PM Hasmukh Ghatala
That is nice to avail it over here,
Thank you very much

# re: How to get ascii/unicode character codes using C#.NET 4/12/2008 7:01 PM lulz
your codes, may i has them

# re: How to get ascii/unicode character codes using C#.NET 6/20/2008 1:13 AM Hix
Wow... a lot of scriptkiddies (usually they are write-only)...... lol

# re: How to get ascii/unicode character codes using C#.NET 8/1/2008 7:36 PM rahul singh
thanks sir

i am learning ASP.NET now & i know about oops concept

i was looking for this (getting unicode)!
now i want to khow that if we got a unicode of a particular character now i want to convert it into another language

like
"arabic , chinees ,hindi, french ".

means i want to use it as a global character !

is this possible ?

please help me !




# re: How to get ascii/unicode character codes using C#.NET 8/1/2008 7:37 PM rahul singh
thanks sir

i want to get unicode of a particular character

# re: How to get ascii/unicode character codes using C#.NET 8/1/2008 7:39 PM rahul
thanks again !

#  want to convert unicode in another language 8/29/2008 7:10 PM rahul_singh


show me the code for international applicatyion

# re: How to get ascii/unicode character codes using C#.NET 9/12/2008 10:31 PM cosmic
YOu can use
Convert.ToChar(230)

# re: How to get ascii/unicode character codes using C#.NET 10/23/2008 4:33 AM akbar
Thanks a lot for all .

# re: How to get ascii/unicode character codes using C#.NET 11/9/2008 7:23 PM hahaha
tooooooooooooo many stupid questions here lol

# re: How to get ascii/unicode character codes using C#.NET 11/13/2008 6:26 PM naing
Hahaha, where is the code :P LOL

# re: How to get ascii/unicode character codes using C#.NET 2/14/2009 6:01 PM raj
where is the code yaar!!!!!!!!!!!!!!!!!

# re: How to get ascii/unicode character codes using C#.NET 4/10/2009 5:15 PM shanthi
Hi,
I Need to convert unicode.
I am blank now.
will u help me,

# re: How to get ascii/unicode character codes using C#.NET 4/11/2009 10:42 AM internetmilionnaire
This is the worst thread!!!
everybody ask the same quesiton and NOBODY sayd where the code is!
I need this ASAP. unicode anyone?

also getting updatepanel in asp.net. how do that?
they say pages are faster with it!! I want it

# re: How to get ascii/unicode character codes using C#.NET 4/18/2009 8:02 AM amazedOnlooker
WTF!

where's the code! LOL

is this a bellend convention? :-?

# re: How to get ascii/unicode character codes using C#.NET 5/1/2009 3:17 AM Shocked
The code is right there:

cast the char to an int

# re: How to get ascii/unicode character codes using C#.NET 7/5/2009 12:52 PM VC
Looks like lot of folks are either
1) unable to see that the code is right there or
2) Lazy enough to implement the above logic in their software thinking that others can come to them or beg to get an opportunity to modify THEIR(the blind folks') code so the above-code-poster might try hard (to prove that it this code on this screen could also work for them) and automatically get THEIR(the blind folks') code included with the needed logic with out getting their hands dirty.

The silly strategy no-2 above is, unfortunately, the trait of many amateur programmers and discourages the nice idea and code-sharing people.

Buddies, please read the post clearly and atleast twice before posting requests for code.

Thanks

VC

# re: How to convert ascii/unicode character to integer codes using C#.NET 8/7/2009 11:53 PM zahra torabi
hi
I need a method or code to convert unicode character to integer and also unicode character to ascii character
thanks for help

# How to convert Hindi font to unicode in asp.net c# 9/30/2009 2:05 AM Deepak
Please solve this problem.

# re: How to get ascii/unicode character codes using C#.NET 10/14/2009 6:26 PM Wing
All of your code are belong to us!!!

# re: How to get ascii/unicode character codes using C#.NET 12/8/2009 11:55 AM Victor
I need the code too asap, where is it??? Somewhere hidden in this page?

Victor

# re: How to get ascii/unicode character codes using C#.NET 12/14/2009 7:40 PM Hindi
I need all your code to sell to someone for lots of money please

# re: How to get ascii/unicode character codes using C#.NET 1/4/2010 3:35 AM karthik
I need to insert tamil words into database. and also retireve from that data base in asp web form with c#


# re: How to get ascii/unicode character codes using C#.NET 1/6/2010 2:12 AM Altafhusain
if you get answer that
you send the my e-mail id

# re: How to get ascii/unicode character codes using C#.NET 1/6/2010 2:12 AM Altafhusain
you send answer my e-mail id

# Stupid 1/19/2010 2:40 AM Blind Person
I am another blind person who wants to know where the code is :P



# re: How to get ascii/unicode character codes using C#.NET 2/8/2010 3:10 AM a@gmail.com
For each character in the string this displays:

The character
It's unicode character code in hex
It's unicode character code number
string text = "0 a+…”";
foreach (char c in text)
{
Console.WriteLine("{0} U+{1:x4} {2}", c, (int)c, (int)c);
}

HTH

Tim

# how to get unicode character codes 3/9/2010 1:03 AM shiva
i don't know what u people are discussing and why u people are using foreach loop, i.e u r passing hexa decimal code to string and getting char by char is it give unicode?.

# re: How to get ascii/unicode character codes using C#.NET 4/17/2010 11:57 PM j
this is hilarious, just goes to show that just because you have notepad, doesn't mean you know how to code... Thanks for the code by the way! ;-)

# re: How to get ascii/unicode character codes using C#.NET 8/25/2010 10:29 PM Andy
Could you email me the code?

(BTW, this is freakin hilarious) :-)

# re: How to get ascii/unicode character codes using C#.NET 12/3/2010 12:02 AM Ravi Potdar
i wanted to know how to use unicode in my website

# re: How to get ascii/unicode character codes using C#.NET 12/13/2010 1:45 AM muhammed ali.k
how use f1 ascii in c#winform keypress event

# re: How to get all ascii characters codes using C#.NET 1/4/2011 2:51 AM mpld
ascii characters codes using C#.NET

# re: How to get ascii/unicode character codes using C#.NET 2/17/2011 2:44 AM sushmitha
dr["Req_id"] = dr["Req_id"].ToString() + "'U+0028'" + count1 + "'U+0029'";

dr["Req_id"]=1452
count1=6
i want to show it like 1452(6) in grid using datarow

# re: How to get ascii/unicode character codes using C#.NET 2/24/2011 4:34 PM juan
god, people's retarded

# re: How to get ascii/unicode character codes using C#.NET 4/26/2011 4:37 AM Violet
Okay, I see the code, and Console.WriteLine("{0} U+{1:x4} {2}", c, (int)c, (int)c); does indeed output the information I was looking for. However, I'm unfamiliar with the way Console.WriteLine works, so I don't know how to apply any of the example arguments to a more generic code situation. Suppose I want to take the hex code of the character and assign it to a string variable to be looked up in a table, rather than simply outputting it to the debug window? Even though "The code is right there!" it will be necessary for me to continue combing the Internet for a more accessible explanation of what seems like it should be a simple operation. Ah, the woes of an amateur. -_-

# re: How to get ascii/unicode character codes using C#.NET 5/31/2011 12:50 PM wtfBBQ
Thanks for the simple solution. Amazed that so many people are asking for the code. This thread made my day.

# re: How to get ascii/unicode character codes using C#.NET 8/26/2011 6:33 AM srvs
I need to insert Telugu(Indian Language) words into database. and also retireve from that data base in asp web form with c#

# re: How to get ascii/unicode character codes using C#.NET 11/10/2011 4:11 PM Ana
I want to just replace each char at time. Can you help me?

# re: How to get ascii/unicode character codes using C#.NET 1/22/2012 3:38 PM maddhater
thanks boss

#  How to get ascii/unicode character codes using C#.NET 5/23/2012 5:17 AM Danoge
It is good to have such service.i thankful to you

Post A Comment
Title:
Name:
Email:
Comment:
Verification: