Replace chars we can't decode with placeholder char #953
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It's possible that the console output from EC2 contains
non string chars we can't utf-8 decode. When that happens
we were previously just leaving the input untouched, i.e
base64 encoded.
This made for an awkward interface for customers. We couldn't guarantee
whether or not the content was base64 decoded because it would depend
on the actual ec2 console output content.
This change attempts to make things more consistent by
replacing any chars we can't decode with the unicode
\ufffd
char (the unicode replace char, i.e the question mark).The one downside with this approach is that it is possible
to sometimes not get the unaltered contents of the console
output because chars have been replaced with
\ufffd
.We'll need to weigh whether or not we think that's worth
the benefit. Given this content is usually text content,
this seems like a reasonable compromise.
cc @kyleknap @JordonPhillips