summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-05-20 15:51:18 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-05-20 15:51:18 +0000
commit3b374038fe6f5434e8053ed1b32c0d2cd773cf5c (patch)
treebf19c06b9f4b808fa91244c6710035e99bf8f000
parent16620bc92834d5f0c26df4ec247eff77a6a39909 (diff)
downloadmandoc-3b374038fe6f5434e8053ed1b32c0d2cd773cf5c.tar.gz
Turn on -Tutf8 in the frontend. Here we go!
-rw-r--r--main.c9
-rw-r--r--mandoc.116
2 files changed, 22 insertions, 3 deletions
diff --git a/main.c b/main.c
index 99a44f58..cfd3de1c 100644
--- a/main.c
+++ b/main.c
@@ -44,6 +44,7 @@ typedef void (*out_free)(void *);
enum outt {
OUTT_ASCII = 0, /* -Tascii */
OUTT_LOCALE, /* -Tlocale */
+ OUTT_UTF8, /* -Tutf8 */
OUTT_TREE, /* -Ttree */
OUTT_HTML, /* -Thtml */
OUTT_XHTML, /* -Txhtml */
@@ -213,6 +214,10 @@ parse(struct curparse *curp, int fd,
curp->outdata = html_alloc(curp->outopts);
curp->outfree = html_free;
break;
+ case (OUTT_UTF8):
+ curp->outdata = utf8_alloc(curp->outopts);
+ curp->outfree = ascii_free;
+ break;
case (OUTT_LOCALE):
curp->outdata = locale_alloc(curp->outopts);
curp->outfree = ascii_free;
@@ -248,6 +253,8 @@ parse(struct curparse *curp, int fd,
/* FALLTHROUGH */
case (OUTT_ASCII):
/* FALLTHROUGH */
+ case (OUTT_UTF8):
+ /* FALLTHROUGH */
case (OUTT_LOCALE):
/* FALLTHROUGH */
case (OUTT_PS):
@@ -307,6 +314,8 @@ toptions(struct curparse *curp, char *arg)
curp->outtype = OUTT_TREE;
else if (0 == strcmp(arg, "html"))
curp->outtype = OUTT_HTML;
+ else if (0 == strcmp(arg, "utf8"))
+ curp->outtype = OUTT_UTF8;
else if (0 == strcmp(arg, "locale"))
curp->outtype = OUTT_LOCALE;
else if (0 == strcmp(arg, "xhtml"))
diff --git a/mandoc.1 b/mandoc.1
index c7c6fcc8..a614a75a 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -158,10 +158,13 @@ utility accepts the following
.Fl T
arguments, which correspond to output modes:
.Bl -tag -width Ds
+.It Fl T Ns Cm utf8
+Encode output in the UTF-8 multi-byte format.
+See
+.Xr UTF-8 Output .
.It Fl T Ns Cm locale
-This option encodes output characters using the current
-.Xr locale 1
-configuration.
+Encode output using the current
+.Xr locale 1 .
See
.Sx Locale Output .
.It Fl T Ns Cm ascii
@@ -195,6 +198,13 @@ See
.Pp
If multiple input files are specified, these will be processed by the
corresponding filter in-order.
+.Ss UTF-8 Output
+Use
+.Fl T Ns Cm utf8
+to force a UTF-8 locale.
+See
+.Sx Locale Output
+for details and options.
.Ss Locale Output
Locale-depending output encoding is triggered with
.Fl T Ns Cm locale .