Opened 5 years ago

Last modified 4 years ago

#3726 new defect

special characters in psmap scalebar unit

Reported by: 1266 Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: Default Version: svn-releasebranch76
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description

special characters are not correctly displayed for psmap module scalebar. For example: scalebar s

units kilometers ...

does not display special characters of kilom[è]tres in french.

Change History (3)

comment:1 by veroandreo, 5 years ago

To reproduce:

  1. Go to Settings -> Preferences, under Appearance tab, set Language to French or Spanish, for example. Save and Exit GRASS.
  1. Start a new GRASS session in NC location and save the following instructions in test.psmap
    # timestamp: 2019-01-07 15:24
    # location: nc_basic_spm_grass7
    # mapset: PERMANENT
    # page orientation: Portrait
    # g.region raster=elevation@PERMANENT nsres=10.0 ewres=10.0
    
    maploc 1.014 1.295  6.205 5.585
    border y
        width 1
        color black
        end
    
    paper a4
        left 0.5
        right 0.5
        bottom 1
        top 1
        end
    
    raster elevation@PERMANENT
    scalebar f
        where 5.916 7.327
        length 5.0
        units kilometers
        height 0.1
        segment 4
        numbers 1
        fontsize 10
        background y
        end
    end
    
  1. Run ps.map in=test.psmap out=test.ps or load the instructions file in G7:g.gui.psmap and see the preview.

in reply to:  description comment:2 by mlennert, 5 years ago

Replying to 1266:

special characters are not correctly displayed for psmap module scalebar. For example: scalebar s

units kilometers ...

does not display special characters of kilom[è]tres in french.

Just guessing here, but could it be that the translated strings (po files) are in UTF-8 while ps.map expects all strings to be iso-8859-1 ? In do_scalebar.c there is:

193	    else if(sb.units == SB_UNITS_KM)
194	        strcpy(num, _("kilometers"));

so kilometers is translated and that's why you automatically get the non-ascii characters, but in a different encoding than the one expected.

comment:3 by neteler, 4 years ago

Milestone: 7.8.3
Note: See TracTickets for help on using tickets.