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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dan

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

    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.WriteLi ne("IsLetter = {0}", Char.IsLetter(c ));
    Console.WriteLi ne("IsUpper = {0}", Char.IsUpper(c) );
    Console.WriteLi ne("IsLower = {0}", Char.IsLower(c) );
    Console.WriteLi ne("ToUpper = {0:X4}", (int)Char.ToUpp er(c));
    Console.WriteLi ne("ToLower = {0:X4}", (int)Char.ToLow er(c));
    }

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

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

    Thanx!


  • Morten Wennevik

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

    Hi Dan,

    I'm afraid the capital lunate sigma is not supported in the unicode version used by .NET Framework 1.1 and perhaps even 2.0. As far as I can tell Unicode version 3.1 is used by .NET Framework 1.1, and the behaviour is the same in 2.0.




    --
    Happy coding!
    Morten Wennevik [C# MVP]

    Comment

    • Morten Wennevik

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

      Hi Dan,

      I'm afraid the capital lunate sigma is not supported in the unicode version used by .NET Framework 1.1 and perhaps even 2.0. As far as I can tell Unicode version 3.1 is used by .NET Framework 1.1, and the behaviour is the same in 2.0.




      --
      Happy coding!
      Morten Wennevik [C# MVP]

      Comment

      • Christoph Nahr

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

        On Tue, 23 Aug 2005 18:01:58 +0200, "Dan" <fusi.daniele@t iscali.it>
        wrote:
        [color=blue]
        >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).[/color]

        If this is a reproducible bug you should definitely submit it to the
        MSDN Product Feedback Center:


        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.
        --
        Stay ahead in World of Warcraft with expert guides, latest patch news, class tips, dungeon strategies, PvP builds, and The War Within updates—all in one place.

        Comment

        • Christoph Nahr

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

          On Tue, 23 Aug 2005 18:01:58 +0200, "Dan" <fusi.daniele@t iscali.it>
          wrote:
          [color=blue]
          >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).[/color]

          If this is a reproducible bug you should definitely submit it to the
          MSDN Product Feedback Center:


          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.
          --
          Stay ahead in World of Warcraft with expert guides, latest patch news, class tips, dungeon strategies, PvP builds, and The War Within updates—all in one place.

          Comment

          • Dan

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

            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!


            Comment

            • Dan

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

              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!


              Comment

              • Willy Denoyette [MVP]

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

                I don't think it's a bug, .NET v2.0 is Unicode 3.1 based and U+03F9 is a
                4.0.0 codepoint.
                Anyway, like Christoph said, you can always file an issue to


                Willy.


                "Dan" <fusi.daniele@t iscali.it> wrote in message
                news:430b485f$0 $8476$5fc30a8@n ews.tiscali.it. ..[color=blue]
                > 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.WriteLi ne("IsLetter = {0}", Char.IsLetter(c ));
                > Console.WriteLi ne("IsUpper = {0}", Char.IsUpper(c) );
                > Console.WriteLi ne("IsLower = {0}", Char.IsLower(c) );
                > Console.WriteLi ne("ToUpper = {0:X4}", (int)Char.ToUpp er(c));
                > Console.WriteLi ne("ToLower = {0:X4}", (int)Char.ToLow er(c));
                > }
                >
                > [STAThread]
                > static void Main(string[] args)
                > {
                > Console.WriteLi ne("+03F2");
                > DumpSingleChar( '\x3F2');
                >
                > Console.WriteLi ne("+03F9");
                > DumpSingleChar( '\x3F9');
                > }
                >
                > Thanx!
                >[/color]


                Comment

                • Willy Denoyette [MVP]

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

                  I don't think it's a bug, .NET v2.0 is Unicode 3.1 based and U+03F9 is a
                  4.0.0 codepoint.
                  Anyway, like Christoph said, you can always file an issue to


                  Willy.


                  "Dan" <fusi.daniele@t iscali.it> wrote in message
                  news:430b485f$0 $8476$5fc30a8@n ews.tiscali.it. ..[color=blue]
                  > 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.WriteLi ne("IsLetter = {0}", Char.IsLetter(c ));
                  > Console.WriteLi ne("IsUpper = {0}", Char.IsUpper(c) );
                  > Console.WriteLi ne("IsLower = {0}", Char.IsLower(c) );
                  > Console.WriteLi ne("ToUpper = {0:X4}", (int)Char.ToUpp er(c));
                  > Console.WriteLi ne("ToLower = {0:X4}", (int)Char.ToLow er(c));
                  > }
                  >
                  > [STAThread]
                  > static void Main(string[] args)
                  > {
                  > Console.WriteLi ne("+03F2");
                  > DumpSingleChar( '\x3F2');
                  >
                  > Console.WriteLi ne("+03F9");
                  > DumpSingleChar( '\x3F9');
                  > }
                  >
                  > Thanx!
                  >[/color]


                  Comment

                  • Willy Denoyette [MVP]

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


                    "Dan" <fusi.daniele@t iscali.it> wrote in message
                    news:430c2a74$0 $8478$5fc30a8@n ews.tiscali.it. ..[color=blue]
                    > 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!
                    >[/color]

                    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.


                    Comment

                    • Willy Denoyette [MVP]

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


                      "Dan" <fusi.daniele@t iscali.it> wrote in message
                      news:430c2a74$0 $8478$5fc30a8@n ews.tiscali.it. ..[color=blue]
                      > 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!
                      >[/color]

                      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.


                      Comment

                      Working...