@@ -4528,20 +4528,21 @@ def drawmapscale(self,lon,lat,lon0,lat0,length,barstyle='simple',\
4528
4528
xc ,yc = self (lon ,lat )
4529
4529
# make sure lon_0 between -180 and 180
4530
4530
lon_0 = ((lon0 + 360 ) % 360 ) - 360
4531
+ degchar = b"\xc2 \xb0 " .decode ("utf-8" )
4531
4532
if lat0 > 0 :
4532
4533
if lon > 0 :
4533
- lonlatstr = u '%g\N{DEGREE SIGN} N , %g\N{DEGREE SIGN} E ' % (lat0 ,lon_0 )
4534
+ lonlatstr = '%g%sN , %g%sE ' % (lat0 , degchar , lon_0 , degchar )
4534
4535
elif lon < 0 :
4535
- lonlatstr = u '%g\N{DEGREE SIGN} N , %g\N{DEGREE SIGN} W ' % (lat0 ,lon_0 )
4536
+ lonlatstr = '%g%sN , %g%sW ' % (lat0 , degchar , lon_0 , degchar )
4536
4537
else :
4537
- lonlatstr = u '%g\N{DEGREE SIGN} , %g\N{DEGREE SIGN} W ' % (lat0 ,lon_0 )
4538
+ lonlatstr = '%g%s , %g%sW ' % (lat0 , degchar , lon_0 , degchar )
4538
4539
else :
4539
4540
if lon > 0 :
4540
- lonlatstr = u '%g\N{DEGREE SIGN} S , %g\N{DEGREE SIGN} E ' % (lat0 ,lon_0 )
4541
+ lonlatstr = '%g%sS , %g%sE ' % (lat0 , degchar , lon_0 , degchar )
4541
4542
elif lon < 0 :
4542
- lonlatstr = u '%g\N{DEGREE SIGN} S , %g\N{DEGREE SIGN} W ' % (lat0 ,lon_0 )
4543
+ lonlatstr = '%g%sS , %g%sW ' % (lat0 , degchar , lon_0 , degchar )
4543
4544
else :
4544
- lonlatstr = u '%g\N{DEGREE SIGN} S , %g\N{DEGREE SIGN} ' % (lat0 ,lon_0 )
4545
+ lonlatstr = '%g%sS , %g%s ' % (lat0 , degchar , lon_0 , degchar )
4545
4546
# left edge of scale
4546
4547
lon1 ,lat1 = self (x0 - length / 2 ,y0 ,inverse = True )
4547
4548
x1 ,y1 = self (lon1 ,lat1 )
0 commit comments