Project: XML Encoding Filter
Write a filter program that transforms the input Unicode text stream into properly encoded XML. The characters left angle bracket, right angle bracket, ampersand, apostrophe and double quotes need to be converted to their corresponding XML entities <, >, &, ' and ". Any codepoint higher than 127 should be encoded as a hexadecimal character entity such as ሴ.
See [[List of XML and HTML character entity references]]
Output
$ python XMLEncodingFilter.py < ../../data/html/Minimal.html
<html lang='en'>
<head>
<title>Title Page</title>
</head>
<body>
<h1 align="center">Headline</h1>
<p>Body text &#9786;</p>
</body>
</html>
$ python XMLEncodingFilter.py < ../../data/text/UnicodeTest.utf8
Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.
Vor vier Punkten und sieben Jahren haben unsere Väter auf diesem Kontinent eine neue Nation hervorgebracht, die in Freiheit empfangen wurde und sich dem Vorschlag verschrieben hat, dass alle Menschen gleich geschaffen sind.
Τέσσερα σκορ και πριν από επτά χρόνια οι πατέρες μας έφεραν σε αυτή την ήπειρο, ένα νέο έθνος, που σχεδιάστηκε στην Ελευθερία και αφιερώθηκε στην πρόταση ότι όλοι οι άνθρωποι δημιουργούνται ίσοι.
أربع نقاط وقبل سبع سنوات قدم آباؤنا في هذه القارة ، أمة جديدة ، تم تصورها في الحرية ، ومكرسة لفرضية أن جميع الرجال خلقوا متساوين.
ארבע ציונים ולפני שבע שנים אבותינו הציגו ביבשת זו, אומה חדשה, שהגתה בחירות, והוקדשה לטענה שכל הגברים נוצרים שווים.
4スコアと7年前、私たちの父親は、この大陸で生まれた新しい国であり、リバティで考案され、すべての人が平等に創造されるという命題に献身しました。
4 점 7 년 전, 우리 조상들은 리버티에서 잉태 된 새로운 국가 인이 대륙에서 모든 사람들이 평등하게 창조되었다고 제안했습니다.
四年前七年前,我们的祖先在这个大陆上建立了一个新国家,这个国家是在自由中孕育的,致力于实现人人平等的主张。
Unicode 11 Emoji
🥰 Smiling Face with Hearts
🥵 Hot Face
🥶 Cold Face
🥴 Woozy Face
🥳 Partying Face
Unicode 10 Emoji
🤪 Zany Face
🤯 Exploding Head
🧐 Face with Monocle
🤬 Face with Symbols on Mouth
🦖 T-Rex
Unicode 9 Emoji
🤣 Rolling on the Floor Laughing
🤢 Nauseated Face
🤡 Clown Face
🦊 Fox
🦈 Shark
Unicode 8 Emoji
🤑 Money-Mouth Face
🤓 Nerd Face
🦁 Lion
🦄 Unicorn
🦀 Crab
Unicode 7 Emoji
🖖 Vulcan Salute
🐿 Chipmunk
🕷 Spider
🌶 Hot Pepper
🌪 Tornado
Precomposed vs. Decomposed
Å = Å
à = à
é = é
î = î
ñ = ñ
ü = ü
한 = 한
Graphemes that take two codepoints
Canada 🇨🇦
China 🇨🇳
France 🇫🇷
Greece 🇬🇷
Israel 🇮🇱
Japan 🇯🇵
Mexico 🇲🇽
UK 🇬🇧
US 🇺🇸