Menu

#520 fix for the 2nd byte of Shift_JIS on post enh

closed-accepted
nobody
None
5
2011-02-11
2011-01-22
No

This patch may fix the old problem of 2nd byte of Shift_JIS coding (cp932),
which is default of MS-WIndows of Japanese, in enhanced text mode on
PostScript terminal. This adds new encoding cp932 which is alias of
Shift_JIS.

Discussion

  • Shigeharu TAKENO

    a patch for src/term.h, src/term_api.h and term/post.trm

     
  • Ethan Merritt

    Ethan Merritt - 2011-01-24

    Do we need also a new prolog file .../term/PostScript/sjis.ps ?

    Do other terminals (cairo.trm gd.trm svg.trm wxt.trm x11.trm) need special code for enhanced text + sjis?

    Do you prefer "set encdoing cp932" or "set encoding sjis" or "set encoding Shift_JIS"?

    On MS-Windows in Japanese, does it work to say "set encoding locale"?

     
  • Shigeharu TAKENO

    Thank you for the reply.

    | Do we need also a new prolog file .../term/PostScript/sjis.ps ?

    I think we do not need it.

    | Do other terminals (cairo.trm gd.trm svg.trm wxt.trm x11.trm) need
    | special code for enhanced text + sjis?

    I wonder we need additional code for gd or other terminal. For
    example, libgd supports UTF-8 string in default, but if it was
    compiled with -DJISX0208, it supports Shift_JIS and EUC-JP but
    does not UTF-8. Currently we can not check it, I will consider
    the problem. For svg terminal, I will upload new patch since the
    change is not so difficult.

    | Do you prefer "set encdoing cp932" or "set encoding sjis" or "set encoding
    | Shift_JIS"?

    I used "cp932" according to other encoding names, but I think
    "set encoding sjis" is better for Japanese.

    | On MS-Windows in Japanese, does it work to say "set encoding locale"?

    It seems to work. Wgnuplot returns the followings on my Windows XP3:

    gnuplot> show encoding

    nominal character encoding is default
    however LC_CTYPE in current locale is C

    gnuplot> set encoding locale
    gnuplot> show locale

    nominal character encoding is default
    however LC_CTYPE in current locale is Japanese_Japan.932

    Well, I found a problem (not safe) of my patch. So I will upload new patch
    including change of svg.trm soon here.

     
  • Shigeharu TAKENO

    new patch for encoding sjis including change for svg.trm

     
  • Shigeharu TAKENO

    I upload a new patch for set encoding sjis including a change for svg.trm.

     
  • Ethan Merritt

    Ethan Merritt - 2011-01-26

    I have added your patch to CVS.

    However, from the printout you showed, I think 'set encoding locale' is not working for sjis on Windows. If your machine is set to an sjis locale then you should see this:
    gnuplot> show locale
    nominal character encoding is default
    however LC_CTYPE in current locale is Japanese_Japan.932
    gnuplot> set encoding locale
    gnuplot> show locale
    nominal character encoding is sjis
    however LC_CTYPE in current locale is Japanese_Japan.932

    I think the attached patch will make it work on linux, but I am not so sure about Windows. Please test.

     
  • Ethan Merritt

    Ethan Merritt - 2011-01-26

    Check "set encoding locale" for SJIS

     
  • Shigeharu TAKENO

    I applied your patch and tested on my Windows XP machine:

    gnuplot > show locale
    gnuplot LC_CTYPE C
    gnuplot encoding default
    gnuplot LC_TIME Japanese_Japan.932
    gnuplot LC_NUMERIC C
    gnuplot> show encoding
    nominal character encoding is default
    however LC_CTYPE in current locale is C

    gnuplot> set encoding locale
    gnuplot> show encoding
    nominal character encoding is sjis
    however LC_CTYPE in current locale is Japanese_Japan.932
    gnuplot> show locale
    gnuplot LC_CTYPE Japanese_Japan.932
    gnuplot encoding sjis
    gnuplot LC_TIME Japanese_Japan.932
    gnuplot LC_NUMERIC C

    This result is what you say. Thanks.

     
  • Ethan Merritt

    Ethan Merritt - 2011-02-11
    • status: open --> closed-accepted
     
  • Ethan Merritt

    Ethan Merritt - 2011-02-11

    Added to CVS

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.