#!/usr/bin/env ruby require "htmlentities" STDIN.set_encoding "utf-8" STDOUT.set_encoding "utf-8" coder = HTMLEntities.new while line = STDIN.gets puts coder.decode(line.strip) end