Fix locale hack 2: Now detects correct C.utf format #101
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.
Check for valid C locale by running process. Exact command is
sh -c "locale -a 2>/dev/null | grep -i utf"
, which should execute on any Unix system without throwing an error in dotnet. It then selects the first valid entry that starts with "C." (not case sensitive). This will deal with cases of C.utf8, C.UTF-8, c.utf-8, etc.If there is no value for the Ctype, the hack will be disabled, and hack text will change to let the user know that they'll have to set it manually.
If the users's LANG is already set to a UTF-8 type and they enable the hack, it will warn that the hack probably isn't needed, but the hack will still function.