Menu

#2612 windows: utf8 encoding: degree sign (°) not properly displayed (° instead) at the mouse reading

None
open
None
2023-04-18
2023-03-31
Anonymous
No

Degree sign is well displayed when setting utf8 encoding, except for the mouse reading that is displayed at the bottom left corner: there, it always reads °

Discussion

  • Ethan Merritt

    Ethan Merritt - 2023-03-31

    O/S? Terminal type?

    If you are talking about the x11 terminal, I think it's hopeless. Years ago it was possible to get x11 to display characters from multi-byte encodings by choosing one or more x11 fonts with a non-ascii encoding and telling the terminal driver to use multibyte support. Unfortunately the distros I use seem to have dropped the specifc fonts and x11 settings I used to have working. Probably no one cares about x11 any more because the world has moved on to much fancier GUIs that don't require jumping through hoops to print unicode characters.

    For what it's worth, which is probably not much, I used to be able to use:

    set term x11 font "mbfont:sazanami mincho,vera,20"
    

    That doesn't work on my linux machines any more, even though I still have the fonts.

     
  • Tatsuro MATSUOKA

    Cygwin's gnuolot are provied with the X11 multibyte patch.
    I do not know that this will fix your issue because I do not use the X11 terminal.

     
  • Justin Sales

    Justin Sales - 2023-04-01

    O/S is windows and terminal type, wxt

     
  • Tatsuro MATSUOKA

    Please sumit scripts or command and operations to reproduce the phenoma.

     
  • Justin Sales

    Justin Sales - 2023-04-01

    term is set to "unknown" just at the beginning, in order to check out min and max values of y data; eventually it is set to wxt

    '01 nov' doesn't show up in the x-axis for a reason that is beyond me, but that's another issue...

    reset session
    set encoding utf8
    set term unknown
    set decimalsign locale
    set locale "spanish"
    unset mxtics

    a = 11 # ath COLUMN OF THE FILE
    a2= 10 # a2th COLUMN OF THE FILE
    c = 1 # PLOT EVERY c POINTS
    año = '2022'
    v = 12 # N° OF TICS OF X-AXIS
    giu = 0.02; su = 0.04 # MARGIN [IN % OF ymax-ymin] ADDED TO THE PLOT ABOVE & BELOW
    file = "D:/Giustino/METEO/mingw64/bin/".año."-MaxMin.txt"

    set xdata time
    set timefmt "%d/%m/%Y"
    set format x "%d%b\n%Y"

    set mouse mouseformat function strftime("%d%b\n%Y",x).' '.gprintf("%.1f",y).h[a]
    yticsformat = "{/:Bold %.1f}"
    plot file using (timecolumn(1,"%d/%m/%Y")):a with lp pt 7 lt rgb "dark-spring-green" notitle
    replot file using (timecolumn(1,"%d/%m/%Y")):a2 with lp pt 7 lt rgb "dark-magenta" notitle

    set xtics format "{/:Bold %d%b}\n%Y" font "Times-New Roman, 12" rotate by 20 offset -1.3,-0.6
    set ytics format yticsformat font "Times-New Roman, 12" nomirror

    array e[12]; array h[12]
    h[10]= 'ºC/h'; e[10] = 'Var/h MinT→MaxT (standard time)'
    h[11]= 'ºC/h'; e[11] = 'Var/h MaxT→MinT (standard time)'

    set term wxt background rgb "light-turquoise"
    set border 31 lw 3.0
    set pointsize 0.3

    set title sprintf("{/:Bold %s}",e[a]) font "Times-New Roman, 13" offset 0,-2.5 textcolor "dark-spring-green"
    set ylabel sprintf("{/:Bold %s}",h[a]) font "Times-New Roman, 14" offset 3.75,9.8 textcolor "dark-spring-green" rotate by 0

    set xrange [GPVAL_DATA_X_MIN - 86400:GPVAL_DATA_X_MAX + 86400]
    set xtics GPVAL_DATA_X_MIN,(GPVAL_DATA_X_MAX - GPVAL_DATA_X_MIN)/(v-1),GPVAL_DATA_X_MAX

    b = GPVAL_DATA_Y_MAX - GPVAL_DATA_Y_MIN
    set yrange [GPVAL_DATA_Y_MIN -bgiu:GPVAL_DATA_Y_MAX +bsu]

    set title sprintf("{/:Bold %s}",e[a]) font "Times-New Roman, 13" right textcolor "dark-spring-green"
    set label sprintf("{/:Bold %s}",e[a2]) font "Times-New Roman, 13" at graph 0.51,0.957 textcolor "dark-magenta"
    rep

     

    Last edit: Justin Sales 2023-04-02
    • Tatsuro MATSUOKA

      I could not reproduce because you did not provide 2022-MaxMin.txt.
      Please submit it as an attachment.

      BTW,

      in order to check out min and max values of y data;

      you can check those using "stats" command.

      gnuplot> help stats 
      
       

      Last edit: Tatsuro MATSUOKA 2023-04-02
      • Tatsuro MATSUOKA

        I executed your script and got messages.

                 "test.gp" line 43: undefined variable: bgiu
        
         

        Last edit: Tatsuro MATSUOKA 2023-04-02
  • Justin Sales

    Justin Sales - 2023-04-02

    Just replace bgiu by b * giu and bsu by b * su (at the end of that same line) ... it looks like the editor replaced the original * by the italica writing of what followed.

     
    • Tatsuro MATSUOKA

      When you describe code, you should better to use code fileld not to use boby text. * has a special meaning on body text.

       
  • Tatsuro MATSUOKA

    Screenshot is attached
    One of the mouse reading is follows

    09dic
    2021 2.1ツコC/h
    
     
  • Tatsuro MATSUOKA

    On cygwin and ubuntu on wxt, the mouse reading is like

    09Dec
    

    On qt

    21Sep
    2022 1.0ºC/h
    
     

    Last edit: Tatsuro MATSUOKA 2023-04-02
  • Justin Sales

    Justin Sales - 2023-04-02

    It thus depend on the terminal and on the O/S (for some reason, your gnuplot plots integer values for y... maybe with set decimalsign ',' above (instead of set decimalsign locale you should get it right; but anyway, that's irrelevant for the mouse reading). Then I guess it is indeed a bug: as you see, the ylabel is well displayed: °C/h; it's only the mouse reading that does not display it well.

     

    Last edit: Justin Sales 2023-04-02
    • Tatsuro MATSUOKA

      On the windows teminal
      Paste of mouse reading

      15may
      2022 1.0ツコC/h
      

      On the qt terminal
      Paste of mouse reading

      08mar
      2022 0.7ºC/h
      
       

      Last edit: Tatsuro MATSUOKA 2023-04-02
  • Ethan Merritt

    Ethan Merritt - 2023-04-18
    • summary: utf8 encoding: degree sign (°) not properly displayed (° instead) at the mouse reading --> windows: utf8 encoding: degree sign (°) not properly displayed (° instead) at the mouse reading
    • Group: -->
    • Priority: -->
     

Log in to post a comment.