Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xdg_directories] Fix stdout encoding handling #277

Merged
merged 1 commit into from
Feb 3, 2021

Conversation

stuartmorgan
Copy link
Contributor

The stdoutEncoding was originally specified as a by-name lookup of
"utf8"; this was actually equivalent to 'null', since that's not the
correct name. During the null safety migration, a fallback to
systemEncoding was added, causing it to always have an encoding. This
changed the type of result.stdout, so all calls gave a type error.

This fixes the issue by using 'utf8', the singleton encoder object,
rather than doing a name lookup, so the type will predicably be a
string, and adjusting the code reading it to expect a string.

The stdoutEncoding was originally specified as a by-name lookup of
"utf8"; this was actually equivalent to 'null', since that's not the
correct name. During the null safety migration, a fallback to
systemEncoding was added, causing it to always have an encoding. This
changed the type of result.stdout, so all calls gave a type error.

This fixes the issue by using 'utf8', the singleton encoder object,
rather than doing a name lookup, so the type will predicably be a
string, and adjusting the code reading it to expect a string.
Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@stuartmorgan stuartmorgan merged commit 5cbdac1 into flutter:master Feb 3, 2021
@stuartmorgan stuartmorgan deleted the stdout-encoding-fix branch February 3, 2021 18:13
stuartmorgan pushed a commit to stuartmorgan/packages that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants