# LaTeX incorrectly displays a URL with Cyrillic characters

Hello everyone

\documentclass[a4paper,12pt]{article}

%%% Работа с русским языком
\usepackage{cmap}                   % поиск в PDF
\usepackage[T2A]{fontenc}           % кодировка
\usepackage[utf8]{inputenc}         % кодировка исходного текста
\usepackage[english,russian]{babel} % локализация и переносы

%%% ссылки
\usepackage[unicode, pdftex]{hyperref}

\begin{document} % Конец преамбулы, начало текста.

\begin{thebibliography}{2}
\bibitem{Доступное объяснение ROC и AUC!}
\textbf{Доступное объяснение ROC и AUC!:} \url{https://www.youtube.com/watch?v=4jRBRDbJemM}

\bibitem{Вычисление ROC и AUC.}
\textbf{Вычисление ROC и AUC:} \url{https://dyakonov.org/2017/07/28/auc-roc-площадь-под-кривой-ошибок/}
\end{thebibliography}

\end{document}

• This won't work. You will have to percent encode the url. Or use \href to separate the url and the printing. With the unicode engines you can use ideas from here tex.stackexchange.com/q/355136/2388 Nov 30, 2021 at 14:16

I would like to recommend very strongly that you switch to either XeLaTeX or LuaLaTeX to compile your code and that you employ a suitable Opentype font. You may also want to load the xurl package; then specify \urlstyle{same} unless you can also load a mono-spaced font that features both Latin and Cyrillic characters.

Addendum: As @UlrikeFischer has pointed out in a comment, this approach isn't guaranteed to work for all conceivable pdf viewers and web browsers. I can report (happily...) that the approach does appear to work for the Adobe Reader / Safari browswer combination.

% !TEX TS-program = xelatex
\documentclass[a4paper,12pt]{article}

\usepackage{fontspec} % 'fontspec' requires LuaLaTeX or XeLaTeX
%% see https://fonts.google.com/noto for "Noto" font families
\setmainfont{Noto Serif} % or some other suitable font
\setsansfont{Noto Sans}
\setmonofont{Noto Mono}

\usepackage[english,russian]{babel} % локализация и переносы

%%% ссылки
\usepackage{xurl} % allow line breaks anywhere in URL strings
%\urlstyle{same}  % optional

\begin{document} % Конец преамбулы, начало текста.

\begin{thebibliography}{2}

\bibitem{Доступное объяснение ROC и AUC!}
\textbf{Доступное объяснение ROC и AUC!:}

\bibitem{Вычисление ROC и AUC.}
\textbf{Вычисление ROC и AUC:}
\url{https://dyakonov.org/2017/07/28/auc-roc-площадь-под-кривой-ошибок/}

\end{thebibliography}

\end{document}

• while this will print the link correctly, it will not give a valid link in the pdf. It will work with some pdf viewers, but there is no garanty. Nov 30, 2021 at 15:03
• @UlrikeFischer - thanks. My one and only pdf viewer is Adobe Reader, and my web browser is Safari (I'm a MacOS person...). With this combination, there doesn't seem to be a problem with the link being invalid. I'll readily concede that other combinations of pdf viewer and web browser may not work as well. I'll add a note to this effect to my answer.
– Mico
Nov 30, 2021 at 15:14
• it worked for me after I changed the font names: \usepackage{noto-serif} \usepackage{noto-sans} \usepackage{noto-mono} Nov 30, 2021 at 15:58
• @DarMaster - Glad to heat that you're able to make use of the proposed solution. :-) About font naming conventions: that's definitely still an area that could stand a lot of consolidation and standardization across computer systems. On my particular system (MacOS 12.0.1 "Moneterey", MacTeX2021), Noto Serif and noto-serif are both valid, under both XeLaTeX and LuaLaTeX. On other systems, though, there may well be a need to choose one or the other font-naming convention. As I said, we'd all warmly welcome some more standardization in this field...
– Mico
Nov 30, 2021 at 16:11