Re: [PATCH 39/53] docs: dev-tools: testing-overview.rst: avoid using UTF-8 chars

From: Mauro Carvalho Chehab
Date: Wed May 12 2021 - 04:14:46 EST


Em Tue, 11 May 2021 07:35:29 +0800
David Gow <davidgow@xxxxxxxxxx> escreveu:

> On Mon, May 10, 2021 at 6:27 PM Mauro Carvalho Chehab
> <mchehab+huawei@xxxxxxxxxx> wrote:
> >
> > While UTF-8 characters can be used at the Linux documentation,
> > the best is to use them only when ASCII doesn't offer a good replacement.
> > So, replace the occurences of the following UTF-8 characters:
> >
> > - U+2014 ('—'): EM DASH
> >
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
> > ---
>
> Oh dear, I do have a habit of overusing em-dashes. I've no problem in
> theory with exchanging them for an ASCII approximation.
> I suppose there's a reason it's the one dash to rule them all: :-)
> https://twitter.com/FakeUnicode/status/727888721312260096/photo/1

No, there's no such rule, although there's a preference to keep
the texts easy to edit/read as text files[1]. The main rationale for
this series is that the conversion from other formats to ReST ended
introducing a lot of UTF-8 noise.

[1] IMO, the best is to use UTF-8 characters for symbols that
aren't properly represented in ASCII, like Latin accents,
Greek letters, etc.

In the specific case of dashes, you can use:

"--" for EN DASH
"---" for EM DASH

Those will automatically be translated by Sphinx when building
the docs. Using ASCII there usually makes life simpler for
developers whose editors can't easily type EN/EM DASH.

Btw, Sphinx will also replace commas to curly commas
automatically on its output (except for literal blocks).

Thanks,
Mauro