\documentclass[UTF8]{ctexart}
\usepackage{xeCJKfntef}
\begin{document}
\CJKunderline{芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞芜湖起飞}
\end{document}
来源:https://tex.stackexchange.com/questions/385742/underline-in-mid-chinese-text
英文看这个:https://blog.csdn.net/qq_41961459/article/details/132892356