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

MacOS X, iconv and gettext emulation

Expand Messages
  • MURAOKA Taro
    I have improved gvim for MacOS X. You can use both iconv and gettext emulations without any extra libraries. Please try and test it. Now, you can get a
    Message 1 of 12 , Jul 1, 2002
    • 0 Attachment
      I have improved gvim for MacOS X. You can use both iconv and gettext
      emulations without any extra libraries. Please try and test it. Now,
      you can get a compressed patch from here:

      http://www.kaoriya.net/testdir/macosx_multilang.tar.gz

      You will be able to compile improved gvim, just apply the patch against
      6.1.118 soruce tree. Command example on your terminal:

      % cd vim61
      % tar xzvf macosx_multilang.tar.gz
      % patch -p0 < macosx_multilang.diff
      % cd src
      % make -f Make_osx.mak

      This will generate gvim.app directory in src. gvim.app will be shown as
      gvim application icon from Finder. You can give some options when
      compile. If you want to get all translated messages, try this command
      when execute make command:

      % make -f Make_osx.mak MULTILANG=all

      See src/Make_osx.mak for more details about compile options.

      I have tested this patch on only MacOS X. So it may cause some troubles
      for classic Macintosh, if you would meet those, please fix and send
      patch.

      Thanks.
      ----
      MURAOKA Taro <koron@...>


      Summary of changes:
      - Add, Makefile for MacOS X.
      - Add, controlled INPUT METHOD, like Windows.
      - Add, inline INPUT METHOD.
      - Add, iconv emulation using MacOS X's TEC Manager.
      - Add, gettext emulation using MacOS X's CFBundle.
      - Add, files and directories required by CFBundle.
      - Add, tools for multi language support.
      - Add, TRACE() for debug.
      - Fix, filepath completion doesn't complete directory separator.
      - Fix, to suppress many compile warings.

      Hint:
      - Set your menu language to 'langmenu' option before menu.vim is
      loaded.
      - If you want to use with europian language, you shoud set
      'encoding' option "MacRoman", which is default encoding on MacOSX.
      - Language which used for message translation is depend on MacOSX
      sytem preferences. See "System Preferences" -> "International" ->
      "Language"
    • Benji Fisher
      ... Thanks, I will try to find time for this soon; maybe not until next week, though. After your previous patch, some of my menus got translated (into
      Message 2 of 12 , Jul 1, 2002
      • 0 Attachment
        On Monday, July 1, 2002, at 10:16 AM, MURAOKA Taro wrote:

        > I have improved gvim for MacOS X. You can use both iconv and gettext
        > emulations without any extra libraries. Please try and test it. Now,
        > you can get a compressed patch from here:
        >
        > http://www.kaoriya.net/testdir/macosx_multilang.tar.gz

        Thanks, I will try to find time for this soon; maybe not until next
        week, though.

        After your previous patch, some of my menus got translated (into
        Japanese?) even though I changed none of the defaults. Should I have
        read the Makefile more carefully, or was this your fault?

        --Benji Fisher
      • Mac Vim Support (Axel Kielhorn)
        ... I have applied the patch and ran into a problem when compiling for classic: diff -cNr src.orig/gui_mac.c src/gui_mac.c ... *************** *** 93,100 ****
        Message 3 of 12 , Jul 6, 2002
        • 0 Attachment
          At 23:16 Uhr +0900 2002-07-01, MURAOKA Taro wrote:
          >I have improved gvim for MacOS X. You can use both iconv and gettext
          >emulations without any extra libraries. Please try and test it. Now,
          >you can get a compressed patch from here:
          >
          > http://www.kaoriya.net/testdir/macosx_multilang.tar.gz
          >

          I have applied the patch and ran into a problem when compiling for classic:

          diff -cNr src.orig/gui_mac.c src/gui_mac.c
          *** src.orig:gui_mac.c Sat Jun 29 17:11:17 2002
          --- :src:gui_mac.c Mon Jul 1 17:26:59 2002
          ***************
          *** 93,100 ****
          /* Include some file. TODO: move into os_mac.h */
          #include <Menus.h>
          #include <Resources.h>
          ! #include <StandardFile.h>
          ! #include <Traps.h>
          #include <Balloons.h>
          #include <Processes.h>
          #ifdef USE_AEVENT
          --- 93,102 ----
          /* Include some file. TODO: move into os_mac.h */
          #include <Menus.h>
          #include <Resources.h>
          ! #if !defined(MACOS_X) && defined(MACOS_X_UNIX)
          ! # include <StandardFile.h>
          ! # include <Traps.h>
          ! #endif
          #include <Balloons.h>
          #include <Processes.h>
          #ifdef USE_AEVENT


          This means <StandardFile.h> and <Traps.h> are not included for MACOS_CLASSIC.
          Are you sure these includes are not needed for MACOS_X?

          Axel
        • MURAOKA Taro
          ... Thank you for notifing this. It is a mistake. I had expected that it means and are not included for MACOS_X, as you guessed.
          Message 4 of 12 , Jul 7, 2002
          • 0 Attachment
            > This means <StandardFile.h> and <Traps.h> are not included for MACOS_CLASSIC.
            > Are you sure these includes are not needed for MACOS_X?

            Thank you for notifing this. It is a mistake. I had expected that it
            means <StandardFile.h> and <Traps.h> are not included for MACOS_X, as
            you guessed. Those two header are not available on Mac OS X, and
            warnings are shown when compile.

            Try to fix this as below.
            ----
            MURAOKA Taro <koron@...>


            diff -ur src.orig/gui_mac.c src/gui_mac.c
            --- src.orig/gui_mac.c Mon Jun 10 09:43:14 2002
            +++ src/gui_mac.c Mon Jun 10 09:43:01 2002
            @@ -93,8 +93,10 @@
            /* Include some file. TODO: move into os_mac.h */
            #include <Menus.h>
            #include <Resources.h>
            -#include <StandardFile.h>
            -#include <Traps.h>
            +#ifndef MACOS_X
            +# include <StandardFile.h>
            +# include <Traps.h>
            +#endif
            #include <Balloons.h>
            #include <Processes.h>
            #ifdef USE_AEVENT
          • Mac Vim Support (Axel Kielhorn)
            ... This compiles as advertized as long as iconv is disabled. When I enable USE_ICONV I get complaints about undefined EINVAL and E2BIG. Both are defined for
            Message 5 of 12 , Jul 7, 2002
            • 0 Attachment
              At 17:18 Uhr +0900 2002-07-07, MURAOKA Taro wrote:
              > > This means <StandardFile.h> and <Traps.h> are not included for
              >MACOS_CLASSIC.
              >> Are you sure these includes are not needed for MACOS_X?
              >
              >Thank you for notifing this. It is a mistake. I had expected that it
              >means <StandardFile.h> and <Traps.h> are not included for MACOS_X, as
              >you guessed. Those two header are not available on Mac OS X, and
              >warnings are shown when compile.
              >
              >Try to fix this as below.

              This compiles as advertized as long as iconv is disabled.

              When I enable USE_ICONV I get complaints about
              undefined EINVAL and E2BIG.

              Both are defined for MPW but not for Codewarrior.
              I guess this means no iconv support for MacOS Classic.

              Axel
            • Bram Moolenaar
              ... In case it s just these two missing, can t you add: #ifndef EINVAL # define EINVAL 22 #endif #ifndef E2BIG # define E2BIG 7 #endif I think the numbers are
              Message 6 of 12 , Jul 9, 2002
              • 0 Attachment
                Axel Kielhorn wrote:

                > At 17:18 Uhr +0900 2002-07-07, MURAOKA Taro wrote:
                > > > This means <StandardFile.h> and <Traps.h> are not included for
                > >MACOS_CLASSIC.
                > >> Are you sure these includes are not needed for MACOS_X?
                > >
                > >Thank you for notifing this. It is a mistake. I had expected that it
                > >means <StandardFile.h> and <Traps.h> are not included for MACOS_X, as
                > >you guessed. Those two header are not available on Mac OS X, and
                > >warnings are shown when compile.
                > >
                > >Try to fix this as below.
                >
                > This compiles as advertized as long as iconv is disabled.
                >
                > When I enable USE_ICONV I get complaints about
                > undefined EINVAL and E2BIG.
                >
                > Both are defined for MPW but not for Codewarrior.
                > I guess this means no iconv support for MacOS Classic.

                In case it's just these two missing, can't you add:

                #ifndef EINVAL
                # define EINVAL 22
                #endif
                #ifndef E2BIG
                # define E2BIG 7
                #endif

                I think the numbers are the same everywhere. Even better is when you
                have an "errno.h" file to include.

                --
                Biting someone with your natural teeth is "simple assault," while biting
                someone with your false teeth is "aggravated assault."
                [real standing law in Louisana, United States of America]

                /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
                \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
                \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
              • Mac Vim Support (Axel Kielhorn)
                ... I have an errno.h file and it #define EINVAL 9 only for __dest_os == __win32_os I ll try again with EINVAL and E2BIG defined as above. Axel
                Message 7 of 12 , Jul 11, 2002
                • 0 Attachment
                  At 11:38 Uhr +0200 2002-07-09, Bram Moolenaar wrote:
                  >
                  >In case it's just these two missing, can't you add:
                  >
                  >#ifndef EINVAL
                  ># define EINVAL 22
                  >#endif
                  >#ifndef E2BIG
                  ># define E2BIG 7
                  >#endif
                  >
                  >I think the numbers are the same everywhere. Even better is when you
                  >have an "errno.h" file to include.
                  >

                  I have an errno.h file and it
                  #define EINVAL 9
                  only for __dest_os == __win32_os

                  I'll try again with EINVAL and E2BIG defined as above.

                  Axel
                • Mac Vim Support (Axel Kielhorn)
                  ... After defining these errors (and ENOENT, EFAULT and EILSEG (the later is defined in mbyte.c but used in os_macosx.c) and including TextEncodingConverter.h,
                  Message 8 of 12 , Jul 14, 2002
                  • 0 Attachment
                    At 11:38 Uhr +0200 2002-07-09, Bram Moolenaar wrote:
                    >
                    >#ifndef EINVAL
                    ># define EINVAL 22
                    >#endif
                    >#ifndef E2BIG
                    ># define E2BIG 7
                    >#endif

                    After defining these errors (and ENOENT, EFAULT and EILSEG (the later
                    is defined in mbyte.c but used in os_macosx.c) and including
                    TextEncodingConverter.h, I discovered that my libraries are out of
                    date.

                    Now I've updated to Universal headers 3.4.1 (which are probably
                    already outdated since carbonLib 1.6 got released.)

                    I'm now down to several:

                    Error : not a struct/union/class
                    os_macosx.c line 294 st = TECCreateConverter(&cd->tec, fromEnc, toEnc);

                    And a lot of:

                    Error : cannot convert
                    'const char *' to
                    'unsigned long'
                    os_macosx.c line 419 buf_in, in_len, (ByteCount*)&in_true,

                    Error : cannot convert
                    'char *' to
                    'unsigned long'
                    os_macosx.c line 420 buf_out, out_len, (ByteCount*)&out_true);

                    Error : cannot convert
                    'char *' to
                    'unsigned long'
                    os_macosx.c line 432 buf_out, out_true, (ByteCount*)&rev_in,

                    Error : cannot convert
                    'char *' to
                    'unsigned long'
                    os_macosx.c line 433 buf_rev, in_true, (ByteCount*)&rev_out);

                    Error : cannot convert
                    'char *' to
                    'unsigned long'
                    os_macosx.c line 459 buf_out, out_len, (ByteCount*)&out_true);

                    Error : cannot convert
                    'char *' to
                    'unsigned long'
                    os_macosx.c line 469 buf_out, out_len, (ByteCount*)&out_true);

                    Why doesn't the MacOS X compiler complain?

                    Axel
                  • Benji Fisher
                    ... MURAOKA Taro: I have tried compiling, and there are several problems. Easy ones first: 1. I want the application to be named Vim.app instead of gvim.app
                    Message 9 of 12 , Jul 16, 2002
                    • 0 Attachment
                      On Monday, July 1, 2002, at 09:26 PM, MURAOKA Taro wrote:

                      >> After your previous patch, some of my menus got translated (into
                      >> Japanese?) even though I changed none of the defaults. Should I have
                      >> read the Makefile more carefully, or was this your fault?
                      >
                      > It may be fixed on new patch.
                      > Language which used for menu and its font maybe depend on existence of
                      > *.lproj directory and System Preferences setting. If there is no
                      > *.lproj for your selected language, other one of available *.lproj was
                      > used. On previous patch, I had prepared only Japanese.lproj, it caused
                      > your case. But on new patch, Make_osx.mak create English.lproj as
                      > default. It is expected to show default english menu.
                      >
                      > If you need, you could specify to create other *.lproj directories
                      > additionally using MULTILANG compile option.

                      MURAOKA Taro:

                      I have tried compiling, and there are several problems. Easy ones
                      first:

                      1. I want the application to be named Vim.app instead of gvim.app so I
                      edited Make_osx.mak . This mostly worked, but po/Make_osx.pl also
                      assumes that the executable is called gvim. Can you arrange it so that
                      the change in Make_osx.mak is automatically made in po/Make_osx.pl ?

                      2. A while ago on this list, Raindog gave us an Info.plist that enables
                      drag-and-drop. I have been distributing it with my builds. Could you
                      change your makefile so that it includes this improvement? (You can get
                      the Info.plist from the patches/ folder on my iDisk or ask and I will
                      send it to you directly.) Also, I think that most people prefer Douglas
                      Stebila's icon; could you use that instead?
                      http://mac.douglas.stebila.ca/code/vim/

                      3. I tried compiling with MULTILANG=all . The menus look OK, but the
                      introduction screen, the window title, and the status line have some
                      unwanted characters. I tried again with MULTILANG=none and the problem
                      is still there. Worse, my viminfo file got corrupted: here are the
                      first few lines:

                      åt| his viminfo file was generated by Vim 6.1.
                      åt| ou may edit it if you're careful!

                      åt| alue of 'encoding' when this file was written

                      (Above copied and pasted from Terminal vim, using the usual system copy
                      and paste. Below copied from gvim using "*y3<CR> .)

                      Ât†his viminfo file was generated by Vim 6.1.
                      Ât†ou may edit it if you're careful!

                      Ât†alue of 'encoding' when this file was written
                      *encoding=latin1

                      4. I tried rm ~/.viminfo ; make clean ; make -f Make_osx.mak . There
                      was less recompiling than I expected, and the time stamp on gvim.app/
                      did not change; I am not sure if this is a problem. After this, I still
                      see the strange characters as before, and the first few lines of
                      ~/.viminfo now look like this:

                      GÄhis viminfo file was generated by Vim 6.1.
                      GÄou may edit it if you're careful!

                      GÄalue of 'encoding' when this file was written
                      *encoding=latin1

                      I am not sure where to go from here. I will post the binary on my
                      iDisk as vim61alpha.tar.gz in case you or anyone else wants to try it
                      out.

                      --Benji Fisher
                    • Benji Fisher
                      ... I guess that should have been make -f Make_osx.mak clean. I tried again, with more recompilation but without much change in the results. --Benji Fisher
                      Message 10 of 12 , Jul 16, 2002
                      • 0 Attachment
                        On Tuesday, July 16, 2002, at 02:26 PM, Benji Fisher wrote:

                        > [snip]
                        > 4. I tried rm ~/.viminfo ; make clean ; make -f Make_osx.mak . There
                        > was less recompiling than I expected, and the time stamp on gvim.app/
                        > did not change; I am not sure if this is a problem.

                        I guess that should have been make -f Make_osx.mak clean. I tried
                        again, with more recompilation but without much change in the results.

                        --Benji Fisher

                        http://homepage.mac.com/fisherbb/index.html
                      • Mac Vim Support (Axel Kielhorn)
                        Last week I wrote that it should be possible to use TEC for Mac Classic. That was a bad thing to do, because I couldn t rest until I got it compiled:-) The
                        Message 11 of 12 , Jul 29, 2002
                        • 0 Attachment
                          Last week I wrote that it should be possible to use TEC for Mac Classic.
                          That was a bad thing to do, because I couldn't rest until I got it compiled:-)

                          The patches included (against a clean 6.1.118) include the changes to
                          get iconv emulation layer compiled with CodeWarrior 2 for MacOS
                          Classic.

                          What have I done?
                          os_macosx.c:
                          #include <TextEncodingConverter.h>
                          (This is automatically included with carbon.h)
                          Changed a lot of variables to the types expected by the library to
                          avoid casting: buf_in, buf_out, out_len, out_true, etc.
                          CW is really picky about type missmatch.

                          os_mac.h:
                          #define TRACE

                          structs.h:
                          Added typedef for MacOS Classic,
                          define missing errors.

                          Project:
                          Added library (Patch not included)

                          Things to do:
                          Learn how to use encodings to test if it really works.

                          Muraoka-san,

                          could you please integrate these patches into your version and if
                          possible release a new patch against a more recent Vim?

                          Everyone else:

                          The patches will be probably missing from the list, if you really
                          want them, please ask by mail.

                          Axel
                        • MURAOKA Taro
                          Great works!!. ... I see. I will try it on this week end. ... MURAOKA Taro
                          Message 12 of 12 , Jul 29, 2002
                          • 0 Attachment
                            Great works!!.

                            > Muraoka-san,
                            >
                            > could you please integrate these patches into your version and if
                            > possible release a new patch against a more recent Vim?

                            I see. I will try it on this week end.
                            ----
                            MURAOKA Taro <koron@...>
                          Your message has been successfully submitted and would be delivered to recipients shortly.