Fabien Potencier ae2d59da05 bug #2427 Fixed JS escaping for unicode characters with higher code points (mikealmond)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #2427).

Discussion
----------

Fixed JS escaping for unicode characters with higher code points

Unicode characters with higher code points were being escaped incorrectly. When these characters are escaped, they should maintain their surrogate halves. Previously, Twig was dropping the first surrogate half.

https://mathiasbynens.be/notes/javascript-escapes#unicode-code-point
> The tetragram for centre symbol (𝌆) has code point U+1D306, so you could write it as \u{1D306}. For comparison, if you were to use simple Unicode escapes to represent this symbol, you’d have to write out the surrogate halves separately: '\uD834\uDF06'.

Commits
-------

7f913495 Fixed JS escaping for unicode characters with higher code points
2017-03-17 10:19:15 -07:00
2017-03-12 08:19:54 -07:00
2017-02-26 16:07:56 -08:00
2017-03-11 20:03:13 +01:00
2017-03-11 20:03:13 +01:00
2017-03-11 20:03:13 +01:00

Twig, the flexible, fast, and secure template language for PHP
==============================================================

Twig is a template language for PHP, released under the new BSD license (code
and documentation).

Twig uses a syntax similar to the Django and Jinja template languages which
inspired the Twig runtime environment.

More Information
----------------

Read the `documentation`_ for more information.

.. _documentation: http://twig.sensiolabs.org/documentation
Languages
PHP 99.9%