0

If the URLs contain Chinese characters, the tex will output error.
I used PdfLaTeX. Here is my situation.

\begin{CJK}{UTF8}{gbsn}
\begin{thebibliography}{99}
\bibitem{ref1}  \href{https://zh.wikipedia.org/wiki/中国-伊朗关系}{中国-伊朗关系}
\end{thebibliography}
\end{CJK}

Do anyone know how to solve this problem or how to convert Chinese characters in URLs into legal characters?

  • 1
    Welcome to tex.SX. Can you please post an MWE, i.e. a short, complete example that actually compiles? – Ingmar Apr 17 '23 at 05:10
  • 1
    https://tex.stackexchange.com/a/444458/250119 ■ https://tex.stackexchange.com/a/131332/250119 – user202729 Apr 17 '23 at 05:52
  • @user202729 simply detokenizing will not give valid urls in the pdf (even if they often work). It is safer to use percent encoded url, see https://tex.stackexchange.com/a/606334/2388 – Ulrike Fischer Apr 17 '23 at 08:25
  • Thank you, it really solved my problem. The browser usually change the Chinese characters to %, but it didn't change on wiki. – Tony Chow Apr 19 '23 at 15:15

0 Answers0