Loading ...
Sorry, an error occurred while loading the content.
 

Re: Handling Unicode codepoints outside the BMP

Expand Messages
  • Bram Moolenaar
    ... Yes. -- MORTICIAN: What? CUSTOMER: Nothing -- here s your nine pence. DEAD PERSON: I m not dead! MORTICIAN: Here -- he says he s not dead!
    Message 1 of 5 , Sep 11, 2007
      Edward L. Fox wrote:

      > On 9/11/07, Bram Moolenaar <Bram@...> wrote:
      > > [...]
      > > Thanks for looking into this. Looks good. Except that a check for
      > > UNICODE16 is needed, if that is defined then we really can use only 16
      > > bits.
      >
      > Do you mean this?

      Yes.

      --
      MORTICIAN: What?
      CUSTOMER: Nothing -- here's your nine pence.
      DEAD PERSON: I'm not dead!
      MORTICIAN: Here -- he says he's not dead!
      CUSTOMER: Yes, he is.
      DEAD PERSON: I'm not!
      The Quest for the Holy Grail (Monty Python)

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ download, build and distribute -- http://www.A-A-P.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Bram Moolenaar
      ... Only two bytes are put in buf[], thus more needs to be changed here to make it work. ... Here too. -- Shit makes the flowers grow and that s beautiful ///
      Message 2 of 5 , Sep 11, 2007
        Edward L. Fox wrote:

        > On 9/11/07, Edward L. Fox <edyfox@...> wrote:
        > > Hi Bram,
        > >
        > > On 9/11/07, Bram Moolenaar <Bram@...> wrote:
        > > > [...]
        > > > Thanks for looking into this. Looks good. Except that a check for
        > > > UNICODE16 is needed, if that is defined then we really can use only 16
        > > > bits.
        >
        > Hmmm... It seems that more files need to be patched:
        >
        > Index: gui_gtk_x11.c
        > ===================================================================
        > --- gui_gtk_x11.c (revision 513)
        > +++ gui_gtk_x11.c (working copy)
        > @@ -6070,8 +6070,10 @@
        > if (enc_utf8)
        > {
        > c = utf_ptr2char(p);
        > +#ifdef UNICODE16
        > if (c >= 0x10000) /* show chars > 0xffff as ? */
        > c = 0xbf;
        > +#endif
        > buf[textlen].byte1 = c >> 8;
        > buf[textlen].byte2 = c;
        > p += utf_ptr2len(p);

        Only two bytes are put in buf[], thus more needs to be changed here to
        make it work.

        > Index: gui_x11.c
        > ===================================================================
        > --- gui_x11.c (revision 513)
        > +++ gui_x11.c (working copy)
        > @@ -2562,15 +2562,19 @@
        > # ifdef FEAT_XFONTSET
        > if (current_fontset != NULL)
        > {
        > - if (c >= 0x10000 && sizeof(wchar_t) <= 2)
        > +#ifdef UNICODE16
        > + if (c >= 0x10000)
        > c = 0xbf; /* show chars > 0xffff as ? */
        > +#endif
        > ((wchar_t *)buf)[wlen] = c;
        > }
        > else
        > # endif
        > {
        > +#ifdef UNICODE16
        > if (c >= 0x10000)
        > c = 0xbf; /* show chars > 0xffff as ? */
        > +#endif
        > ((XChar2b *)buf)[wlen].byte1 = (unsigned)c >> 8;
        > ((XChar2b *)buf)[wlen].byte2 = c;
        > }

        Here too.

        --
        Shit makes the flowers grow and that's beautiful

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Bram Moolenaar
        ... Ehm, are you just guessing here? You better find a way to test it. I don t want to include this without testing. I doubt X11 uses UTF-16, that is
        Message 3 of 5 , Sep 11, 2007
          Edward L. Fox wrote:

          > On 9/11/07, Bram Moolenaar <Bram@...> wrote:
          > > [...]
          > >
          > > Only two bytes are put in buf[], thus more needs to be changed here to
          > > make it work.
          > >
          > > [...]
          > >
          > > Here too.
          > > [...]
          >
          > I don't know how to deal with the characters outside BMP for XChar2b.
          > I just assume that it is UTF-16. Please help me check this patch:

          Ehm, are you just guessing here? You better find a way to test it.
          I don't want to include this without testing.

          I doubt X11 uses UTF-16, that is something that MS-Windows uses. GTK
          uses utf-8 in most places. Other X11 toolkits probably differ, since
          they are older.

          --
          DEAD PERSON: I'm getting better!
          CUSTOMER: No, you're not -- you'll be stone dead in a moment.
          MORTICIAN: Oh, I can't take him like that -- it's against regulations.
          The Quest for the Holy Grail (Monty Python)

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ download, build and distribute -- http://www.A-A-P.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        Your message has been successfully submitted and would be delivered to recipients shortly.