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.
| 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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
a patch for src/term.h, src/term_api.h and term/post.trm
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"?
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.
new patch for encoding sjis including change for svg.trm
I upload a new patch for set encoding sjis including a change for svg.trm.
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.
Check "set encoding locale" for SJIS
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.
Added to CVS