Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to put unicode characters on a System.Windows.Forms.Button in C#?

In Visual Studio 2008 in a C# WinForms project, there is a button on a form. In the properties view, the property "Font" is set to "Arial Unicode MS".

What do I need to put into the property "Text", so I get the unicode character \u0D15 displayed on the button?

When I put \u0D15 into the "Text" property, the button displays the six characters "\u0D15" instead of one unicode character.

In the following PDF, you can see the unicode character for \u0D15: http://unicode.org/charts/PDF/U0D00.pdf

like image 820
Lernkurve Avatar asked Nov 01 '08 18:11

Lernkurve


People also ask

How do I enter Unicode characters in Windows?

To insert a Unicode character, type the character code, press ALT, and then press X. For example, to type a dollar symbol ($), type 0024, press ALT, and then press X. For more Unicode character codes, see Unicode character code charts by script.

How do I get Unicode characters?

In Microsoft Windows Unicode characters can then be entered by holding down Alt , and typing + on the numeric keypad, followed by the hexadecimal code – using the numeric keypad for digits from 0 to 9 and letter keys for A to F – and then releasing Alt .


1 Answers

You don't have to escape your unicode characters in strings as C# is inherently unicode. Just put your unicode characters as they are into the string. For example:

button1.Text = "日本";
like image 177
Tamas Czinege Avatar answered Oct 12 '22 11:10

Tamas Czinege