The following code will return error:
\documentclass{article}
\usepackage{hyperref,xurl}
\begin{document}
text\footnote{\url{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}}
\end{document}
In such a case, you can use the \urldef
command. See the page 2 in url.pdf:
Take for example the email address “myself%node@gateway.net" which
could not be given (using “\url” or “\verb”) in a caption or parbox
due to the percent sign. This address can be predefined with
\urldef{\myself}\url{myself%node@gateway.net} and then you may use
“\myself” instead of “\url{myself%node@gateway.net}” in an argument,
and even in a moving argument like a caption because a defined-url is
robust.
For example:
\documentclass{article}
\usepackage{hyperref,xurl}
\begin{document}
\urldef{\myurl}\url{https://www.bcb.gov.br/acessoinformacao/legado?url=https:%2F%2Fwww4.bcb.gov.br%2Fglossario.asp%3FDefinicao%3D1676%26idioma%3DP%26idpai%3DGLOSSARIO}
text\footnote{\myurl}
\end{document}

\url
? Since,\footnote{\url{<URL>}}
works out-of-the-box.\urldef
command.\%
was written in the URL address instead of%
! Without changing the address, it returns with an error! In addition, usingurl
package instead ofhyperref
gives a bad result! Please read theurl
user guide!