diff --git a/pygmt/helpers/utils.py b/pygmt/helpers/utils.py index 1732dfb4e3f..66be427d937 100644 --- a/pygmt/helpers/utils.py +++ b/pygmt/helpers/utils.py @@ -305,10 +305,11 @@ def non_ascii_to_octal(argstr): c: "\\" + format(i, "o") for c, i in zip( "•…™—–fiž" # \03x. \030 is undefined + "’‘" # \047 and \140 "š" # \177 "Œ†‡Ł⁄‹Š›œŸŽł‰„“”" # \20x-\21x "ı`´ˆ˜¯˘˙¨‚˚¸'˝˛ˇ", # \22x-\23x - [*range(25, 32), *range(127, 160)], + [*range(25, 32), 39, 96, *range(127, 160)], strict=True, ) } diff --git a/pygmt/tests/test_text.py b/pygmt/tests/test_text.py index 9d52f2629af..ab07e964954 100644 --- a/pygmt/tests/test_text.py +++ b/pygmt/tests/test_text.py @@ -430,5 +430,5 @@ def test_text_quotation_marks(): """ fig = Figure() fig.basemap(projection="X4c/2c", region=[0, 4, 0, 2], frame=0) - fig.text(x=2, y=1, text="\\234 \\140 ' \" \\216 \\217", font="20p") + fig.text(x=2, y=1, text='\\234 ‘ ’ " “ ”', font="20p") # noqa: RUF001 return fig