Convert CP437 to UTF-8 The goal is to read bytes from input encoded in Code Page 437 and output the same characters encoded as UTF-8.  That is, bytes should be translated into Unicode codepoints per this table (a particular revision of the Wikipedia article).  Bytes 0-31 and 127 are to be treated as graphics characters.

Rules

Input and output is via stdin/stdout, or something equivalent to it (only a function that performs the conversion doesn't qualify).  Input is 0 or more bytes before the input stream is closed.

Encoding with UTF-8 is part of the task (as is decoding the input as CP437), so to that end built-in functions or language features that perform conversion between character encodings are not allowed.  Submissions should implement the character encoding conversion themselves.

Scoring is pure code-golf, shortest code wins.  Code length is measured in bytes assuming the source code is encoded using UTF-8.

Example

A byte containing 0x0D received on input, representing '♪', should output bytes 0xE2, 0x99, 0xAA (in that order), which represents codepoint U+266A encoded in UTF-8.

Links


CP437 to Unicode conversion table
Summary of UTF-8 encoding
(Task) Unicode UTF Converter -- for converting between Unicode encodings.
Tcl, 675

eval [zlib i Ò×sgÆáB\nPÃïÿòpÁ\f0\fv®4\fBc!j¶%cluYbãdÃw¨)+½MB()zàõÍóÝ=\{vÏì®ÿ¢­Ö¶\rk×­áóUë\tÌÀOÖ)'*ð,ò¦Ì1\[¦y\v?e~oÀÛ\;¼3)ï*S!ïMgÀÜé¬0OVy_sÌÇï©³@ýa&gt;ÀoïæCMl°7ÎG¸«£Æ'º6Ä\"e±³DÆX*#,Ãïd¹êª²Á&amp;ü®Al±!¬Ì,KË³KÓØèÀ*tbU¶cCìÀöÓíc'VcæKl+¬(V\$µÇFI`ãtc#ô`ôbHbS¤°ú°~vã²ôãrìÁÀäD4!í%\$ÕÉcÃ°(E\\®În²vPÁÕ¨âSÃ5ØË°We?nÚ&gt;Ê°1\"ãÄOyÆð»3Ë,²¯d7dº2)\{iÈ=ý|-w3¥\tÈGå(NÖ0ÙÏ1ä¸lpBý\}\t¾e¾E¾i¾&lt;Y£)KCy~ÎÉçe\v2ÆEç¬rYV¸¢ç&amp;¹*»¸¦­\;¸.ÃÜ\]ÜnÉ\ ·ñùÄÇóÍ\ ?ãåøæîàÆøf»xEîá%¹WæÞ(¿é_àwíü7Æ:.ó¿3Ã_¸a©,ð·Ìó&gt;Veÿ°\tëtOpxªS&lt;ÃMð\\e/ð7Oñ7ÂÿzÍ4¯pé´lølÕjZÛV¯\]·råk]


Just a simple mapping between input and output. Decompressed it looks like

puts [string map { âº  â»  â¥  â¦  â£  â   â¢  â {  } â {
} â {} â {} â {
} âª  â«  â¼  âº  â  â  â¼  Â¶  Â§  â¬  â¨  â  â  â  â  â  â  â²  â¼  â  Ã  Ã¼  Ã©  Ã¢  Ã¤  Ã   Ã¥  Ã§  Ãª  Ã«  Ã¨  Ã¯  Ã®  Ã¬  Ã  Ã  Ã  Ã¦  Ã  Ã´  Ã¶  Ã²  Ã»  Ã¹  Ã¿  Ã  Ã  Â¢  Â£  Â¥  â§  Æ   Ã¡ ¡ Ã­ ¢ Ã³ £ Ãº ¤ Ã± ¥ Ã ¦ Âª § Âº ¨ Â¿ © â ª Â¬ « Â½ ¬ Â¼ ­ Â¡ ® Â« ¯ Â» ° â ± â ² â ³ â ´ â¤ µ â¡ ¶ â¢ · â ¸ â ¹ â£ º â » â ¼ â ½ â ¾ â ¿ â À â Á â´ Â â¬ Ã â Ä â Å â¼ Æ â Ç â È â É â Ê â© Ë â¦ Ì â  Í â Î â¬ Ï â§ Ð â¨ Ñ â¤ Ò â¥ Ó â Ô â Õ â Ö â × â« Ø âª Ù â Ú â Û â Ü â Ý â Þ â ß â à Î± á Ã â Î ã Ï ä Î£ å Ï æ Âµ ç Ï è Î¦ é Î ê Î© ë Î´ ì â í Ï î Îµ ï â© ð â¡ ñ Â± ò â¥ ó â¤ ô â  õ â¡ ö Ã· ÷ â ø Â° ù â ú Â· û â ü â¿ ý Â² þ â  ÿ Â } [read stdin]]