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

Locale issues #199

Open
jmarrec opened this issue Dec 10, 2024 · 0 comments
Open

Locale issues #199

jmarrec opened this issue Dec 10, 2024 · 0 comments

Comments

@jmarrec
Copy link
Contributor

jmarrec commented Dec 10, 2024

Locale is not properly set in the docker container

/__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/json-2.9.0/lib/json/common.rb:221:in `encode': "\xC3" on US-ASCII (Encoding::InvalidByteSequenceError)
	from /__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/json-2.9.0/lib/json/common.rb:221:in `parse'
	from /__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/json-2.9.0/lib/json/common.rb:221:in `parse'
	from /__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb:93:in `block in load_standards_database_new'
	from /__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb:92:in `each'
	from /__w/workspace/workspace/workspaceOS/.bundle/ruby/3.2.0/gems/openstudio-standards-0.6.1/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb:92:in `load_standards_database_new'

The locale isn't actually set, so it's POSIX

root@d2baf72eee0d:/var/simdata/openstudio# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

I have to run

locale-gen en_US en_US.UTF-8
# Either this
update-locale LANG=en_us.UTF-8
# or this
export LANG=en_us.UTF-8

Then it works.


It's possible my setup for the actual test I'm running is different than plain usage, because this still does work

$ docker run -it --rm nrel/openstudio:3.8.0

root@d2baf72eee0d:/var/simdata/openstudio# gem install openstudio-standards
root@d2baf72eee0d:/var/simdata/openstudio# ruby -e "require 'openstudio-standards'"

But the locale should probably be set to en_US.UTF-8 since that was the intent given

# install locales and set to en_US.UTF-8. This is needed for running the CLI on some machines
# such as singularity.

and

&& locale-gen en_US en_US.UTF-8 \
&& dpkg-reconfigure locales

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

No branches or pull requests

1 participant