summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--regress/usr.bin/mandoc/char/unicode/man.in6
-rw-r--r--regress/usr.bin/mandoc/char/unicode/man.out_utf86
-rw-r--r--regress/usr.bin/mandoc/char/unicode/mdoc.in6
-rw-r--r--regress/usr.bin/mandoc/char/unicode/mdoc.out_utf86
-rw-r--r--share/man/man7/mandoc_char.78
-rw-r--r--usr.bin/mandoc/mandoc.c7
6 files changed, 21 insertions, 18 deletions
diff --git a/regress/usr.bin/mandoc/char/unicode/man.in b/regress/usr.bin/mandoc/char/unicode/man.in
index bc2bffc0ea9..392b4e57fd4 100644
--- a/regress/usr.bin/mandoc/char/unicode/man.in
+++ b/regress/usr.bin/mandoc/char/unicode/man.in
@@ -2,8 +2,8 @@
.SH NAME
char-unicode-mdoc \- unicode characters in man code
.SH DESCRIPTION
-Copyright symbol: \[u00A9]
+Copyright symbol: \[u00A9] = \C'u00A9'
.PP
-m-dash: \[u2014]
+m-dash: \[u2014] = \C'u2014'
.PP
-nabla: \[u1D6C1]
+nabla: \[u1D6C1] = \C'u1D6C1'
diff --git a/regress/usr.bin/mandoc/char/unicode/man.out_utf8 b/regress/usr.bin/mandoc/char/unicode/man.out_utf8
index 746734786b5..3e445a8f8bb 100644
--- a/regress/usr.bin/mandoc/char/unicode/man.out_utf8
+++ b/regress/usr.bin/mandoc/char/unicode/man.out_utf8
@@ -6,11 +6,11 @@ NNAAMMEE
char-unicode-mdoc - unicode characters in man code
DDEESSCCRRIIPPTTIIOONN
- Copyright symbol: ©
+ Copyright symbol: © = ©
- m-dash: —
+ m-dash: — = —
- nabla: 𝛁
+ nabla: 𝛁 = 𝛁
diff --git a/regress/usr.bin/mandoc/char/unicode/mdoc.in b/regress/usr.bin/mandoc/char/unicode/mdoc.in
index aef138080f1..47a5911e645 100644
--- a/regress/usr.bin/mandoc/char/unicode/mdoc.in
+++ b/regress/usr.bin/mandoc/char/unicode/mdoc.in
@@ -5,8 +5,8 @@
.Nm char-unicode-mdoc
.Nd unicode characters in mdoc code
.Sh DESCRIPTION
-Copyright symbol: \[u00A9]
+Copyright symbol: \[u00A9] = \C'u00A9'
.Pp
-m-dash: \[u2014]
+m-dash: \[u2014] = \C'u2014'
.Pp
-nabla: \[u1D6C1]
+nabla: \[u1D6C1] = \C'u1D6C1'
diff --git a/regress/usr.bin/mandoc/char/unicode/mdoc.out_utf8 b/regress/usr.bin/mandoc/char/unicode/mdoc.out_utf8
index 2f46654efd8..04b5bca9456 100644
--- a/regress/usr.bin/mandoc/char/unicode/mdoc.out_utf8
+++ b/regress/usr.bin/mandoc/char/unicode/mdoc.out_utf8
@@ -4,10 +4,10 @@ NNAAMMEE
cchhaarr--uunniiccooddee--mmddoocc – unicode characters in mdoc code
DDEESSCCRRIIPPTTIIOONN
- Copyright symbol: ©
+ Copyright symbol: © = ©
- m-dash: —
+ m-dash: — = —
- nabla: 𝛁
+ nabla: 𝛁 = 𝛁
OpenBSD November 10, 2013 OpenBSD
diff --git a/share/man/man7/mandoc_char.7 b/share/man/man7/mandoc_char.7
index f630d01edeb..0cbb81dca75 100644
--- a/share/man/man7/mandoc_char.7
+++ b/share/man/man7/mandoc_char.7
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mandoc_char.7,v 1.18 2013/11/10 17:47:42 jmc Exp $
+.\" $OpenBSD: mandoc_char.7,v 1.19 2013/11/10 20:17:14 schwarze Exp $
.\"
.\" Copyright (c) 2003 Jason McIntyre <jmc@openbsd.org>
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -655,11 +655,11 @@ manual.
.It \e*(Ai Ta \*(Ai Ta ANSI standard name
.El
.Sh UNICODE CHARACTERS
-The escape sequence
+The escape sequences
.Pp
-.Dl \e[uXXXX]
+.Dl \e[uXXXX] and \eC'uXXXX'
.Pp
-is interpreted as a Unicode codepoint.
+are interpreted as Unicode codepoints.
The codepoint must be in the range above U+0080 and less than U+10FFFF.
For compatibility, the hexadecimal digits
.Sq A
diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c
index f24da3895e8..b96077b4e70 100644
--- a/usr.bin/mandoc/mandoc.c
+++ b/usr.bin/mandoc/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.38 2013/10/05 21:17:29 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.39 2013/11/10 20:17:14 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -89,8 +89,11 @@ mandoc_escape(const char const **end, const char const **start, int *sz)
case ('C'):
if ('\'' != **start)
return(ESCAPE_ERROR);
- gly = ESCAPE_SPECIAL;
*start = ++*end;
+ if ('u' == (*start)[0] && '\'' != (*start)[1])
+ gly = ESCAPE_UNICODE;
+ else
+ gly = ESCAPE_SPECIAL;
term = '\'';
break;