From 363b853752717d987d70a5c94ca14df5539fe071 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Mon, 15 Aug 2022 18:36:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20set=20myst-anchor=20read/?= =?UTF-8?q?write=20encoding=20as=20`utf8`=20(#610)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ideally it would read from sphinx `source_encoding`, but this should fix most use cases, with the default encoding. --- myst_parser/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/myst_parser/cli.py b/myst_parser/cli.py index a9c6ab09..b9bb1ba1 100644 --- a/myst_parser/cli.py +++ b/myst_parser/cli.py @@ -13,14 +13,14 @@ def print_anchors(args=None): arg_parser.add_argument( "input", nargs="?", - type=argparse.FileType("r"), + type=argparse.FileType("r", encoding="utf8"), default=sys.stdin, help="Input file (default stdin)", ) arg_parser.add_argument( "-o", "--output", - type=argparse.FileType("w"), + type=argparse.FileType("w", encoding="utf8"), default=sys.stdout, help="Output file (default stdout)", )