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

vim-6.0t: patch for Cygwin of Japanese Windows

Expand Messages
  • Yasushi Higuchi
    Hello. It becomes the following when vim-6.0t is made to work on Cygwin of Japanese edition Windows. * set charcode=japan - euc-jp. * console of Japanese
    Message 1 of 8 , Jan 23, 2001
    • 0 Attachment
      Hello.

      It becomes the following when vim-6.0t is made to work on Cygwin of
      Japanese edition Windows.

      * set charcode=japan -> euc-jp.
      * console of Japanese Windows can't display euc-jp.

      So, it tried to make the following patch.

      * set charcode=japan -> cp932. (fileio.c)
      * #ifdef is added so that it can handle cp932 properly. (multibyte.c)

      screenshot:
      http://www2.raidway.ne.jp/%7Eyzone/bin/vim60t-cygwin-jp.jpg
      (use libiconv-1.5.1)

      # I am sorry for me if it is a funny sentence because it isn't accustomed
      # to English.


      --- ../../vim60t.org/src/multibyte.c Mon Jan 15 04:49:30 2001
      +++ multibyte.c Tue Jan 23 18:29:40 2001
      @@ -13,7 +13,7 @@
      #include "vim.h"
      #include "globals.h"
      #include "option.h"
      -#ifdef WIN32
      +#if defined(WIN32) || defined(__CYGWIN__)
      # include <windows.h>
      #ifndef __MINGW32__
      # include <winnls.h>
      @@ -173,7 +173,7 @@
      #endif
      else
      {
      -#ifdef WIN32
      +#if defined(WIN32) || defined(__CYGWIN__)
      /* cc_dbcs is set by setting 'filecharcode'. It becomes a Windows
      * CodePage identifier, which we can pass directly in to Windows
      * API */
      @@ -305,7 +305,7 @@
      unsigned char tb = trail;

      /* convert process code to JIS */
      -# if defined(WIN32) || defined(macintosh)
      +# if defined(WIN32) || defined(macintosh) || defined(__CYGWIN__)
      /* process code is SJIS */
      if (lb <= 0x9f)
      lb = (lb - 0x81) * 2 + 0x21;
      @@ -393,7 +393,7 @@
      if (c1 >= 0xB0 && c1 <= 0xC8)
      /* Hangul */
      return 20;
      -#ifdef WIN32
      +#if defined(WIN32) || defined(__CYGWIN__)
      else if (c1 <= 0xA0 || c2 <= 0xA0)
      /* Extended Hangul Region : MS UHC(Unified Hangul Code) */
      /* c1: 0x81-0xA0 with c2: 0x41-0x5A, 0x61-0x7A, 0x81-0xFE
      --- ../../vim60t.org/src/fileio.c Mon Jan 22 03:25:13 2001
      +++ fileio.c Tue Jan 23 18:29:40 2001
      @@ -7049,7 +7049,7 @@
      {"ucs-4bl", "ucs-4"},
      {"ucs-4lb", "ucs-4"},
      {"unicode", "ucs-2"},
      -#ifdef WIN32
      +#if defined(WIN32) || defined(__CYGWIN__)
      {"japan", "cp932"},
      #else
      {"japan", "euc-jp"},


      --
      Yasushi HIGUCHI
    • Bram Moolenaar
      ... I assume you have used the Unix Makefile instead of Make_cyg.mak. Otherwise WIN32 would have been defined. Is there a specific reason to use the Unix
      Message 2 of 8 , Jan 23, 2001
      • 0 Attachment
        Yasushi Higuchi wrote:

        > It becomes the following when vim-6.0t is made to work on Cygwin of
        > Japanese edition Windows.
        >
        > * set charcode=japan -> euc-jp.
        > * console of Japanese Windows can't display euc-jp.
        >
        > So, it tried to make the following patch.
        >
        > * set charcode=japan -> cp932. (fileio.c)
        > * #ifdef is added so that it can handle cp932 properly. (multibyte.c)

        I assume you have used the Unix Makefile instead of Make_cyg.mak. Otherwise
        WIN32 would have been defined. Is there a specific reason to use the Unix
        Makefile? Did you try using Make_cyg.mak?

        > screenshot:
        > http://www2.raidway.ne.jp/%7Eyzone/bin/vim60t-cygwin-jp.jpg
        > (use libiconv-1.5.1)

        Looks good. I'm glad it's all working for you.

        --
        I think that you'll agree that engineers are very effective in their social
        interactions. It's the "normal" people who are nuts.
        (Scott Adams - The Dilbert principle)

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
        \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
      • Yasushi Higuchi
        On Tue, 23 Jan 2001 19:16:01 +0100 ... vim.exe made by Make_cyg.mak is pure Win32 application. In other words, the virtual tty of Cygwin isn t used to use
        Message 3 of 8 , Jan 23, 2001
        • 0 Attachment
          On Tue, 23 Jan 2001 19:16:01 +0100
          Bram Moolenaar <Bram@...> wrote:

          >I assume you have used the Unix Makefile instead of Make_cyg.mak. Otherwise
          >WIN32 would have been defined. Is there a specific reason to use the Unix
          >Makefile? Did you try using Make_cyg.mak?

          vim.exe made by Make_cyg.mak is pure Win32 application.
          In other words, the virtual tty of Cygwin isn't used to use
          Console API directly.

          When inetd for Cygwin is used, login is done with telnet, and it
          can't be used.
          But, vim.exe that it was formed with Unix Makefile can be used.

          sample screenshot:
          http://www2.raidway.ne.jp/%7Eyzone/bin/vim60t-cygwin-telnet.jpg

          --
          Yasushi HIGUCHI (yzone@...)
        • Bram Moolenaar
          ... OK, so you used the Unix Makefile on purpose. I wonder if there are more places where #ifdef WIN32 is used should also check for __CYGWIN__. Would there
          Message 4 of 8 , Jan 23, 2001
          • 0 Attachment
            Yasushi Higuchi wrote:

            > On Tue, 23 Jan 2001 19:16:01 +0100
            > Bram Moolenaar <Bram@...> wrote:
            >
            > >I assume you have used the Unix Makefile instead of Make_cyg.mak. Otherwise
            > >WIN32 would have been defined. Is there a specific reason to use the Unix
            > >Makefile? Did you try using Make_cyg.mak?
            >
            > vim.exe made by Make_cyg.mak is pure Win32 application.
            > In other words, the virtual tty of Cygwin isn't used to use
            > Console API directly.
            >
            > When inetd for Cygwin is used, login is done with telnet, and it
            > can't be used.
            > But, vim.exe that it was formed with Unix Makefile can be used.
            >
            > sample screenshot:
            > http://www2.raidway.ne.jp/%7Eyzone/bin/vim60t-cygwin-telnet.jpg

            OK, so you used the Unix Makefile on purpose.

            I wonder if there are more places where "#ifdef WIN32" is used should also
            check for __CYGWIN__. Would there be a general rule?

            Perhaps it's better to use some other define for code that's used both for
            Unix and WIN32 with the Unix Makefile. WIN32UNIX?

            --
            Never enter the boss's office unless it's absolutely necessary. Every boss
            saves one corner of the desk for useless assignments that are doled out like
            Halloween candy to each visitor.
            (Scott Adams - The Dilbert principle)

            /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
            ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
            \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
          • Bram Moolenaar
            ... [...] ... I now noticed that the code already contains checks for __CYGWIN32__. What is the difference between __CYGWIN__ and __CYGWIN32__? --
            Message 5 of 8 , Jan 24, 2001
            • 0 Attachment
              Yasushi Higuchi wrote:

              > It becomes the following when vim-6.0t is made to work on Cygwin of
              > Japanese edition Windows.
              [...]

              > -#ifdef WIN32
              > +#if defined(WIN32) || defined(__CYGWIN__)

              I now noticed that the code already contains checks for __CYGWIN32__. What
              is the difference between __CYGWIN__ and __CYGWIN32__?

              --
              hundred-and-one symptoms of being an internet addict:
              5. You find yourself brainstorming for new subjects to search.

              /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
              ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
              \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
            • Yasushi Higuchi
              On Tue, 23 Jan 2001 21:40:57 +0100 ... I don t know whether there is a general way of solving it. But, it has the memory of doing the check of Cygwin/Mingw32
              Message 6 of 8 , Jan 24, 2001
              • 0 Attachment
                On Tue, 23 Jan 2001 21:40:57 +0100
                Bram Moolenaar <Bram@...> wrote:

                >I wonder if there are more places where "#ifdef WIN32" is used should also
                >check for __CYGWIN__. Would there be a general rule?

                I don't know whether there is a general way of solving it.
                But, it has the memory of doing the check of Cygwin/Mingw32 in configure
                of bash-2.04.
                It may become a hint.

                >Perhaps it's better to use some other define for code that's used both for
                >Unix and WIN32 with the Unix Makefile. WIN32UNIX?

                Though my thought was silly, we seem to have a problem to think about still
                in relation to this.

                Many Japanese Unix users are using 'LANG=ja_JP.eucJP'.
                When those users do telnet to Cygwin, vim fixed on shift-jis is inconvenient.
                It thinks that the structure which the movement of vim changes how to
                indicate it to dynamically is necessary in accordance with LANG.

                Therefore, it may be dangerous that merge does my patch right now.
                I don't hit upon the good idea to solve this right now.
                Won't you ignore the patch until the better way of solving it is found?

                --
                Yasushi HIGUCHI (yzone@...)
              • Yasushi Higuchi
                On Wed, 24 Jan 2001 12:26:46 +0100 ... __CYGWIN32__ is obsolete. It will be removed by the thing left for the interchangeability in the future. __CYGWIN__
                Message 7 of 8 , Jan 24, 2001
                • 0 Attachment
                  On Wed, 24 Jan 2001 12:26:46 +0100
                  Bram Moolenaar <Bram@...> wrote:

                  >I now noticed that the code already contains checks for __CYGWIN32__. What
                  >is the difference between __CYGWIN__ and __CYGWIN32__?

                  '__CYGWIN32__' is obsolete.
                  It will be removed by the thing left for the interchangeability in the future.
                  '__CYGWIN__' is recommended with present Cygwin.

                  --
                  Yasushi HIGUCHI (yzone@...)
                • Bram Moolenaar
                  ... The idea is that charcode is set to the encoding of the terminal you are using. There is no translation or conversion when sending the text to the
                  Message 8 of 8 , Jan 24, 2001
                  • 0 Attachment
                    Yasushi Higuchi wrote:

                    > Though my thought was silly, we seem to have a problem to think about still
                    > in relation to this.
                    >
                    > Many Japanese Unix users are using 'LANG=ja_JP.eucJP'.
                    > When those users do telnet to Cygwin, vim fixed on shift-jis is inconvenient.
                    > It thinks that the structure which the movement of vim changes how to
                    > indicate it to dynamically is necessary in accordance with LANG.
                    >
                    > Therefore, it may be dangerous that merge does my patch right now.
                    > I don't hit upon the good idea to solve this right now.
                    > Won't you ignore the patch until the better way of solving it is found?

                    The idea is that 'charcode' is set to the encoding of the terminal you are
                    using. There is no translation or conversion when sending the text to the
                    display. The encoding of what the user types would be the same too.

                    If you do a telnet, you use the terminal you started it in, right? That would
                    mean the use of "cp932" or "euc_jp" depends on which terminal is being used and
                    shouldn't be compile time choice but a runtime one.

                    I can change this, but it will be work. I first need to know if this is
                    really the right solution.

                    By the way, don't the "euc-kr" and "euc-tw" have similar problems?

                    --
                    hundred-and-one symptoms of being an internet addict:
                    11. You find yourself typing "com" after every period when using a word
                    processor.com

                    /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                    ((( Creator of Vim - http://www.vim.org -- ftp://ftp.vim.org/pub/vim )))
                    \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
                  Your message has been successfully submitted and would be delivered to recipients shortly.