Filtering out unprintable characters before each printing

As mentioned in #39 and #51 , some characters though coded by utf8 still cannot be printed due to some restriction of the console coding. This revision detects the current encoding of the console and filters out all uncodable characters before print.

I am afraid that we have to use `myprint` rather than `print` for our future revisions. I know it will be ugly, but I cannot find a better solution.
Please share your ideas about this issue.