473,473 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Displaying a unicode character

Hi,
I'm just trying to do something very simple, but I can't find a simple
example. In a TextBox and Button on a WinForm, I just want to display some
Unicode characters -- specifically, U+2660, U+2663, U+2665 and U+2666 (the
playing card symbols).

It's my understanding that all strings is .NET are unicode strings. Is that
correct?

Currently I have the unicode characters as input to some strings:
E.g.

string s = "â™*♣♥♦"; // weird, this text box doesn't recognize the diamond
symbol

Then, I simply want to display those characters in a textbox:

textBox1.AppendText(s);

So, what other steps along the way do I need to do?

Thanks,
Nov 22 '05 #1
2 2675
Quimbly <Qu*****@discussions.microsoft.com> wrote:
I'm just trying to do something very simple, but I can't find a simple
example. In a TextBox and Button on a WinForm, I just want to display some
Unicode characters -- specifically, U+2660, U+2663, U+2665 and U+2666 (the
playing card symbols).

It's my understanding that all strings is .NET are unicode strings. Is that
correct?

Currently I have the unicode characters as input to some strings:
E.g.

string s = "????"; // weird, this text box doesn't recognize the diamond
symbol

Then, I simply want to display those characters in a textbox:

textBox1.AppendText(s);

So, what other steps along the way do I need to do?


Set the font to one which supports those symbols. You might want to use
CharMap to work that out.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Nov 22 '05 #2
> string s = "â™*♣♥♦";
Try string s = "\u2660\u2663\u2665\u2666";
The strings are Unicode, but your source file is not.

--
Mihai Nita [Microsoft MVP, Windows - SDK]
------------------------------------------
Replace _year_ with _ to get the real email
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: S. | last post by:
if in my website i am using the sgml { notation, is it accurate to say to my users that the site uses unicode or that it requires unicode? is there a mathematical formula to calculate a unicode...
4
by: Sam | last post by:
Is there a way to display Asian fonts in Access 97? If not, how about subsequent versions? One thought is I was able to display Asian fonts in Visual Basic using a browser control, which in turn...
3
by: Kidus Yared | last post by:
I am having a problem displaying Unicode characters on my Forms labels and buttons. After coding Button1.Text = unicode; where the unicode is a Unicode character or string (‘\u1234’ or...
0
by: Coco | last post by:
Hi! I have been searching for solution for the problem i am facing in displaying chinese character in my aspx page initially when i created the aspx page with some chinese chaarcter, it worked...
6
by: Jonas | last post by:
Hi! I'm developing an ASP.NET application that fetches Unicode string data from a SQL Server. I'm using "Lucinda Sans Unicode" as the font for my web pages but when I have a string containing...
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
7
by: 7stud | last post by:
Based on this example and the error: ----- u_str = u"abc\u9999" print u_str UnicodeEncodeError: 'ascii' codec can't encode character u'\u9999' in position 3: ordinal not in range(128) ------
5
by: tushar.saxena | last post by:
This post is a follow up to the post at : http://groups.google.com/group/comp.lang.c++/browse_thread/thread/83af6123fa945e8b?hl=ug#9eaa6fab5622424e as my original question was answered there, but I...
3
by: gregpinero | last post by:
I want to make a little Python utility where a user can enter the unicode numerical code and get the actual symbol back in utf-8. For example, a user could enter something like u221E And get...
3
by: =?Utf-8?B?UmljaA==?= | last post by:
I copied a down arrow triangle symbol from the character map and added this symbol to a menu Item on a menustrip on a form in my app. On saving the project a dialogbox asked if I wanted 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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.