Talk in English - US at Longhorn PHP 2025
Track Name:
Hill Country D
Short URL: https://joind.in/talk/6e0f8
(QR-Code (opens in new window))
Slides: https://evanhahn.com/longhornphp2025/slides.pdf
The farmer emoji (👩🏾🌾) is a bit of a mystery.
PHP's strlen function says that its length is 15. mb_strlen gives a length of 4 (depending on how PHP is configured). The grapheme_strlen function returns a length of 1.
Why do all these functions disagree? And there's just one emoji there...shouldn't they all have the same length: 1?
To understand this madness, you need to understand a little about Unicode. Many developers, myself included, get intimidated by Unicode. What's "UTF-8"? What's a "code point"? What does "U+1F937" mean?
In this talk, I'll try to answer these questions so that the next time someone gets confused by the length of the farmer emoji, you can help.
Comments
Please login to leave a comment
This was actually very informative, and very well presented. The presentation was organized and not too information dense. This topic is also super interesting! 🤔 👩🏾🌾
Best slides I have seen all conference. Wish the session would have ran longer and talked about how to work with Unicode and store in database. Great presenter.