Add LANG
and LC_ALL
environment variables.
#61
+3
−0
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.
Motivation / Background
This change is required to address encoding issues in the Ruby Dev Container (running with CLI), specifically when running e.g., RuboCop on files containing non-ASCII characters. Without explicitly setting
LANG
andLC_ALL
toC.UTF-8
, developers may encounter errors likeinvalid byte sequence in US-ASCII
. This change aligns the Rails development environment with UTF-8, enhancing compatibility with encoding-sensitive tools.Currently, there is no unified approach for setting locale variables across language-specific Dev Containers in the Microsoft Dev Containers repository. Each language image individually manages its encoding settings, leading to inconsistencies. This PR adds the locale settings directly to the Ruby container, following a similar approach used in other language-specific Dev Containers.
Detail
This PR adds
LANG
andLC_ALL
environment variables set toC.UTF-8
. This configuration provides a UTF-8-compatible locale by default, resolving encoding issues for Ruby and Rails applications.Example:
Before:
After:
Additional Information
This solution is implemented specifically in the Rails Dev Container to provide a consistent UTF-8 encoding environment. While other language images may handle locale independently, adding these settings here ensures compatibility with Rails development without affecting unrelated configurations. Similar adjustments have been seen in other Dev Container images, such as #417 and more https://github.com/search?q=repo%3Adevcontainers%2Fimages+LANG+LC_ALL+&type=code.
In contrast, see also microsoft/vscode-remote-release#2169.