glib-mkenums: Python2: use locale encoding when redirecting stdout
glib-mkenums: Python2: use locale encoding when redirecting stdout

In case of Python 2 and stdout being redirected to a file, sys.stdout.encoding
is None and it defaults ASCII for encoding text.

To match the behaviour of Python 3, which uses the locale encoding also when
redirecting to a file, wrap sys.stdout with a StreamWriter using the
locale encoding.

https://bugzilla.gnome.org/show_bug.cgi?id=785113

endlessm/glib,johne53/MB3Glib,endlessm/glib,johne53/MB3Glib,johne53/MB3Glib,endlessm/glib,johne53/MB3Glib,johne53/MB3Glib,johne53/MB3Glib,endlessm/glib,endlessm/glib