BibLaTeX long URL extending into border despite using biburllcpenalty
You could insert a bit stretchable space:
\documentclass[paper=A4,fontsize=12pt]{scrartcl}
\usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
\usepackage{fontspec}
\usepackage[backend=biber,style=authoryear,citestyle=authoryear]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}
\setcounter{biburllcpenalty}{100}
\setcounter{biburlucpenalty}{100}
\setcounter{biburlnumpenalty}{100}
\addbibresource{resource.bib}
\renewcommand*{\biburlsetup}{%
\Urlmuskip=0mu plus 3mu\relax
\mathchardef\UrlBigBreakPenalty=100\relax
\mathchardef\UrlBreakPenalty=200\relax
\def\UrlBigBreaks{\do\:\do\-}%
\def\UrlBreaks{%
\do\.\do\@\do\/\do\\\do\!\do\_\do\|\do\;\do\>\do\]\do\)\do\}%
\do\,\do\?\do\'\do\+\do\=\do\#\do\$\do\&\do\*\do\^\do\"}%
\ifnumgreater{\value{biburlnumpenalty}}{0}
{\def\do##1{\appto\UrlSpecials{\do##1{\mathchar`##1 \mskip 0mu plus 1mu\penalty\value{biburlnumpenalty}}}}%
\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9\do\0}
{}%
\ifnumgreater{\value{biburlucpenalty}}{0}
{\def\do##1{\appto\UrlSpecials{\do##1{\mathchar`##1 \mskip 0mu plus 1mu\penalty\value{biburlucpenalty}}}}%
\do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J
\do\K\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T
\do\U\do\V\do\W\do\X\do\Y\do\Z}
{}%
\ifnumgreater{\value{biburllcpenalty}}{0}
{\def\do##1{\appto\UrlSpecials{\do##1{\mathchar`##1 \mskip 0mu plus 1mu\penalty\value{biburllcpenalty}}}}%
\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j
\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t
\do\u\do\v\do\w\do\x\do\y\do\z}
{}%
\let\do=\noexpand}
\begin{document}
\cite{Test.2018}
\printbibliography
\end{document}
try
\usepackage[style=authoryear,citestyle=authoryear]{biblatex}
\usepackage{xurl}
biblatex
3.13 implements a way to add stretchable space to the URL in the way demonstrated in Ulrike Fischer's answer, see https://github.com/plk/biblatex/issues/850.
The relevant lengths are \biburlnumskip
, \biburlucskip
and \biburllcskip
.
\documentclass[paper=A4,fontsize=12pt]{scrartcl}
\usepackage[left=3cm, right=3cm, bottom=3cm, top=3cm]{geometry}
\usepackage{fontspec}
\usepackage[backend=biber,style=authoryear]{biblatex}
\DeclareNameAlias{default}{family-given}
\DeclareNameAlias{sortname}{default}
\setcounter{biburllcpenalty}{100}
\setcounter{biburlucpenalty}{100}
\setcounter{biburlnumpenalty}{100}
\biburlnumskip=0mu plus 1mu\relax
\biburlucskip=0mu plus 1mu\relax
\biburllcskip=0mu plus 1mu\relax
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{Test.2018,
author = {{testauthor test author testauthor}},
year = {2018},
title = {{testfile test file testfile}},
url = {http://abcdefghijklmnopqrstuvwxy.com/phrrFK5dS1ztTjiaCmveRARXpGBtV01U%20B93FcrxkOVhj2CceIguNuUPpwDaUD4GjTTWh9cL30D6rLgWxapYlhegDXQGFlE0hao7B2YS227ca%20keoWHWNmQVKVcNOUFxfsCp0SwCElfTVtpMv6DKqiSwhWgO2zrHvstd4UNBo99UQBSCTkzL7lD2UyRLTRy6xXdJ}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\cite{Test.2018}
\printbibliography
\end{document}