Ticket #495 (closed task: fixed)
Warn when locale is bogus
| Reported by: | Philip | Owned by: | sergiovier |
|---|---|---|---|
| Priority: | Nice to Have | Milestone: | Alpha 4 |
| Component: | Core engine | Keywords: | simple, review |
| Cc: |
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
Change History
comment:3 Changed 2 years ago by sergiovier
- Keywords simple, review added; simple removed
Based on commnets on the code in http://www.wildfiregames.com/forum/index.php?showtopic=13145&hl= i've created this patch.
comment:5 Changed 2 years ago by Philip
- Milestone changed from Backlog to 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.

Milestone Unclassified deleted