[Tex/LaTex] Unicode Replacement Character in Standard TeX

fontspdftexsymbols

Is there a font, available to -all- TeX users, that includes a glyph that can be recognized as the Unicode Replacement Character? I realize I can use XeTeX with a U+FFFD (or maybe any character not in the font), but I'm interested in using standard pdfTeX with standard LaTeX 2e and a pure ASCII input file.

The glyph typically looks like a filled black diamond with a white question mark inside it:

? in a black box

If no such font is available, what's the best robust strategy for getting such a glyph into a standard pdfTeX document (one whose input file has no Unicode or non-ASCII UTF-8 byte sequences in it) without using XeTeX or similar? Inserting TikZ commands? Raw PostScript?

Right now, for lack of a better solution, I'm using a \textbullet, simply because it's the boldest/blackest glyph I can think of, and it's available in most standard fonts.

Creating a custom font with one glyph in it is not really viable, or if it is it's a strategy of last resort, unless (perhaps) it can be done automatically and on the fly when processing the document each time.

(Reposted from the texhax mailing list: http://tug.org/pipermail/texhax/2015-January/021519.html; originally posed by Doug McKenna)

Best Answer

Of course, this is LaTeX, not standard TeX. This takes \blacksquare and rotates it 45 degree for the black diamond. Then it insets a white \sffamily\small ? atop it, centered left/right, and .2pt below vertical center. It then uses a \scalebox to make the composite symbol 2x as large (or however large or small you desire).

\documentclass{article}
\usepackage{amssymb,graphicx,stackengine,xcolor}
\def\ucr{\scalebox{2}{\stackinset{c}{}{c}{-.2pt}{%
  \textcolor{white}{\sffamily\bfseries\small ?}}{%
  \rotatebox{45}{$\blacksquare$}}}}
\begin{document}
\ucr
\end{document}

enter image description here