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

Warn user about problematic locale settings #10996

Merged
merged 2 commits into from
Nov 22, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions fastlane/lib/fastlane/cli_tools_distributor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ def take_off
print_bundle_exec_warning(is_slow: (Time.now - before_import_time > 3))
end

unless ENV['LANG'].end_with?("UTF-8") || ENV['LC_ALL'].end_with?("UTF-8")
Copy link
Member

Choose a reason for hiding this comment

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

Does this compare need to be case insensitive? 🤔

Copy link
Collaborator Author

@milch milch Nov 22, 2017

Choose a reason for hiding this comment

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

I'm not sure but I think it is better to err on the side of caution here: theoretically your locale setting has to match one of the outputs of locale -a, which uses the uppercased UTF-8 spelling

warn = "WARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables"
UI.error(warn)
at_exit do
# Repeat warning here so users hopefully see it
UI.error(warn)
end
end

FastlaneCore::UpdateChecker.start_looking_for_update('fastlane')

ARGV.unshift("spaceship") if ARGV.first == "spaceauth"
Expand Down