473,395 Members | 1,905 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to get the unicode representation of a character (font)

Hello all !

I'm new to c#.net. these days I'm working with a program that takes sinhala characters (Sinhalese) as input. so i want to identify those characters as user types them. for this i have to use Unicode representation. so how can i do this?

please help me on this. a guide or sample code will help a lot.

is there a any way to get the Unicode form of a character in c#?
i found a way to convert Unicode to string and can i convert other way around?
Mar 27 '07 #1
4 3621
kenobewan
4,871 Expert 4TB
Welcome to the site. Here is an article that may help:
Globalization issues in ASP and ASP.NET
Mar 28 '07 #2
SammyB
807 Expert 512MB
Hello all !

I'm new to c#.net. these days I'm working with a program that takes sinhala characters (Sinhalese) as input. so i want to identify those characters as user types them. for this i have to use Unicode representation. so how can i do this?

please help me on this. a guide or sample code will help a lot.

is there a any way to get the Unicode form of a character in c#?
i found a way to convert Unicode to string and can i convert other way around?
C#.NET already uses Unicode to store character strings, so there really very little that you need to do. See http://www.yoda.arachsys.com/csharp/unicode.html.

However, C#.NET will probably not be set to the correct codepage. The simplest way to set this correctly is to just use a sinhala character in a literal and then try to save your program. You get a message "Some Unicode characters in the file could not be saved in the current codepage..." You can either click Yes to save the file as Unicode or click "Save with other encoding" if there is a codepage for sinhala. You also might want to install sinhala support from http://www.fonts.lk/down.html.

Here's a sample program that I wrote to see the hex code for the unicode.
Expand|Select|Wrap|Line Numbers
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3.     char c = 'ค';
  4.     MessageBox.Show("0x" + Convert.ToInt32(c).ToString("X4"));
  5. }
The above seems too complicated, I thought c.ToString("X") would work, but it doesn't. Hope this helps! --Sam
Mar 28 '07 #3
UvT
2
Hi there,
See this link as well. might be helpful.
http://www.microsoft.com/globaldev/reference/oslocversion.mspx#win2k
this tells about code pages available for Windows
Mar 28 '07 #4
Hello again
Thanks for your kind replies. articles and example codes are very useful and currently I'm working on it.

thanks again!!!!
Mar 28 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

27
by: EU citizen | last post by:
Do web pages have to be created in unicode in order to use UTF-8 encoding? If so, can anyone name a free application which I can use under Windows 98 to create web pages?
4
by: Basil | last post by:
Hello. I have compiler BC Builder 6.0. I have an example: #include <strstrea.h> int main () { wchar_t ff = {' s','d ', 'f', 'g', 't'};
1
by: lkrubner | last post by:
>Alan J. Flavell Oct 7 2004, 1:44 pm show options >>On Thu, 7 Oct 2004, Shmuel (Seymour J.) Metz wrote: >> at 08:24 PM, "Alan J. Flavell" <flav...@ph.gla.ac.uk> said: >> >I think you...
1
by: Joerg | last post by:
I am in the process of creating an international GUI application with C# on ..NET1.1 (Win2k), which is supposed to implement a particular look/design. In order to achieve this, I plan amongst...
5
by: wanghz | last post by:
Hello, everyone. I have a problem when I'm processing unicode strings. Is it possible to get the 8bit-string representation of any unicode string? Suppose I get a unicode string: a =...
13
by: Tomás | last post by:
Let's start off with: class Nation { public: virtual const char* GetName() const = 0; } class Norway : public Nation { public: virtual const char* GetName() const
17
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, Wide character and multi-byte character are two popular encoding schemes on Windows. And wide character is using unicode encoding scheme. But each time I feel confused when...
24
by: Donn Ingle | last post by:
Hello, I hope someone can illuminate this situation for me. Here's the nutshell: 1. On start I call locale.setlocale(locale.LC_ALL,''), the getlocale. 2. If this returns "C" or anything...
6
by: geegeegeegee | last post by:
Hi All, I have come across a difficult problem to do with extracting UniCode characters from RTF strings. A detailed description of my problem is below, if anyone could help, it would be much...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.