source: public/doc/gnu-c/Unicode-Character-Codes.html@ 02598c2

Last change on this file since 02598c2 was 02598c2, checked in by Mikhail Kirillov <w96k@…>, on Oct 6, 2022 at 12:36:29 PM

Add gnu-c

  • Property mode set to 100644
File size: 5.1 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- Copyright (C) 2022 Richard Stallman and Free Software Foundation, Inc.
4
5(The work of Trevis Rothwell and Nelson Beebe has been assigned or
6licensed to the FSF.)
7
8Permission is granted to copy, distribute and/or modify this document
9under the terms of the GNU Free Documentation License, Version 1.3 or
10any later version published by the Free Software Foundation; with the
11Invariant Sections being "GNU General Public License," with the
12Front-Cover Texts being "A GNU Manual," and with the Back-Cover
13Texts as in (a) below. A copy of the license is included in the
14section entitled "GNU Free Documentation License."
15
16(a) The FSF's Back-Cover Text is: "You have the freedom to copy and
17modify this GNU manual. Buying copies from the FSF supports it in
18developing GNU and promoting software freedom." -->
19<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
20<head>
21<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
22<title>Unicode Character Codes (GNU C Language Manual)</title>
23
24<meta name="description" content="Unicode Character Codes (GNU C Language Manual)">
25<meta name="keywords" content="Unicode Character Codes (GNU C Language Manual)">
26<meta name="resource-type" content="document">
27<meta name="distribution" content="global">
28<meta name="Generator" content="makeinfo">
29<link href="index.html" rel="start" title="Top">
30<link href="Symbol-Index.html" rel="index" title="Symbol Index">
31<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
32<link href="Constants.html" rel="up" title="Constants">
33<link href="Wide-Character-Constants.html" rel="next" title="Wide Character Constants">
34<link href="UTF_002d8-String-Constants.html" rel="prev" title="UTF-8 String Constants">
35<style type="text/css">
36<!--
37a.summary-letter {text-decoration: none}
38blockquote.indentedblock {margin-right: 0em}
39div.display {margin-left: 3.2em}
40div.example {margin-left: 3.2em}
41div.lisp {margin-left: 3.2em}
42kbd {font-style: oblique}
43pre.display {font-family: inherit}
44pre.format {font-family: inherit}
45pre.menu-comment {font-family: serif}
46pre.menu-preformatted {font-family: serif}
47span.nolinebreak {white-space: nowrap}
48span.roman {font-family: initial; font-weight: normal}
49span.sansserif {font-family: sans-serif; font-weight: normal}
50ul.no-bullet {list-style: none}
51-->
52</style>
53
54
55</head>
56
57<body lang="en">
58<span id="Unicode-Character-Codes"></span><div class="header">
59<p>
60Next: <a href="Wide-Character-Constants.html" accesskey="n" rel="next">Wide Character Constants</a>, Previous: <a href="UTF_002d8-String-Constants.html" accesskey="p" rel="prev">UTF-8 String Constants</a>, Up: <a href="Constants.html" accesskey="u" rel="up">Constants</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Index.html" title="Index" rel="index">Index</a>]</p>
61</div>
62<hr>
63<span id="Unicode-Character-Codes-1"></span><h3 class="section">12.9 Unicode Character Codes</h3>
64<span id="index-Unicode-character-codes"></span>
65<span id="index-universal-character-names"></span>
66
67<p>You can specify Unicode characters, for individual character constants
68or as part of string constants (see <a href="String-Constants.html">String Constants</a>), using
69escape sequences. Use the &lsquo;<samp>\u</samp>&rsquo; escape sequence with a 16-bit
70hexadecimal Unicode character code. If the code value is too big for
7116 bits, use the &lsquo;<samp>\U</samp>&rsquo; escape sequence with a 32-bit hexadecimal
72Unicode character code. (These codes are called <em>universal
73character names</em>.) For example,
74</p>
75<div class="example">
76<pre class="example">\u6C34 /* <span class="roman">16-bit code (UTF-16)</span> */
77\U0010ABCD /* <span class="roman">32-bit code (UTF-32)</span> */
78</pre></div>
79
80<p>One way to use these is in UTF-8 string constants (see <a href="UTF_002d8-String-Constants.html">UTF-8 String Constants</a>). For instance,
81</p>
82<div class="example">
83<pre class="example">u8&quot;fóó \u6C34 \U0010ABCD&quot;
84</pre></div>
85
86<p>You can also use them in wide character constants (see <a href="Wide-Character-Constants.html">Wide Character Constants</a>), like this:
87</p>
88<div class="example">
89<pre class="example">u'\u6C34' /* <span class="roman">16-bit code</span> */
90U'\U0010ABCD' /* <span class="roman">32-bit code</span> */
91</pre></div>
92
93<p>and in wide string constants (see <a href="Wide-String-Constants.html">Wide String Constants</a>), like
94this:
95</p>
96<div class="example">
97<pre class="example">u&quot;\u6C34\u6C33&quot; /* <span class="roman">16-bit code</span> */
98U&quot;\U0010ABCD&quot; /* <span class="roman">32-bit code</span> */
99</pre></div>
100
101<p>Codes in the range of <code>D800</code> through <code>DFFF</code> are not valid
102in Unicode. Codes less than <code>00A0</code> are also forbidden, except for
103<code>0024</code>, <code>0040</code>, and <code>0060</code>; these characters are
104actually ASCII control characters, and you can specify them with other
105escape sequences (see <a href="Character-Constants.html">Character Constants</a>).
106</p>
107
108
109
110</body>
111</html>
Note: See TracBrowser for help on using the repository browser.