10000 feature #6890 [Routing] Add doc about unicode requirements (nicolas-g… · symfony/symfony-docs@e9ce9ec · GitHub
[go: up one dir, main page]

Skip to content

Commit e9ce9ec

Browse files
committed
feature #6890 [Routing] Add doc about unicode requirements (nicolas-grekas)
This PR was merged into the master branch. Discussion ---------- [Routing] Add doc about unicode requirements Ref. symfony/symfony#19604 Commits ------- 75ed392 Add doc about unicode requirements
2 parents f58526e + 75ed392 commit e9ce9ec

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

routing/requirements.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
159159
``/es`` *won't match this route*
160160
======= ========================
161161

162+
.. note::
163+
164+
Since Symfony 3.2, you can enable UTF-8 route matching by setting the ``utf8``
165+
option when declaring or importing routes. This will make e.g. a ``.`` in
166+
requirements match any UTF-8 characters instead of just a single byte.
167+
The option is automatically enabled whenever a route or a requirement uses any
168+
non-ASCII UTF-8 characters or a `PCRE Unicode property`_ (``\p{xx}``,
169+
``\P{xx}`` or ``\X``). Note that this behavior is deprecated and a
170+
`LogicException` will be thrown instead in 4.0 unless you explicitly turn
171+
on the `utf8` option.
172+
162173
.. tip::
163174

164175
The route requirements can also include container parameters, as explained
@@ -287,3 +298,5 @@ Adding Dynamic Requirements with Expressions
287298

288299
For really complex requirements, you can use dynamic expressions to match *any*
289300
information on the request. See :doc:`/routing/conditions`.
301+
302+
.. _`PCRE Unicode property`: http://php.net/manual/en/regexp.reference.unicode.php

0 commit comments

Comments
 (0)
0