Hi,
I have the problem that a char ch2 = '\u0041' is confirmed as a character and also printed as "A", but the char ch3 = '\u00c6' , which is also confirmed as a character, is not printed only as a "?" where it is supposed to be a "æ".
I know I have missed some thing, probably fundamental, but what?
My best try is to convert to a string, but that is not working either - or I also do that wrong...
Any help or hint is greatly appreciated.
The program is as follows (I´m sorry, can´t get the linenumbers copied):
using System;
using System.Globalization;
namespace lektion2
{
class MainClass
{
public static void Main ()
{
char ch1 = 'A',
ch2 = '\u0041',
ch3 = '\u00c6', ch4 = '\u00d8', ch5 = '\u00c5', ch6;
Console.WriteLine("ch1 is a letter: {0}", char.IsLetter(ch1));
Console.WriteLine("ch2 is a letter: {0}", char.IsLetter(ch2));
Console.WriteLine("ch3 is a letter? : {0}", char.IsLetter(ch3));
Console.WriteLine("ch4 is a letter? : {0}", char.IsLetter(ch4));
Console.WriteLine("ch5 is a letter? : {0}", char.IsLetter(ch5));
Console.WriteLine("The \u0041 is {0}", (ch2));
string s1 = char.ToString(ch3);
Console.WriteLine("The ch3 is {0}", s1);
ch6 = char.Parse("B");
Console.WriteLine("Numreric value of 3 is: {0},\nand 'a' has the numeric value: {1}", char.GetNumericValue('3'),
char.GetNumericValue('a'));
Console.WriteLine("ch6 is a letter: {0}", char.IsLetter(ch6));
}
}
}
And the output:
ch1 is a letter: True
ch2 is a letter: True
ch3 is a letter? : True
ch4 is a letter? : True
ch5 is a letter? : True
The A is A
The ch3 is ?
Numreric value of 3 is: 3,
and 'a' has the numeric value: -1
ch6 is a letter: True