Fix an encode problem.

stdout can be in any encoding.

So print encode to that encoding and eventually xmlcharrefreplace if encoding (like ascii) can't encode every unicode char.
Merge pull request #1369 from gst/fix_jenkins_unicode_problem

Fix an encode problem.