[swift-users] emoji in source code failed to compile in linux ubuntu

Quinn "The Eskimo!" eskimo1 at apple.com
Fri Dec 4 05:28:39 CST 2015


On 4 Dec 2015, at 11:12, Alex Blewitt <alex.blewitt at gmail.com> wrote:

> However it looks like the character is being encoded in your file as: ed a0 bd ed b8 80 which I’m not sure where that’s come from.

I can explain that.  U+1F603 is encoded in UTF-16 as d83d de03.  If you encode each of these separately as UTF-8, you get ed a0 bd followed by ed b8 80.  That's not the correct way to encode U+1F603 as UTF-8, hence the failure.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware




More information about the swift-users mailing list