Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 18a8a94

Browse files
anntzertimhoffm
authored andcommitted
Restrict postscript title to ascii. (#12890)
The postscript standard makes no reference to the interpretation of non-ascii entities, so assuming an encoding is incorrect.
1 parent e142e15 commit 18a8a94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ def _print_figure(
970970
isEPSF = format == 'eps'
971971
if isinstance(outfile, (str, getattr(os, "PathLike", ()),)):
972972
outfile = title = getattr(os, "fspath", lambda obj: obj)(outfile)
973-
title = title.encode("latin-1", "replace").decode("latin-1")
973+
title = title.encode("ascii", "replace").decode("ascii")
974974
passed_in_file_object = False
975975
elif is_writable_file_like(outfile):
976976
title = None

0 commit comments

Comments
 (0)