Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a unicode number "U+2602", how to convert it into it's particular symbol or charachter and then again convert it back to unicode number? Symbol of the above unicode number is :- (Please see in the link below)

https://www.dropbox.com/s/9n8v8rs383he7e3/Unicode%20answer.png[^]
Posted
Updated 2-Jun-14 19:23pm
v2

1 solution

C#
char myValue = Char.Parse("\u2602");

convert back to string
C#
string str = string.Format(@"\u{0:x4}", (int)myValue);

if you need string
C#
string  myValue = Char.Parse("\u2602").ToString();
 
Share this answer
 
v3
Comments
agent_kruger 3-Jun-14 1:24am    
sir, your solution is fine but i also need to convert it back to unicode number. How to do so?
DamithSL 3-Jun-14 1:33am    
check my update
agent_kruger 3-Jun-14 1:46am    
thank you sir, just one last thing i have a unicode number "U+0FD7" and i can use this with your code but i need to know that this font is of "tibetan" and the
symbol is displayed as a block. I know this is because of font but do you have any website in mind where i can find this font?
DamithSL 3-Jun-14 1:55am    
Go to http://www.fileformat.info/info/unicode/char/fd7/index.htm[^]
there is a link Fonts that support U+0FD7
click on that link you can find the fonts :-)
agent_kruger 3-Jun-14 2:09am    
sir, i have visited that site already but where to download it from.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900