On 9/11/07, Edward L. Fox <[EMAIL PROTECTED]> wrote:
> Hi Bram,
>
> On 9/11/07, Bram Moolenaar <[EMAIL PROTECTED]> 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);
Index: screen.c
===================================================================
--- screen.c    (revision 513)
+++ screen.c    (working copy)
@@ -2304,10 +2304,12 @@
                    else
                        prev_c = u8c;
 #endif
+#ifdef UNICODE16
                    /* Non-BMP character: display as ? or fullwidth ?. */
                    if (u8c >= 0x10000)
-                       ScreenLinesUC[idx] = (cells == 2) ? 0xff1f : (int)'?';
+                       ScreenLinesUC[idx] = (cells == 2) ? 0xff1f : (int)'?';
                    else
+#endif
                        ScreenLinesUC[idx] = u8c;
                    for (i = 0; i < Screen_mco; ++i)
                    {
@@ -3678,25 +3680,32 @@
                    if ((mb_l == 1 && c >= 0x80)
                            || (mb_l >= 1 && mb_c == 0)
                            || (mb_l > 1 && (!vim_isprintc(mb_c)
-                                                        || mb_c >= 0x10000)))
+#ifdef UNICODE16
+                                                || mb_c >= 0x10000
+#endif
+                                    )))
                    {
                        /*
                         * Illegal UTF-8 byte: display as <xx>.
                         * Non-BMP character : display as ? or fullwidth ?.
                         */
+#ifdef UNICODE16
                        if (mb_c < 0x10000)
                        {
+#endif
                            transchar_hex(extra, mb_c);
 # ifdef FEAT_RIGHTLEFT
                            if (wp->w_p_rl)             /* reverse */
                                rl_mirror(extra);
 # endif
+#ifdef UNICODE16
                        }
                        else if (utf_char2cells(mb_c) != 2)
                            STRCPY(extra, "?");
                        else
                            /* 0xff1f in UTF-8: full-width '?' */
                            STRCPY(extra, "\357\274\237");
+#endif

                        p_extra = extra;
                        c = *p_extra;
@@ -6246,12 +6255,14 @@
                    u8c = utfc_ptr2char(ptr, u8cc);
                mbyte_cells = utf_char2cells(u8c);
                /* Non-BMP character: display as ? or fullwidth ?. */
+#ifdef UNICODE16
                if (u8c >= 0x10000)
                {
                    u8c = (mbyte_cells == 2) ? 0xff1f : (int)'?';
                    if (attr == 0)
                        attr = hl_attr(HLF_8);
                }
+#endif
 # ifdef FEAT_ARABIC
                if (p_arshape && !p_tbidi && ARABIC_CHAR(u8c))
                {
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;
            }


> [...]

Regards,

Edward L. Fox

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui