I want to make stressed cyrillic letters in TeX Live 2023. Compiling of the following file
\documentclass[russian,english]{article} \usepackage[utf8]{inputenc} \usepackage{babel} \begin{document} \selectlanguage{russian} Stressed cyrillic letters: \'в\'ф\'ы \end{document}
leads to the error
l.11 Stressed cyrillic: \'в\'Ñ„\'Ñ ‹ The document does not appear to be in UTF-8 encoding. Try adding \UseRawInputEncoding as the first line of the file or specify an encoding such as \usepackage [latin1]{inputenc} in the document preamble. Alternatively, save the file in UTF-8 using your editor or another tool
I'm sure that the encoding of the file is really UTF-8. If I change it to cp1251 (and change the second line to \usepackage[cp1251]{inputenc}) everything works fine.
How can I make stressed cyrillic letters in UTF?