[Tex/LaTex] How to use new unicode characters

input-encodingspackagestexmakerunicode

I know, there are lots of questions about Unicode and I've read a lot of these. But I wasn't able to solve my problem:

I have to use the characters ↊ and ↋ (U+218A and U+218B) in my text. I tried with LaTeX and XeLaTeX and several packages. But it always sais

! Package inputenc Error: Unicode char ↊ (U+218A)(inputenc) not set up for use with LaTeX.See the inputenc package documentation for explanation.Type H for immediate help….

What can I try? How can I set it up for use?
I'm using Texmaker on windows 10 with MikTeX.
Thanks!

Best Answer

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\DeclareUnicodeCharacter{218A}{\turnedtwo}
\DeclareUnicodeCharacter{218B}{\turnedthree}

\makeatletter
\DeclareRobustCommand{\turnedtwo}{\make@turned{2}}
\DeclareRobustCommand{\turnedthree}{\make@turned{3}}
\newcommand{\make@turned}[1]{%
  \raisebox{\depth}{\scalebox{-1}[-1]{#1}}%
}
\makeatother

\begin{document}

123456789↊↋0

\end{document}

Not sure whether this renders correctly, so I provide also an image of the code.

enter image description here

Output for the test file:

enter image description here

Addition October 2021

Prompted by comments, here's a version that works with all engines. I only provide the image of the code, because just a few fonts sport the glyph (among them, Fira Code).

enter image description here