Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Routing] Add doc about unicode requirements #6890

Merged
merged 1 commit into from
Sep 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions routing/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ Path Parameters
``/es`` *won't match this route*
======= ========================

.. note::

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need an example with the * prefix to make things real clear.

.. tip::

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

For really complex requirements, you can use dynamic expressions to match *any*
information on the request. See :doc:`/routing/conditions`.

.. _`PCRE Unicode property`: http://php.net/manual/en/regexp.reference.unicode.php