How to type in XeLaTeX a symbol by its code? In particular, I am interested in different dashes:
U+2011 ‑ non-breaking hyphen as hyphen (U+2010), but not an allowed line break point
U+2012 ‒ figure dash as hyphen-minus, but has the same width as digits
U+2013 – en dash used e.g. to indicate a range of values
U+2014 — em dash used e.g. to make a break in the flow of a sentence
U+2015 ― horizontal bar used to introduce quoted text in some typographic styles; “quotation dash”; often (e.g., in the representative glyph in the Unicode standard) longer than em dash
Here is MWE:
\documentclass{article}
\usepackage{calc}
\newlength{\len}
\begin{document}
\textemdash\ \verb|\textemdash| = \setlength{\len}{\widthof{{\textemdash}}} \the\len\
\textthreequartersemdash\ \verb|\textthreequartersemdash| = \setlength{\len}{\widthof{{\textthreequartersemdash}}} \the\len \
\textendash\ \verb|\textendash| = \setlength{\len}{\widthof{{\textendash}}} \the\len \
\end{document}
I tried \symbol{"2012} but it yields error.

\usepackage{fontspec}and\setmainfont{Arial}. Of course, you can use any unicode font installed on your system – Alan Ford Oct 07 '20 at 08:49\symbol{"2012}to your MWE. I only get a missing character message as the default font doesn't have it. – Ulrike Fischer Oct 07 '20 at 09:06