the page length. Default: @code{0}.
@item @option{-O box=@{ascii|unicode@}}
-Sets the characters used for lines in tables. The default,
-@code{ascii}, uses @samp{-}, @samp{|}, and @samp{+} for single-width
-lines and @samp{=} and @samp{#} for double-width lines. Specify
-@code{unicode} to use Unicode box drawing characters.
+Sets the characters used for lines in tables.
+If set to
+@code{ascii} the characters @samp{-}, @samp{|}, and @samp{+} for single-width
+lines and @samp{=} and @samp{#} for double-width lines are used.
+If set to @code{unicode} then Unicode box drawing characters will be used.
+The default is @code{unicode} if the locale's character encoding is "UTF-8"
+or @code{ascii} otherwise.
@item @option{-O emphasis=@{none|bold|underline@}}
How to emphasize text. Bold and underline emphasis are achieved with
#include <stdbool.h>
#include <stdlib.h>
+#include <string.h>
+
#include "data/settings.h"
#include "data/file-name.h"
#include "output/msglog.h"
#include "gl/error.h"
+#include "gl/localcharset.h"
#include "gl/progname.h"
#include "gl/version-etc.h"
#include "gl/xmemdup0.h"
void
terminal_opts_done (struct terminal_opts *to, int argc, char *argv[])
{
+ if (0 == strcmp (locale_charset (), "UTF-8"))
+ string_map_insert (&to->options, "box", "unicode");
register_output_driver (to);
if (!to->has_output_driver)
{