From 2fa6c87580a49695f1f2b5c321f708f82827f6ac Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 23 Sep 2007 18:54:08 +0000 Subject: Set the locale from the environment, so that international characters may be entered when using editline. --- bin/bbackupquery/bbackupquery.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'bin/bbackupquery') 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 -- cgit v1.2.3