This question is very similar to
Special characters in DOI leading to invalid URLs
but the solution found in the above Q&A doesn't work with biblatex-chicago.
Specifically, I have to deal with DOIs with special characters: for example,
10.1175/1520-0485(1975)005<0300:CTWIAS>2.0.CO;2
But, the URL which directly corresponds to this DOI
https://doi.org/10.1175/1520-0485(1975)005<0300:CTWIAS>2.0.CO;2
includes invalid characters as a URL. How can one set things up so that such DOIs as this are correctly encoded when they are turned into URLs?
The solution found in the above Q&A was to use the doi package and
\doi{10.1175/1520-0485(1975)005<0300:CTWIAS>2.0.CO;2}
So, the solution was simple: Just \usepackage{doi}. This solution works in the traditional LaTeX + BibTeX way because bib styles tend to use the \doi macro.
As the following code demonstrates, however, this method doesn't work with biblatex-chicago. The hyperlinks it generates still contain invalid URLs, which some PDF viewers (like Mac's Preview) cannot handle. The code below also demonstrates that the \doi macro itself produces correctly encoded URLs. Apparently, biblatex-chicago doesn't use the \doi command.
\documentclass[11pt]{article}
\usepackage[doi=only]{biblatex-chicago}
\usepackage{doi}
\begin{filecontents}[overwrite,noheader]{tmp.bib}
@article{ref-with-odd-doi,
title = {Coastal Trapped Waves in a Stratified Ocean},
author = {Allen, J. S.},
year = {1975},
journal = {J. Phys. Oceanogr.},
volume = {5},
pages = {300--325},
doi = {10.1175/1520-0485(1975)005<0300:CTWIAS>2.0.CO;2}
}
@article{ref-with-nice-doi,
title = {Something},
author = {Some Author},
year = {1975},
journal = {Some Journal},
volume = {5},
pages = {300--325},
doi = {10.1016/j.dsr.2003.09.011}
}
\end{filecontents}
\bibliography{tmp}
\begin{document}
\noindent
\cite{ref-with-odd-doi}\\
\cite{ref-with-nice-doi}\\
\doi{10.1175/1520-0485(1975)005<0300:CTWIAS>2.0.CO;2}\\
\doi{10.1016/j.dsr.2003.09.011}\\
\printbibliography
\end{document}