summaryrefslogtreecommitdiff
path: root/bin/bbackupquery/bbackupquery.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-09-23 18:54:08 +0000
committerChris Wilson <chris+github@qwirx.com>2007-09-23 18:54:08 +0000
commit2fa6c87580a49695f1f2b5c321f708f82827f6ac (patch)
tree344c4ea60b31e267dca4b7403bdb21da008644bd /bin/bbackupquery/bbackupquery.cpp
parentf490d93daf0461f524c2d71d8b012ea090949861 (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.cpp9
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