diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-09-23 18:54:08 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-09-23 18:54:08 +0000 |
commit | 2fa6c87580a49695f1f2b5c321f708f82827f6ac (patch) | |
tree | 344c4ea60b31e267dca4b7403bdb21da008644bd /bin/bbackupquery/bbackupquery.cpp | |
parent | f490d93daf0461f524c2d71d8b012ea090949861 (diff) |
Set the locale from the environment, so that international characters
may be entered when using editline.
Diffstat (limited to 'bin/bbackupquery/bbackupquery.cpp')
-rw-r--r-- | bin/bbackupquery/bbackupquery.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bin/bbackupquery/bbackupquery.cpp b/bin/bbackupquery/bbackupquery.cpp index 98726843..c9d6b715 100644 --- a/bin/bbackupquery/bbackupquery.cpp +++ b/bin/bbackupquery/bbackupquery.cpp @@ -303,7 +303,16 @@ int main(int argc, const char *argv[]) } // Get commands from input + #ifdef HAVE_LIBREADLINE + // Must initialise the locale before using editline's readline(), + // otherwise cannot enter international characters. + if (setlocale(LC_ALL, "") == NULL) + { + BOX_ERROR("Failed to initialise locale. International " + "character support may not work."); + } + #ifdef HAVE_READLINE_HISTORY using_history(); #endif |