-/* $Id: main.c,v 1.162 2011/05/17 14:38:34 kristaps Exp $ */
+/* $Id: main.c,v 1.163 2011/05/20 15:51:18 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
enum outt {
OUTT_ASCII = 0, /* -Tascii */
OUTT_LOCALE, /* -Tlocale */
+ OUTT_UTF8, /* -Tutf8 */
OUTT_TREE, /* -Ttree */
OUTT_HTML, /* -Thtml */
OUTT_XHTML, /* -Txhtml */
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;
/* FALLTHROUGH */
case (OUTT_ASCII):
/* FALLTHROUGH */
+ case (OUTT_UTF8):
+ /* FALLTHROUGH */
case (OUTT_LOCALE):
/* FALLTHROUGH */
case (OUTT_PS):
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"))
-.\" $Id: mandoc.1,v 1.87 2011/05/17 22:32:45 kristaps Exp $
+.\" $Id: mandoc.1,v 1.88 2011/05/20 15:51:18 kristaps Exp $
.\"
.\" Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: May 17 2011 $
+.Dd $Mdocdate: May 20 2011 $
.Dt MANDOC 1
.Os
.Sh NAME
.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
.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 .