Char... Unicode version (bug?): what about 2.0?

D

Dan

Hi all, I'd like to submit what it seems to be a bug as for the Unicode
compliance of methods like Char.Is...: as stated by the latest version of
Unicode, codes +03F2 and +03F9 represent Greek lunate sigma, lowercase and
uppercase respectively (c and C). For these codes I get the following
results:

+03F2: lowercase c:
Char.IsLetter() = true (OK)
Char.IsUpper() = false (OK)
Char.IsLower() = true (OK)
Char.ToUpper('\x3f2') and .ToLower both = +03F2 (! I'd expect +03F9 for
ToUpper)

+03F9: uppercase C:
Char.IsLetter() = false (!)
Char.IsUpper() = false (!)
Char.IsLower() = false (OK)
Char.ToUpper('\x3f9') and .ToLower both = +03F9 (! I'd expect +03F2 for
ToLower)

It appears that +03F9 is not treated as a 'letter' as it happens for +03F2,
which seems deprived of its capital form. I'd like to know if this is an
issue coming from an older Unicode version or it's just a bug or by some
design choice I can't catch, and if anyone using the .NET 2 Beta can tell me
how .NET 2.0 behaves about this.
If you 2.0 guys are as lazy as me, try the following code fragment to have a
test (just paste it into a console app):

static private void DumpSingleChar(char c)
{
Console.WriteLine("IsLetter = {0}", Char.IsLetter(c));
Console.WriteLine("IsUpper = {0}", Char.IsUpper(c));
Console.WriteLine("IsLower = {0}", Char.IsLower(c));
Console.WriteLine("ToUpper = {0:X4}", (int)Char.ToUpper(c));
Console.WriteLine("ToLower = {0:X4}", (int)Char.ToLower(c));
}

[STAThread]
static void Main(string[] args)
{
Console.WriteLine("+03F2");
DumpSingleChar('\x3F2');

Console.WriteLine("+03F9");
DumpSingleChar('\x3F9');
}

Thanx!
 
C

Christoph Nahr

Hi all, I'd like to submit what it seems to be a bug as for the Unicode
compliance of methods like Char.Is...: as stated by the latest version of
Unicode, codes +03F2 and +03F9 represent Greek lunate sigma, lowercase and
uppercase respectively (c and C).

If this is a reproducible bug you should definitely submit it to the
MSDN Product Feedback Center:
http://lab.msdn.microsoft.com/productfeedback/

I don't think any new bugs will get fixed for VS 2005 but Microsoft
might fix it in a service pack or a later version.
 
D

Dan

Thank you both! I'll have to stick to another (custom) solution for my
projects, but it is a good idea to submit this issue to MS, I'll do it as
soon as I've verified that the behaviour is the same in VS2005 (I must get
the Beta and install it in a non-production machine first... in the
meanwhile, if anyone gives a try to the code I posted earlier in .NET 2.0
please drop me a line about its behaviour...)

Happy coding to all!
 
W

Willy Denoyette [MVP]

Dan said:
Thank you both! I'll have to stick to another (custom) solution for my
projects, but it is a good idea to submit this issue to MS, I'll do it as
soon as I've verified that the behaviour is the same in VS2005 (I must get
the Beta and install it in a non-production machine first... in the
meanwhile, if anyone gives a try to the code I posted earlier in .NET 2.0
please drop me a line about its behaviour...)

Happy coding to all!

Dan,

The v2.0 behaves just like v1.x.


+03F2
IsLetter = True
IsUpper = False
IsLower = True
ToUpper = 03F2
ToLower = 03F2

+03F9
IsLetter = False
IsUpper = False
IsLower = False
ToUpper = 03F9
ToLower = 03F9


Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top