Why does XeTeX not display basic Unicode characters?

The warning message you report is irrelevant and innocuous. It would disappear if you had \RequirePackage{fix-cm} before the \documentclass line, but the Greek pi wouldn't appear either. The relevant message is at the end of the .log file:

Missing character: There is no π in font [lmroman12-regular]:mapping=tex-text!

The Latin Modern fonts support only a few Greek letters. You'd be luckier with CMU Serif

\RequirePackage{fix-cm} % remove the spurious warning
\documentclass[fontsize=13pt,oneside]{scrbook}
\usepackage{fontspec}

\setmainfont{CMU Serif}

\begin{document}
\mainmatter
This is a paragraph with a PI (π) in it.
\end{document}

enter image description here

Note: the fact that scrbook allows setting 13pt as base size isn't a sufficient justification for using such a size. It's either too big (for the vast majority) or too small (for visually impaired people).


Edit Here's egreg's (better) solution, for future reference, since this answer was accepted.

\RequirePackage{fix-cm}
\documentclass[fontsize=13pt,oneside]{scrbook}
\usepackage{fontspec}
\usepackage[Latin,Greek]{ucharclasses}

\newfontfamily\substitutefont{CMU Serif}
\setTransitionsForGreek{\begingroup\substitutefont}{\endgroup}

\begin{document}
\mainmatter
This is a paragraph with a PI (π) in it.
\end{document}

Here's the original message that I wrote, which does not use the \newfontfamily command.

Using ucharclasses:

\usepackage{ucharclasses}
  \setTransitionsFor{GreekAndCoptic}{\begingroup\fontspec{DejaVu Sans}[Scale=MatchLowercase]}{\endgroup}

(Of course, change DejaVu Sans to be any font on your system that has the desired characters.)


I had same error, but in different envirnonment, caused by this line in Pandoc Markdown with xelatex in background:

$\beta \in (0,1) $

Apperently, Pandoc or xelatex didn't like whitespace as last characted inside equation.

Maybe it will save few hours of anyone coming here, as it is the first link bound to this warning [WARNING] Missing character: There is no in font [lmroman12-regular]:mapping =tex-text!


EDIT (additional testing)

The following code section is not parsable, but I felt it's better to have a direct comparison of pandoc input and tex output (as the middle step between md and pdf) to get an idea of what works and what doesn't.

pandoc                   -->   LaTeX
------                         -----

Some normal text.        -->   Some normal text.

$\beta \in (0,1) $       -->   \$\beta \in (0,1) \$

$\beta \in (0,1)$        -->   \(\beta \in (0,1)\)

$$\beta \in (0,1) $$     -->   \[\beta \in (0,1) \]

$$\beta \in (0,1)$$      -->   \[\beta \in (0,1)\]

$\beta \in (0,1)$$       -->   \(\beta \in (0,1)\)\$

$$\beta \in (0,1)$       -->   \$\(\beta \in (0,1)\)

$ \beta \in (0,1)$       -->   \$ \beta \in (0,1)\$

$$ \beta \in (0,1) $$    -->   \[ \beta \in (0,1) \]

$ \beta \in (0,1)$$      -->   \$ \beta \in (0,1)\$\$

$$ \beta \in (0,1)$      -->   \$\$ \beta \in (0,1)\$

So, essentially, what we see here is that the first line won't work, since pandoc interprets the dollar signs as text dollar signs. In the five other cases, pandoc will bite the bait and pass math mode to TeX. The important part is to snuggle up the dollar signs in inline math. Spaces don't matter in display math, though.