There is plain \uppercase macro as well as \MakeUppercase in latex3. The last one works perfectly fine with two bits utf-8 characters as long as you explicitly brace the argument
\MakeUppercase{здравей}
Now I would like to capitalize the only the first letter of a word. Of course you can make it straight \MakeUppercase{з}дравей and it will work, however in the real use-case, the word is variable and stored in a macro:
\def\footext{здравей}
\expandafter\MakeUppercase\footext
And here the problem rise up that David Carlisle greatly explained under this post: latex3 — issues with cyrillic.
Basically, because of that no command could grab first letter if not specified the argument explicitly:
\def\foo#1{#1}
\foo здарвей % error, the argument is only the first bit of 'з'
Is there a clever yet simple way of getting the desired result despite the text? So that it should support both one bit and two bit characters (even mixed).
Meanwhile I tried to create a bulk workaround, based on Ulrike Fischer's solution of unprotecting utf-8 character.
\documentclass{article}
\usepackage[T2A]{fontenc}
\makeatletter
\def\expandutfvii{%
\count@"C2
@tempcnta"F5
\def\UTFviii@tmp{\expandafter\def\expandafter~\expandafter{~}}%
\UTFviii@loop
}
\makeatother
\begin{document}
\ExplSyntaxOn
\expandutfvii
\tl_set:Nn \l_tmpa_tl {здравей}
\exp_last_unbraced:Nx \str_uppercase:n \l_tmpa_tl
\ExplSyntaxOff
\end{document}
It almost works, but I couldn't evaluate the string so that it would use those commands instead of printing them


undefinedon my TeXLive 2022 release. – antshar Aug 07 '22 at 22:52Undefined control sequence. \MakeTitlecase– antshar Aug 07 '22 at 22:58LaTeX2e <2022-06-01> patch level 5– Ulrike Fischer Aug 07 '22 at 23:06\MakeTitlecasemacro has been added just a month ago. Looking up the changes, figured out the working way:\text_titlecase:n {здравей}– antshar Aug 07 '22 at 23:06tlmgr update --all. This updates the packages. And once a year I install a new texlive. – Ulrike Fischer Aug 07 '22 at 23:11\MakeTitlecasedoes more than just ''uppercase the first codepoint'? – Joseph Wright Aug 08 '22 at 07:54