10000 Add doc about unicode requirements · symfony/symfony-docs@75ed392 · GitHub
[go: up one dir, main page]

Skip to content

Commit 75ed392

Browse files
Add doc about unicode requirements
1 parent a7f704c commit 75ed392

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
@@ -159,6 +159,17 @@ Path Parameters
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