cli: Use UTF-8 for writing output files

Currently when the CLI opens an output file due to a redirection it
opens it using the ASCII character encoding. If the text written to the
file contains characters outside of the ASCII set an exception is
generated. This patch changes the CLI so that it uses UTF-8 when writing
these files.

Change-Id: Ibe4eae82d3360c678cba133106e4a30ab930ca3b
Bug-Url: https://bugzilla.redhat.com/1126763
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
(cherry picked from commit 80ed3042919b6cf4442cb5a8bae9117a934b56b8)