Home All Groups Group Topic Archive Search About

unicode character problem

Author
12 Jan 2005 11:40 AM
sheena
Hi,

I am finding that quite a few unicode characters are not being
recognised in my .NET c# application.

Here's a snippet that demonstrates my problem:

String sigma_str = "Sigma (\x03a3)";
String pi_str = "Pi (\x03a0)";
String str = sigma_str + " : " + pi_str;
Console.WriteLine(str);

Here's the output:

Sigma (S) : Pi (?)

-------------------------------------
Why is Pi shown as a question mark?

Thanks,

Author
12 Jan 2005 12:50 PM
Morten Wennevik
Hi Sheena,

There is no ASCII translation for PI.  The question mark is an indication 
that the unicode character does not exist or cannot be shown with the 
current codepage.

In fact, even a MessageBox for some odd reason does not display either 
Sigma nor PI, but using Graphics.DrawString you can see them fine.


On 12 Jan 2005 03:40:26 -0800, sheena <sheena.ritc***@gmail.com> wrote:

Show quote
> Hi,
>
> I am finding that quite a few unicode characters are not being
> recognised in my .NET c# application.
>
> Here's a snippet that demonstrates my problem:
>
> String sigma_str = "Sigma (\x03a3)";
> String pi_str = "Pi (\x03a0)";
> String str = sigma_str + " : " + pi_str;
> Console.WriteLine(str);
>
> Here's the output:
>
> Sigma (S) : Pi (?)
>
> -------------------------------------
> Why is Pi shown as a question mark?
>
> Thanks,
>



--
Happy Coding!
Morten Wennevik [C# MVP]
Author
12 Jan 2005 3:25 PM
sheena
Hi,

Ah well, that explains that.

Thanks,

Sheena

Morten Wennevik wrote:
Show quote
> Hi Sheena,
>
> There is no ASCII translation for PI.  The question mark is an
indication
> that the unicode character does not exist or cannot be shown with the

> current codepage.
>
> In fact, even a MessageBox for some odd reason does not display
either
> Sigma nor PI, but using Graphics.DrawString you can see them fine.
>
>
> On 12 Jan 2005 03:40:26 -0800, sheena <sheena.ritc***@gmail.com>
wrote:
>
> > Hi,
> >
> > I am finding that quite a few unicode characters are not being
> > recognised in my .NET c# application.
> >
> > Here's a snippet that demonstrates my problem:
> >
> > String sigma_str = "Sigma (\x03a3)";
> > String pi_str = "Pi (\x03a0)";
> > String str = sigma_str + " : " + pi_str;
> > Console.WriteLine(str);
> >
> > Here's the output:
> >
> > Sigma (S) : Pi (?)
> >
> > -------------------------------------
> > Why is Pi shown as a question mark?
> >
> > Thanks,
> >
>
>
>
> --
> Happy Coding!
> Morten Wennevik [C# MVP]

AddThis Social Bookmark Button