Menu

#416 Japanese character problem on gnuplot

None
closed-accepted
Windows (5)
5
2021-01-13
2015-03-14
No

Honestly speaking, I wonder the topic is a bug.

I would like share the script codes partly written in Japanese on Ubuntu and Windows.
Default encoding on Ubuntu is utf-8.
For gnuplot for windows on Japanese windows, sjis is defaults.
If prepared scripts run completely in batch mode, the difference does not cause any issue.

But interactive operation, it is very annoying.
I have to convert scripts every time utf-8 <--> sjis for each modification.

On wgnuplot.exe and gnuplot.exe, only Japanese characters encoded in shift-jis can display ordinal way,
while gnuplot on Ubuntu terminal utf-8 encoded Japanese characters can display in ordinal way.

Is there any good idea to avoid convert every time?

Tatsuro

Discussion

  • Tatsuro MATSUOKA

    gnuplot.exe: If codepage is set to 65001 and gnuplot.exe is executed, codepage of command console is changed to 932 (Japanese Shift-Jis). Thus I cannot use utf-8.

     
  • Shigeharu TAKENO

    Can you change the locale of Ubuntu to Shift_JIS ?

    cf. http://www16.atwiki.jp/rinn/pages/76.html

     
  • Tatsuro MATSUOKA

    Thank you for the suggestion.

    Attachment test.tar.gz
    Gnuplot-wx_error.png
    Terminal.png
    Terminal_u.png
    frTempfit_v0.2.gp
    frTempfit_v0.2_u.gp

    Add ja_JP.SJIS locale by "sudo localedef -f SHIFT_JIS -i ja_JP ja_JP.SJIS"

    Execute gnuplot and run the shift-jis encoded script (Archived frTempfit_v0.2.gp in test.tar.gz):

    $ LANG=ja_JP.SJIS gnuplotcvs

    gnuplot> load 'frTempfit_v0.2.gp'

    Gnuplot-wx error: see the screenshot Gnuplot-wx_error.png
    Screen shot of the terminal : character corruption in Terminal.png

    Convert character code of frTempfit_v0.2.gp from sjis to utf8 and also change encoring from sjis to utf8. (Script file : frTempfit_v0.2_u.gp)

    Japanese characters are represented correctly. See Terminal_u.png

    Tatsuro

     
    • Shigeharu TAKENO

      I think the reason for the problem of Terminal.png is japanese mode of the terminal emulator. You have to set it to Shift_JIS mode.

      To check the japanese mode of your terminal emulator, type "cat frTempfit_v0.2.gp".

      I don't know the reason and how to workaround for the problem of Gnuplot-wx_error.png generated by wxWidgets library.

       
      • Tatsuro MATSUOKA

        I do not want to change default character set to Shift-Jis

        Thus I tried type
        From the terminal
        export LANG="ja_JP.SJIS"
        export SUPPORTED="ja_JP.SJIS:ja_JP:ja"
        gnome-terminal &

        From executed terminal, I did

        cat frTempfit_v0.2.gp

        illegal characters output

        Anyway I have now a wine+wgnuplot+xyzzy solution. I do want to dig out this further.

         
        • Shigeharu TAKENO

           
          • Tatsuro MATSUOKA

            Takeno-san

            I can use Sjis encoding characters on gnome-terminal.

            And I also can use emacs with gnuplot-mode.

             
  • Tatsuro MATSUOKA

    Now I have found alternative solution on Ubuntu.

    I have installed wine (1.7) and installed gnuplot for windows Ver 5.1 from http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/

    And I also installed xyzzy (Windows application) to use the wgnuplot-mode provided by Dr. Yonezawa.

    After some struggle I am now able to wgnuplot and xyzzy with wgnuplot-mode on Ubuntu.

    The above is one of realistic solution at the moment. However, it is better to gnuplot for windows will be treat utf-8 encoding in interactive session.

    The topic seem to be better to move to the feature request tracker but not bug tracker.

     
  • Tatsuro MATSUOKA

    I would like to the move discussion to the Feature Requests and create a new ticket in it.
    https://sourceforge.net/p/gnuplot/feature-requests/415/

    So please close this ticket.

     
  • Ethan Merritt

    Ethan Merritt - 2015-03-17

    Ticket moved from /p/gnuplot/bugs/1577/

     
  • Ethan Merritt

    Ethan Merritt - 2015-03-17

    OK. Moved to Feature Requests.

     
  • Bastian Märkisch

    • labels: --> Windows
    • status: open --> closed-accepted
    • Group: 5.0 -->
     
  • Bastian Märkisch

    Support for arbitrary encodings, including UTF-8, input and output, message boxes, etc. is now available.

     

Log in to post a comment.