More helpful messages when locale not found or wrong (closes #209)

This commit is contained in:
Keith Winstein
2012-04-19 02:35:14 -04:00
parent 58589787ea
commit b9a8b8c009
4 changed files with 65 additions and 4 deletions
+4 -1
View File
@@ -50,8 +50,11 @@
void STMClient::init( void )
{
if ( !is_utf8_locale() ) {
LocaleVar native_ctype = get_ctype();
string native_charset( locale_charset() );
fprintf( stderr, "mosh-client needs a UTF-8 native locale to run.\n\n" );
fprintf( stderr, "Unfortunately, the locale environment variables currently specify\nthe character set \"%s\".\n\n", locale_charset() );
fprintf( stderr, "Unfortunately, the client's environemnt (%s) specifies\nthe character set \"%s\".\n\n", native_ctype.str().c_str(), native_charset.c_str() );
int unused __attribute((unused)) = system( "locale" );
exit( 1 );
}