#!/usr/bin/php
<?php
echo preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, html_entity_decode(file_get_contents('php://stdin'))); 

