aws/aws-cli — pull request #679 by jamesls (2014-02-28 21:40:58+00:00)
Title: Fix unicode argument processing for py2

In python2, sys.argv is a bytestring of whatever encoding
is used by the terminal. In python3, sys.argv is a list of unicode
strings. This causes problems because the rest of the code assumes
unicode.

The fix is to automatically decode to unicode based on sys.stdin
as soon as we parse the args.

This was originally reported in #593, and
https://github.com/boto/botocore/pull/218.

I'll need to more investigation to see if this problem applies
to JSON files via file://, this commit only fixes the case where
unicode is specified on the command line.

Before:
```
$ aws elasticbeanstalk create-application --application-name ✓

'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)
```

After:

```
$ aws elasticbeanstalk create-application --application-name ✓
{
"Application": {
"ApplicationName": "\u00e2\u009c\u0093",
"ConfigurationTemplates": [],
"DateUpdated": "2014-02-28T21:39:52.988Z",
"Versions": [],
"DateCreated": "2014-02-28T21:39:52.988Z"
}
}
```