# Unicode Code Point Escape Syntax

> Section in “New and Extended Functionality › Internationalisation and Unicode” of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/new-and-extended-functionality/internationalisation-and-unicode/unicode-code-point-escape-syntax/>

As we have previously pointed out, PHP is notoriously bad at supporting UTF-8 or Unicode in general, at least with regard to its internal functions. Aside from the functions provided by the `iconv` and `mbstring` extensions, PHP is oblivious of any encoding.

This is particularly annoying when it comes to all the Unicode special chars and control codes that affect formatting. If they are part of the actual source code any Unicode aware editor or IDE would honor them – and potentially render the source code unreadable.

To address this and to close the gap to other programming languages that already have a similar feature, PHP 7 now supports Unicode escape sequences within double quoted strings. When executed, this code would output an Unicode smiley on supporting terminals:

``` php
echo "\u{1F602}";
```

As a result of this addition, strings containing `\u{` followed by an invalid sequence will now trigger an error. Strings that merely contain `\u` are not affected.

---

Previous: [Internationalisation and Unicode](https://php7explained.com/new-and-extended-functionality/internationalisation-and-unicode/index.html.md) | Next: [Improvements to mbstring](https://php7explained.com/new-and-extended-functionality/internationalisation-and-unicode/improvements-to-mbstring/index.html.md)
