Current page title doing unnecessary URL encoding
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3217911. -->
Reported by: [erik.erskine](https://www.drupal.org/user/375884)
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p><code>CurrentPageTitle</code> is relying on <code>urlencode</code> to do HTML escaping. But <code>urlencode</code> does other things we don't want here, like turning non-ASCII characters into percent-encoded values.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>According to <code>Drupal\Core\Controller\TitleResolverInterface</code>, where we're getting the title from, title can be either:</p>
<ul>
<li>a render array like <code>['#markup' => 'title', '#allowed_tags' => ['em']]</code>
</li><li>a string
</li></ul>
<p>So if <code>$value</code> is an array, we should call <code>render($value)</code>. If it's a string, we can let twig auto-escape it (as now).</p>
issue