Encode the text before print it to console

Closes-Bug: #1250490
Change-Id: I516806a0f8a136bb66c64dcdcd07cee6d297e619
Merge "Encode the text before print it to console"