I'm using LuaLaTex, TexShop, class Memoir.
I'm trying to make a hyperlinked text with the destination URL containing Unicode characters. For example, https://namu.wiki/w/대전역.
Manually converting Unicode characters to percent encoding and putting the output into \href works:
\href{https://namu.wiki/w/\%EB\%8C\%80\%EC\%A0\%84\%EC\%97\%AD}{대전역 link} One disadvantage is that it is very bothersome. Is there a more convenient way to do this?
Enabling the Unicode option \usepackage[unicode]{hyperref} didn't work, and I'm hearing that some PDF viewers can't handle such PDF files even when it does work.
MWE
\class{memoir} \usepackage{hyperref} \begin{document} \href{https://namu.wiki/w/\%EB\%8C\%80\%EC\%A0\%84\%EC\%97\%AD}{대전역 link} % This correctly produces a working hyperlink to https://namu.wiki/w/대전역 \href{https://namu.wiki/w/대전역}{대전역 link} % Clicking this will get you to https://namu.wiki/w/ (note: 대전역 omitted) \end{document}
https://namu.wiki/w/%EB%8C%80%EC%A0%84%EC%97%AD. I think this is better solution than using a Lua function, because you can then copy paste your TeX source to some other files using xelatex for example or even pdflatex. Also you do link validity checking while writing your source. And it takes very little extra time.\href{https://namu.wiki/w/%EB%8C%80%EC%A0%84%EC%97%AD}{there}works with no need to TeX-escape the%characters, when this\href{...}{...}is not grabbed as argument of some other macro.\hrefurl[urlencode]in tex.stackexchange.com/a/673889/250119