% \iffalse meta-comment
%
% Copyright 2026 Javier Bezos
% 
% This file is part of the Babel system.
% --------------------------------------
% 
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
% 
% This work has the LPPL maintenance status "maintained".
% 
% The Current Maintainer of this work is Javier Bezos.
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{licr2uni.dtx}
%</driver>
%<cyrl>\ProvidesFile{cyrl2uni.def}
%<*cyrl>
    [2026/05/03 v0.3 Map to Unicode from Cyrillic LICR]
%</cyrl>
%<*driver>
\documentclass{ltxdoc}
\usepackage[utf8]{inputenc}
\usepackage[T2A,TU]{fontenc}
\usepackage{hyperref}
\begin{document}
  \DocInput{licr2uni.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \* Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \GetFileInfo{licr2uni.dtx}
%
% \title{The \textsf{licr2uni} definition files}
% \author{}
% \date{\filedate}
%
% \maketitle
%
% \section{Introduction}
%
% This file provides the necessary definitions to map \LaTeX\ internal
% character representation (LICR) commands to their corresponding
% Unicode points when using Unicode-aware engines like Xe\LaTeX\ or
% Lua\LaTeX. The mapping is direct from the LICR macros to the
% corresponding Unicode characters.
%
% It’s still a beta release and currently only Cyrillic characters are defined.
%
% The definition files are standalone and don't require \textsc{babel}.
%
% \section{Implementation}
%
%    \begin{macrocode}
%<*cyrl>

\DeclareTextAccent{\U}{TU}{"0306}
\DeclareTextAccent{\C}{TU}{"030F}

\ExplSyntaxOn

\cs_set:Npn \cyrltouni_character:nn #1#2{%
  \exp_args:Nnnx \DeclareTextCommand {#2} {TU} {\Uchar#1}}
\cs_set:Npn \cyrltouni_composite:nnn #1#2#3{%
  \exp_args:Nnnnx \DeclareTextCompositeCommand {#2} {TU} {#3} {\Uchar#1}}%
  
\cyrltouni_composite:nnn{"0400} {\`} {\CYRE}
\cyrltouni_character:nn {"0401} {\CYRYO}
\cyrltouni_character:nn {"0402} {\CYRDJE}
\cyrltouni_composite:nnn{"0403} {\'} {\CYRG}
\cyrltouni_character:nn {"0404} {\CYRIE}
\cyrltouni_character:nn {"0405} {\CYRDZE}
\cyrltouni_character:nn {"0406} {\CYRII}
\cyrltouni_character:nn {"0407} {\CYRYI}
\cyrltouni_character:nn {"0408} {\CYRJE}
\cyrltouni_character:nn {"0409} {\CYRLJE}
\cyrltouni_character:nn {"040A} {\CYRNJE}
\cyrltouni_character:nn {"040B} {\CYRTSHE}
\cyrltouni_composite:nnn{"040C} {\'} {\CYRK}
\cyrltouni_composite:nnn{"040D} {\`} {\CYRI}
\cyrltouni_character:nn {"040E} {\CYRUSHRT}
\cyrltouni_character:nn {"040F} {\CYRDZHE}
\cyrltouni_character:nn {"0410} {\CYRA}
\cyrltouni_character:nn {"0411} {\CYRB}
\cyrltouni_character:nn {"0412} {\CYRV}
\cyrltouni_character:nn {"0413} {\CYRG}
\cyrltouni_character:nn {"0414} {\CYRD}
\cyrltouni_character:nn {"0415} {\CYRE}
\cyrltouni_character:nn {"0416} {\CYRZH}
\cyrltouni_character:nn {"0417} {\CYRZ}
\cyrltouni_character:nn {"0418} {\CYRI}
\cyrltouni_character:nn {"0419} {\CYRISHRT}
\cyrltouni_character:nn {"041A} {\CYRK}
\cyrltouni_character:nn {"041B} {\CYRL}
\cyrltouni_character:nn {"041C} {\CYRM}
\cyrltouni_character:nn {"041D} {\CYRN}
\cyrltouni_character:nn {"041E} {\CYRO}
\cyrltouni_character:nn {"041F} {\CYRP}
\cyrltouni_character:nn {"0420} {\CYRR}
\cyrltouni_character:nn {"0421} {\CYRS}
\cyrltouni_character:nn {"0422} {\CYRT}
\cyrltouni_character:nn {"0423} {\CYRU}
\cyrltouni_character:nn {"0424} {\CYRF}
\cyrltouni_character:nn {"0425} {\CYRH}
\cyrltouni_character:nn {"0426} {\CYRC}
\cyrltouni_character:nn {"0427} {\CYRCH}
\cyrltouni_character:nn {"0428} {\CYRSH}
\cyrltouni_character:nn {"0429} {\CYRSHCH}
\cyrltouni_character:nn {"042A} {\CYRHRDSN}
\cyrltouni_character:nn {"042B} {\CYRERY}
\cyrltouni_character:nn {"042C} {\CYRSFTSN}
\cyrltouni_character:nn {"042D} {\CYREREV}
\cyrltouni_character:nn {"042E} {\CYRYU}
\cyrltouni_character:nn {"042F} {\CYRYA}
\cyrltouni_character:nn {"0430} {\cyra}
\cyrltouni_character:nn {"0431} {\cyrb}
\cyrltouni_character:nn {"0432} {\cyrv}
\cyrltouni_character:nn {"0433} {\cyrg}
\cyrltouni_character:nn {"0434} {\cyrd}
\cyrltouni_character:nn {"0435} {\cyre}
\cyrltouni_character:nn {"0436} {\cyrzh}
\cyrltouni_character:nn {"0437} {\cyrz}
\cyrltouni_character:nn {"0438} {\cyri}
\cyrltouni_character:nn {"0439} {\cyrishrt}
\cyrltouni_character:nn {"043A} {\cyrk}
\cyrltouni_character:nn {"043B} {\cyrl}
\cyrltouni_character:nn {"043C} {\cyrm}
\cyrltouni_character:nn {"043D} {\cyrn}
\cyrltouni_character:nn {"043E} {\cyro}
\cyrltouni_character:nn {"043F} {\cyrp}
\cyrltouni_character:nn {"0440} {\cyrr}
\cyrltouni_character:nn {"0441} {\cyrs}
\cyrltouni_character:nn {"0442} {\cyrt}
\cyrltouni_character:nn {"0443} {\cyru}
\cyrltouni_character:nn {"0444} {\cyrf}
\cyrltouni_character:nn {"0445} {\cyrh}
\cyrltouni_character:nn {"0446} {\cyrc}
\cyrltouni_character:nn {"0447} {\cyrch}
\cyrltouni_character:nn {"0448} {\cyrsh}
\cyrltouni_character:nn {"0449} {\cyrshch}
\cyrltouni_character:nn {"044A} {\cyrhrdsn}
\cyrltouni_character:nn {"044B} {\cyrery}
\cyrltouni_character:nn {"044C} {\cyrsftsn}
\cyrltouni_character:nn {"044D} {\cyrerev}
\cyrltouni_character:nn {"044E} {\cyryu}
\cyrltouni_character:nn {"044F} {\cyrya}
\cyrltouni_composite:nnn{"0450} {\`} {\cyre}
\cyrltouni_character:nn {"0451} {\cyryo}
\cyrltouni_character:nn {"0452} {\cyrdje}
\cyrltouni_composite:nnn{"0453} {\'} {\cyrg}
\cyrltouni_character:nn {"0454} {\cyrie}
\cyrltouni_character:nn {"0455} {\cyrdze}
\cyrltouni_character:nn {"0456} {\cyrii}
\cyrltouni_character:nn {"0457} {\cyryi}
\cyrltouni_character:nn {"0458} {\cyrje}
\cyrltouni_character:nn {"0459} {\cyrlje}
\cyrltouni_character:nn {"045A} {\cyrnje}
\cyrltouni_character:nn {"045B} {\cyrtshe}
\cyrltouni_composite:nnn{"045C} {\'} {\cyrk}
\cyrltouni_composite:nnn{"045D} {\`} {\cyri}
\cyrltouni_character:nn {"045E} {\cyrushrt}
\cyrltouni_character:nn {"045F} {\cyrdzhe}
\cyrltouni_character:nn {"0462} {\CYRYAT}
\cyrltouni_character:nn {"0463} {\cyryat}
\cyrltouni_character:nn {"046A} {\CYRBYUS}
\cyrltouni_character:nn {"046B} {\cyrbyus}
\cyrltouni_character:nn {"0472} {\CYRFITA}
\cyrltouni_character:nn {"0473} {\cyrfita}
\cyrltouni_character:nn {"0474} {\CYRIZH}
\cyrltouni_character:nn {"0475} {\cyrizh}
\cyrltouni_composite:nnn{"0476} {\C} {\CYRIZH}
\cyrltouni_composite:nnn{"0477} {\C} {\cyrizh}
\cyrltouni_character:nn {"048C} {\CYRSEMISFTSN}
\cyrltouni_character:nn {"048D} {\cyrsemisftsn}
\cyrltouni_character:nn {"048E} {\CYRRTICK}
\cyrltouni_character:nn {"048F} {\cyrrtick}
\cyrltouni_character:nn {"0490} {\CYRGUP}
\cyrltouni_character:nn {"0491} {\cyrgup}
\cyrltouni_character:nn {"0492} {\CYRGHCRS}
\cyrltouni_character:nn {"0493} {\cyrghcrs}
\cyrltouni_character:nn {"0494} {\CYRGHK}
\cyrltouni_character:nn {"0495} {\cyrghk}
\cyrltouni_character:nn {"0496} {\CYRZHDSC}
\cyrltouni_character:nn {"0497} {\cyrzhdsc}
\cyrltouni_character:nn {"0498} {\CYRZDSC}
\cyrltouni_character:nn {"0499} {\cyrzdsc}
\cyrltouni_character:nn {"049A} {\CYRKDSC}
\cyrltouni_character:nn {"049B} {\cyrkdsc}
\cyrltouni_character:nn {"049C} {\CYRKVCRS}
\cyrltouni_character:nn {"049D} {\cyrkvcrs}
\cyrltouni_character:nn {"049E} {\CYRKHCRS}
\cyrltouni_character:nn {"049F} {\cyrkhcrs}
\cyrltouni_character:nn {"04A0} {\CYRKBEAK}
\cyrltouni_character:nn {"04A1} {\cyrkbeak}
\cyrltouni_character:nn {"04A2} {\CYRNDSC}
\cyrltouni_character:nn {"04A3} {\cyrndsc}
\cyrltouni_character:nn {"04A4} {\CYRNG}
\cyrltouni_character:nn {"04A5} {\cyrng}
\cyrltouni_character:nn {"04A6} {\CYRPHK}
\cyrltouni_character:nn {"04A7} {\cyrphk}
\cyrltouni_character:nn {"04A8} {\CYRABHHA}
\cyrltouni_character:nn {"04A9} {\cyrabhha}
\cyrltouni_character:nn {"04AA} {\CYRSDSC}
\cyrltouni_character:nn {"04AB} {\cyrsdsc}
\cyrltouni_character:nn {"04AC} {\CYRTDSC}
\cyrltouni_character:nn {"04AD} {\cyrtdsc}
\cyrltouni_character:nn {"04AE} {\CYRY}
\cyrltouni_character:nn {"04AF} {\cyry}
\cyrltouni_character:nn {"04B0} {\CYRYHCRS}
\cyrltouni_character:nn {"04B1} {\cyryhcrs}
\cyrltouni_character:nn {"04B2} {\CYRHDSC}
\cyrltouni_character:nn {"04B3} {\cyrhdsc}
\cyrltouni_character:nn {"04B4} {\CYRTETSE}
\cyrltouni_character:nn {"04B5} {\cyrtetse}
\cyrltouni_character:nn {"04B6} {\CYRCHRDSC}
\cyrltouni_character:nn {"04B7} {\cyrchrdsc}
\cyrltouni_character:nn {"04B8} {\CYRCHVCRS}
\cyrltouni_character:nn {"04B9} {\cyrchvcrs}
\cyrltouni_character:nn {"04BA} {\CYRSHHA}
\cyrltouni_character:nn {"04BB} {\cyrshha}
\cyrltouni_character:nn {"04BC} {\CYRABHCH}
\cyrltouni_character:nn {"04BD} {\cyrabhch}
\cyrltouni_character:nn {"04BE} {\CYRABHCHDSC}
\cyrltouni_character:nn {"04BF} {\cyrabhchdsc}
\cyrltouni_character:nn {"04C0} {\CYRpalochka}
\cyrltouni_composite:nnn{"04C1} {\U} {\CYRZH}
\cyrltouni_composite:nnn{"04C2} {\U} {\cyrzh}
\cyrltouni_character:nn {"04C3} {\CYRKHK}
\cyrltouni_character:nn {"04C4} {\cyrkhk}
\cyrltouni_character:nn {"04C5} {\CYRLDSC}
\cyrltouni_character:nn {"04C6} {\cyrldsc}
\cyrltouni_character:nn {"04C7} {\CYRNHK}
\cyrltouni_character:nn {"04C8} {\cyrnhk}
\cyrltouni_character:nn {"04CB} {\CYRCHLDSC}
\cyrltouni_character:nn {"04CC} {\cyrchldsc}
\cyrltouni_character:nn {"04CD} {\CYRMDSC}
\cyrltouni_character:nn {"04CE} {\cyrmdsc}
\cyrltouni_composite:nnn{"04D0} {\U} {\CYRA}
\cyrltouni_composite:nnn{"04D1} {\U} {\cyra}
\cyrltouni_composite:nnn{"04D2} {\"} {\CYRA}
\cyrltouni_composite:nnn{"04D3} {\"} {\cyra}
\cyrltouni_character:nn {"04D4} {\CYRAE}
\cyrltouni_character:nn {"04D5} {\cyrae}
\cyrltouni_composite:nnn{"04D6} {\U} {\CYRE}
\cyrltouni_composite:nnn{"04D7} {\U} {\cyre}
\cyrltouni_character:nn {"04D8} {\CYRSCHWA}
\cyrltouni_character:nn {"04D9} {\cyrschwa}
\cyrltouni_composite:nnn{"04DA} {\"} {\CYRSCHWA}
\cyrltouni_composite:nnn{"04DB} {\"} {\cyrschwa}
\cyrltouni_composite:nnn{"04DC} {\"} {\CYRZH}
\cyrltouni_composite:nnn{"04DD} {\"} {\cyrzh}
\cyrltouni_composite:nnn{"04DE} {\"} {\CYRZ}
\cyrltouni_composite:nnn{"04DF} {\"} {\cyrz}
\cyrltouni_character:nn {"04E0} {\CYRABHDZE}
\cyrltouni_character:nn {"04E1} {\cyrabhdze}
\cyrltouni_composite:nnn{"04E2} {\=} {\CYRI}
\cyrltouni_composite:nnn{"04E3} {\=} {\cyri}
\cyrltouni_composite:nnn{"04E4} {\"} {\CYRI}
\cyrltouni_composite:nnn{"04E5} {\"} {\cyri}
\cyrltouni_composite:nnn{"04E6} {\"} {\CYRO}
\cyrltouni_composite:nnn{"04E7} {\"} {\cyro}
\cyrltouni_character:nn {"04E8} {\CYROTLD}
\cyrltouni_character:nn {"04E9} {\cyrotld}
\cyrltouni_composite:nnn{"04EC} {\"} {\CYREREV}
\cyrltouni_composite:nnn{"04ED} {\"} {\cyrerev}
\cyrltouni_composite:nnn{"04EE} {\=} {\CYRU}
\cyrltouni_composite:nnn{"04EF} {\=} {\cyru}
\cyrltouni_composite:nnn{"04F0} {\"} {\CYRU}
\cyrltouni_composite:nnn{"04F1} {\"} {\cyru}
\cyrltouni_composite:nnn{"04F2} {\H} {\CYRU}
\cyrltouni_composite:nnn{"04F3} {\H} {\cyru}
\cyrltouni_composite:nnn{"04F4} {\"} {\CYRCH}
\cyrltouni_composite:nnn{"04F5} {\"} {\cyrch}
\cyrltouni_character:nn {"04F6} {\CYRGDSC}
\cyrltouni_character:nn {"04F7} {\cyrgdsc}
\cyrltouni_composite:nnn{"04F8} {\"} {\CYRERY}
\cyrltouni_composite:nnn{"04F9} {\"} {\cyrery}
\cyrltouni_character:nn {"04FA} {\CYRGDSCHCRS}
\cyrltouni_character:nn {"04FB} {\cyrgdschcrs}
\cyrltouni_character:nn {"04FC} {\CYRHHK}
\cyrltouni_character:nn {"04FD} {\cyrhhk}
\cyrltouni_character:nn {"04FE} {\CYRHHCRS}
\cyrltouni_character:nn {"04FF} {\cyrhhcrs}

\ExplSyntaxOff
%</cyrl>
%    \end{macrocode}
%
% \Finale
\endinput