Skip to content

Commit

Permalink
Correct bug in b82c53a
Browse files Browse the repository at this point in the history
LANG env var was always over-riding earlier values. I think this
is what was intended, although lang_variables is fairly useless?
  • Loading branch information
NigelPearson committed Oct 11, 2011
1 parent 263c05a commit c0ae87c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions mythtv/libs/libmythbase/mythcorecontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,22 +205,21 @@ bool MythCoreContext::Init(void)
if (lc_value.isEmpty())
lc_value = getenv("LC_CTYPE");
}
if (!lc_value.contains("UTF-8", Qt::CaseInsensitive))
lang_variables.append("LC_ALL or LC_CTYPE");
lc_value = getenv("LANG");
if (!lc_value.contains("UTF-8", Qt::CaseInsensitive))
if (lc_value.isEmpty())
{
if (!lang_variables.isEmpty())
lang_variables.append(", and ");
lang_variables.append("LANG");
// Some environments, like OS X, only set LANG, so check that also:
lc_value = getenv("LANG");
}
if (!lang_variables.isEmpty())
if (!lc_value.contains("UTF-8", Qt::CaseInsensitive))
{
lang_variables.append("LC_ALL, LC_CTYPE or LANG");
LOG(VB_GENERAL, LOG_WARNING, QString("This application expects to "
"be running a locale that specifies a UTF-8 codeset, and many "
"features may behave improperly with your current language "
"settings. Please set the %1 variable(s) in the environment "
"in which this program is executed to include a UTF-8 codeset "
"(such as 'en_US.UTF-8').").arg(lang_variables));
}
#endif

// If any of the IPs on any interfaces look like IPv6 addresses, assume IPv6
Expand Down

0 comments on commit c0ae87c

Please sign in to comment.