<p dir="auto">In my application users have localized usernames.<br>
So user switch functionality doesn't work for russian usernames (maybe because browser change urls to something like <a href="http://domain.com/?_switch_user=%CF%F3%F5" rel="nofollow">http://domain.com/?_switch_user=%CF%F3%F5</a></p>
<p dir="auto">As a reminder, the Routing component is not fully unicode aware. There are cases that work and some don't work.</p>
<p dir="auto">Using a unicode string as content for a routing variable works currently, e.g. <code class="notranslate">/{var}</code> with <code class="notranslate">var='€1'</code> works as expected (except normalization, see below).<br>
Unicode text inside the static route pattern can have some undefined behavior. So <code class="notranslate">/€/{var}</code> might work but <code class="notranslate">/€{var}</code> definitely doesn't work (as the <code class="notranslate">€</code> character is considered as seperator and then mangled by non-multibyte functions).</p>
<p dir="auto">For reference, a first, unfinished attempt at fixing this was made at <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3696397" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/3629" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/3629/hovercard" href="https://github.com/symfony/symfony/pull/3629">#3629</a>.</p>
<p dir="auto">Implementing this would require some heavy research as to which byte functions (<code class="notranslate">substr</code> etc.) need to be replaced by their multibyte variants in the Compiler, Generator, Matcher, Dumper. And by doing so, not to decrease performance if possible.</p>
<p dir="auto">Working with unicode, also requires to normalize the representation. So it generates/matches the same URL that only differs by unicode composition. See <a href="http://php.net/manual/de/class.normalizer.php" rel="nofollow">http://php.net/manual/de/class.normalizer.php</a></p>
<p dir="auto">Other helpful resource: <a href="http://www.phpwact.org/php/i18n/utf-8" rel="nofollow">http://www.phpwact.org/php/i18n/utf-8</a></p>