#495 closed task (fixed)
Warn when locale is bogus
Reported by: | Philip Taylor | Owned by: | Sergio Fabian Vier |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 4 |
Component: | Core engine | Keywords: | simple |
Cc: | Patch: |
Description
What currently happens:
$ LANG=bogus ./pyrogenesis_dbg terminate called after throwing an instance of 'std::runtime_error' what(): locale::facet::_S_create_c_locale name not valid Aborted
This can happen on misconfigured systems where the locales aren't set up correctly. It would be better to give a much more informative warning and fall back to a default - e.g. perl says:
$ LANG=bogus perl perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "", LC_ALL = (unset), LANG = "bogus" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C").
which is more helpful.
We need to do this fairly early (before any attempts to access the filesystem), so maybe in EarlyInit
in GameSetup.cpp
.
Attachments (1)
Change History (8)
comment:1 by , 14 years ago
Milestone: | Unclassified |
---|
comment:2 by , 14 years ago
Milestone: | → Backlog |
---|
by , 13 years ago
Attachment: | patch.diff added |
---|
comment:3 by , 13 years ago
Keywords: | review added |
---|
Based on commnets on the code in http://www.wildfiregames.com/forum/index.php?showtopic=13145&hl= i've created this patch.
comment:4 by , 13 years ago
Owner: | set to |
---|
comment:5 by , 13 years ago
Milestone: | Backlog → Alpha 4 |
---|
Thanks! Changed it to only apply to OS_UNIX
(I assume it wouldn't work on Windows and shouldn't be necessary there anyway), and to use debug_warn
for serious warnings (so users can't miss them), and cleaned up the formatting a bit.
comment:6 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:7 by , 8 years ago
Keywords: | review removed |
---|
Milestone Unclassified deleted