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

Please add "big5-hkscs" charset support to vim

Expand Messages
  • Anthony Fok
    Hello all, Since we d like to enter Big5-HKSCS Chinese characters in vim (with the zh_HK.Big5-HKSCS locale), please apply the attached patch. :-) It has been
    Message 1 of 6 , Dec 13, 2002
    • 0 Attachment
      Hello all,

      Since we'd like to enter Big5-HKSCS Chinese characters in vim (with the
      zh_HK.Big5-HKSCS locale), please apply the attached patch. :-) It has been
      tested to work under GNU/Linux.

      I am not sure whether big5-hkscs is considered as "cp950" or "cp951" on
      Windows. If any of you know, perhaps you can add more aliases to
      mbyte.c. Thanks again!

      Anthony

      --
      Anthony Fok Tung-Ling
      ThizLinux Laboratory <anthony@...> http://www.thizlinux.com/
      Debian Chinese Project <foka@...> http://www.debian.org/intl/zh/
      Come visit Our Lady of Victory Camp! http://www.olvc.ab.ca/
    • Bram Moolenaar
      ... You are using DBCS_CHT for big5-hkscs . That s Chinese-Taiwan. Are you sure this is exactly the same as big5-hkscs (Hong Kong?)? I suspect that big5
      Message 2 of 6 , Dec 28, 2002
      • 0 Attachment
        Anthony Fok wrote:

        > Since we'd like to enter Big5-HKSCS Chinese characters in vim (with the
        > zh_HK.Big5-HKSCS locale), please apply the attached patch. :-) It has been
        > tested to work under GNU/Linux.
        >
        > I am not sure whether big5-hkscs is considered as "cp950" or "cp951" on
        > Windows. If any of you know, perhaps you can add more aliases to
        > mbyte.c. Thanks again!

        You are using DBCS_CHT for "big5-hkscs". That's Chinese-Taiwan. Are
        you sure this is exactly the same as "big5-hkscs" (Hong Kong?)?

        I suspect that "big5" and "big5-hkscs" are slightly different, otherwise
        there would not be a different name. Handling it mostly like big5 might
        mostly work, but cause subtle problems in some cases. Isn't there a
        better solution?

        --
        Rule #1: Don't give somebody a tool that he's going to hurt himself with.

        /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
        /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
        \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
        \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
      • Edward Lee
        ... Big5 and Big5-HKSCS are different. Big5-HKSCS extended from Big5, but it is now the superset of Big5. Hope it won t mess up the two locales, we won t use
        Message 3 of 6 , Dec 30, 2002
        • 0 Attachment
          On Sat, Dec 28, 2002, Bram Moolenaar wrote:
          >
          > You are using DBCS_CHT for "big5-hkscs". That's Chinese-Taiwan. Are
          > you sure this is exactly the same as "big5-hkscs" (Hong Kong?)?
          >
          > I suspect that "big5" and "big5-hkscs" are slightly different, otherwise
          > there would not be a different name. Handling it mostly like big5 might
          > mostly work, but cause subtle problems in some cases. Isn't there a
          > better solution?

          Big5 and Big5-HKSCS are different.

          Big5-HKSCS extended from Big5, but it is now the superset of Big5.
          Hope it won't mess up the two locales, we won't use Big5-HKSCS as
          our locale/character set in Taiwan.

          Thanks.


          Rgds,
          Edward G.J. Lee
        • Anthony Fok
          Hello Bram, ... It depends on what VIM does with macros like DBCS_CHT. If VIM just use these macros to check the character range, then it is okay for
          Message 4 of 6 , Dec 31, 2002
          • 0 Attachment
            Hello Bram,

            On Sat, Dec 28, 2002 at 05:56:15PM +0100, Bram Moolenaar wrote:
            >
            > Anthony Fok wrote:
            >
            > > Since we'd like to enter Big5-HKSCS Chinese characters in vim (with the
            > > zh_HK.Big5-HKSCS locale), please apply the attached patch. :-) It has been
            > > tested to work under GNU/Linux.
            > >
            > > I am not sure whether big5-hkscs is considered as "cp950" or "cp951" on
            > > Windows. If any of you know, perhaps you can add more aliases to
            > > mbyte.c. Thanks again!
            >
            > You are using DBCS_CHT for "big5-hkscs". That's Chinese-Taiwan. Are
            > you sure this is exactly the same as "big5-hkscs" (Hong Kong?)?
            >
            > I suspect that "big5" and "big5-hkscs" are slightly different, otherwise
            > there would not be a different name. Handling it mostly like big5 might
            > mostly work, but cause subtle problems in some cases. Isn't there a
            > better solution?

            It depends on what VIM does with macros like DBCS_CHT. If VIM just use
            these macros to check the character range, then it is okay for big5-hkscs
            to use DBCS_CHT too. They both have the same valid range:

            1st byte: 0x81-0xFE
            2nd byte: 0x40-0x7E, 0x81-0xFE

            But yes, they are different character set. Big5-HKSCS is more-or-less a
            superset of Big5.

            Oh, I remember now why I listed big5-hkscs to use DBCS_CHT too. It is
            because of "Code Page 950". I am not exactly sure what Microsoft uses for
            Big5-HKSCS. They provide a hkscs*.exe file for download, which include a
            cp951.nls, but instead of actually providing Code Page 951, Microsoft
            Windows tends to "masquerade" Big5-HKSCS as Code Page 950 on systems that
            have installed Big5-HKSCS support in order to maintain backward
            compatibility.

            Note that I am not exactly sure of the situation. Nevertheless, if the
            patch I submitted does not affect operation with the original "big5" in vim,
            then let's try it out first, and then wait for reports from MS Windows VIM
            Big5-HKSCS users. :-)

            Of course, if someone knows more about the actual situation (whether MS
            Windows "masquerades" CP950 or actually provides a CP951), please comment.

            Cheers,

            Anthony

            --
            Anthony Fok Tung-Ling
            ThizLinux Laboratory <anthony@...> http://www.thizlinux.com/
            Debian Chinese Project <foka@...> http://www.debian.org/intl/zh/
            Come visit Our Lady of Victory Camp! http://www.olvc.ab.ca/
          • Anthony Fok
            ... Oh, BTW, if you don t mind, could you please describe the subtle problems ? I am not familiar with VIM s i18n processing, and I was just glad that just
            Message 5 of 6 , Dec 31, 2002
            • 0 Attachment
              On Sat, Dec 28, 2002 at 05:56:15PM +0100, Bram Moolenaar wrote:
              > I suspect that "big5" and "big5-hkscs" are slightly different, otherwise
              > there would not be a different name. Handling it mostly like big5 might
              > mostly work, but cause subtle problems in some cases. Isn't there a
              > better solution?

              Oh, BTW, if you don't mind, could you please describe the "subtle problems"?
              I am not familiar with VIM's i18n processing, and I was just glad that just
              adding a small like made VIM recognizes "big5-hkscs", and made it worked
              quite well on Linux.

              If the problems are real, we could make an DBCS_ZHH (for ZHongwen Hong kong;
              that appears to be what Windows or WINE uses), but we will likely define it
              to be 950 too (i.e. same as DBCS_CHT), or perhaps 951, depending on how what
              Windows actually uses for Big5-HKSCS.

              Cheers,

              Anthony

              --
              Anthony Fok Tung-Ling
              ThizLinux Laboratory <anthony@...> http://www.thizlinux.com/
              Debian Chinese Project <foka@...> http://www.debian.org/intl/zh/
              Come visit Our Lady of Victory Camp! http://www.olvc.ab.ca/
            • Bram Moolenaar
              ... The list mentions aliases for encoding names, so that the same name is always used for encodings that are identical. An alias should not be used for
              Message 6 of 6 , Dec 31, 2002
              • 0 Attachment
                Anthony Fok wrote:

                > > > Since we'd like to enter Big5-HKSCS Chinese characters in vim (with the
                > > > zh_HK.Big5-HKSCS locale), please apply the attached patch. :-) It has been
                > > > tested to work under GNU/Linux.
                > > >
                > > > I am not sure whether big5-hkscs is considered as "cp950" or "cp951" on
                > > > Windows. If any of you know, perhaps you can add more aliases to
                > > > mbyte.c. Thanks again!
                > >
                > > You are using DBCS_CHT for "big5-hkscs". That's Chinese-Taiwan. Are
                > > you sure this is exactly the same as "big5-hkscs" (Hong Kong?)?
                > >
                > > I suspect that "big5" and "big5-hkscs" are slightly different, otherwise
                > > there would not be a different name. Handling it mostly like big5 might
                > > mostly work, but cause subtle problems in some cases. Isn't there a
                > > better solution?
                >
                > It depends on what VIM does with macros like DBCS_CHT. If VIM just use
                > these macros to check the character range, then it is okay for big5-hkscs
                > to use DBCS_CHT too. They both have the same valid range:
                >
                > 1st byte: 0x81-0xFE
                > 2nd byte: 0x40-0x7E, 0x81-0xFE
                >
                > But yes, they are different character set. Big5-HKSCS is more-or-less a
                > superset of Big5.

                The list mentions aliases for encoding names, so that the same name is
                always used for encodings that are identical. An alias should not be
                used for encodings that are similar but not identical, because it will
                cause problems when doing conversions.

                > Oh, I remember now why I listed big5-hkscs to use DBCS_CHT too. It is
                > because of "Code Page 950". I am not exactly sure what Microsoft uses for
                > Big5-HKSCS. They provide a hkscs*.exe file for download, which include a
                > cp951.nls, but instead of actually providing Code Page 951, Microsoft
                > Windows tends to "masquerade" Big5-HKSCS as Code Page 950 on systems that
                > have installed Big5-HKSCS support in order to maintain backward
                > compatibility.
                >
                > Note that I am not exactly sure of the situation. Nevertheless, if the
                > patch I submitted does not affect operation with the original "big5" in vim,
                > then let's try it out first, and then wait for reports from MS Windows VIM
                > Big5-HKSCS users. :-)
                >
                > Of course, if someone knows more about the actual situation (whether MS
                > Windows "masquerades" CP950 or actually provides a CP951), please comment.

                I think it's better to change this only when we know it's the right
                thing to do. When we don't include this change, editing big5-hkscs
                files should still work if you tell Vim it's a double-byte encoding,
                right? The name should be something like "2byte-big5-hkscs".

                We could add another entry for this encoding, not an alias.

                --
                hundred-and-one symptoms of being an internet addict:
                240. You think Webster's Dictionary is a directory of WEB sites.

                /// Bram Moolenaar -- Bram@... -- http://www.moolenaar.net \\\
                /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
                \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
                \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
              Your message has been successfully submitted and would be delivered to recipients shortly.