aboutsummaryrefslogtreecommitdiff
path: root/lib/enca/devel-docs/html/libenca-Charsets-and-Surfaces.html
blob: 56738147e059780647c68e54cebbc5ef2cdd6969 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Charsets and Surfaces</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="Enca Library Reference Manual">
<link rel="up" href="ch01.html" title="Enca Library API">
<link rel="prev" href="libenca-Typedefs-and-Constants.html" title="Typedefs and Constants">
<link rel="next" href="libenca-Auxiliary-Functions.html" title="Auxiliary functions">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="Enca Library API">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="libenca-Typedefs-and-Constants.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Enca Library Reference Manual</th>
<td><a accesskey="n" href="libenca-Auxiliary-Functions.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libenca-Charsets-and-Surfaces.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#libenca-Charsets-and-Surfaces.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Charsets and Surfaces">
<a name="libenca-Charsets-and-Surfaces"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libenca-Charsets-and-Surfaces.top_of_page"></a>Charsets and Surfaces</span></h2>
<p>Charsets and Surfaces — Functions and macros for getting something sensible from <a class="link" href="libenca-Typedefs-and-Constants.html#EncaEncoding" title="EncaEncoding"><span class="type">EncaEncoding</span></a>.</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="libenca-Charsets-and-Surfaces.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
const char*         <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-name" title="enca_charset_name ()">enca_charset_name</a>                   (int charset,
                                                         <a class="link" href="libenca-Typedefs-and-Constants.html#EncaNameStyle" title="enum EncaNameStyle">EncaNameStyle</a> whatname);
const char**        <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-get-charset-aliases" title="enca_get_charset_aliases ()">enca_get_charset_aliases</a>            (int charset,
                                                         size_t *n);
char*               <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-get-surface-name" title="enca_get_surface_name ()">enca_get_surface_name</a>               (<a class="link" href="libenca-Typedefs-and-Constants.html#EncaSurface" title="enum EncaSurface">EncaSurface</a> surface,
                                                         <a class="link" href="libenca-Typedefs-and-Constants.html#EncaNameStyle" title="enum EncaNameStyle">EncaNameStyle</a> whatname);
<a class="link" href="libenca-Typedefs-and-Constants.html#EncaEncoding" title="EncaEncoding">EncaEncoding</a>        <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-parse-encoding-name" title="enca_parse_encoding_name ()">enca_parse_encoding_name</a>            (const char *name);
<a class="link" href="libenca-Typedefs-and-Constants.html#EncaSurface" title="enum EncaSurface">EncaSurface</a>         <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-natural-surface" title="enca_charset_natural_surface ()">enca_charset_natural_surface</a>        (int charset);
<a class="link" href="libenca-Typedefs-and-Constants.html#EncaCharsetFlags" title="enum EncaCharsetFlags">EncaCharsetFlags</a>    <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-properties" title="enca_charset_properties ()">enca_charset_properties</a>             (int charset);
#define             <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-is-7bit" title="enca_charset_is_7bit()">enca_charset_is_7bit</a>                (cs)
#define             <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-is-8bit" title="enca_charset_is_8bit()">enca_charset_is_8bit</a>                (cs)
#define             <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-is-16bit" title="enca_charset_is_16bit()">enca_charset_is_16bit</a>               (cs)
#define             <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-is-32bit" title="enca_charset_is_32bit()">enca_charset_is_32bit</a>               (cs)
#define             <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-is-fixed" title="enca_charset_is_fixed()">enca_charset_is_fixed</a>               (cs)
#define             <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-is-variable" title="enca_charset_is_variable()">enca_charset_is_variable</a>            (cs)
#define             <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-is-binary" title="enca_charset_is_binary()">enca_charset_is_binary</a>              (cs)
#define             <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-is-regular" title="enca_charset_is_regular()">enca_charset_is_regular</a>             (cs)
#define             <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-is-multibyte" title="enca_charset_is_multibyte()">enca_charset_is_multibyte</a>           (cs)
#define             <a class="link" href="libenca-Charsets-and-Surfaces.html#enca-charset-is-known" title="enca_charset_is_known()">enca_charset_is_known</a>               (cs)
</pre>
</div>
<div class="refsect1" title="Description">
<a name="libenca-Charsets-and-Surfaces.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="libenca-Charsets-and-Surfaces.details"></a><h2>Details</h2>
<div class="refsect2" title="enca_charset_name ()">
<a name="enca-charset-name"></a><h3>enca_charset_name ()</h3>
<pre class="programlisting">const char*         enca_charset_name                   (int charset,
                                                         <a class="link" href="libenca-Typedefs-and-Constants.html#EncaNameStyle" title="enum EncaNameStyle">EncaNameStyle</a> whatname);</pre>
<p>
Translates numeric charset id <em class="parameter"><code>charset</code></em> to some kind of name.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>charset</code></em> :</span></p></td>
<td> A charset id.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>whatname</code></em> :</span></p></td>
<td> Teh type of name you request.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The requested charset name; <span class="type">NULL</span> for invalid <em class="parameter"><code>whatname</code></em> or
<em class="parameter"><code>charset</code></em>, or when <em class="parameter"><code>whatname</code></em> name doesn't exist for charset <em class="parameter"><code>charset</code></em>
(<a class="link" href="libenca-Typedefs-and-Constants.html#ENCA-CS-UNKNOWN--CAPS" title="ENCA_CS_UNKNOWN"><span class="type">ENCA_CS_UNKNOWN</span></a> is OK).
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_get_charset_aliases ()">
<a name="enca-get-charset-aliases"></a><h3>enca_get_charset_aliases ()</h3>
<pre class="programlisting">const char**        enca_get_charset_aliases            (int charset,
                                                         size_t *n);</pre>
<p>
Returns list of accepted aliases for charset <em class="parameter"><code>charset</code></em>.
</p>
<p>
The list of aliases has to be freed by caller; the strings themselves
must be considered constant and must NOT be freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>charset</code></em> :</span></p></td>
<td> A charset id.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
<td> The number of aliases will be stored here.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The list of aliases, storing their number into *<em class="parameter"><code>n</code></em>; <span class="type">NULL</span> for
invalid <em class="parameter"><code>charset</code></em> (*<em class="parameter"><code>n</code></em> is zero then).
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_get_surface_name ()">
<a name="enca-get-surface-name"></a><h3>enca_get_surface_name ()</h3>
<pre class="programlisting">char*               enca_get_surface_name               (<a class="link" href="libenca-Typedefs-and-Constants.html#EncaSurface" title="enum EncaSurface">EncaSurface</a> surface,
                                                         <a class="link" href="libenca-Typedefs-and-Constants.html#EncaNameStyle" title="enum EncaNameStyle">EncaNameStyle</a> whatname);</pre>
<p>
Constructs surface name from surface flags <em class="parameter"><code>surface</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>surface</code></em> :</span></p></td>
<td> A surface.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>whatname</code></em> :</span></p></td>
<td> The type of name you request.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The requested surface name; <span class="type">NULL</span> for invalid <em class="parameter"><code>whatname</code></em>; empty
string for naming style not supporting surfaces.  In all cases, the
returned string must be freed by caller when no longer used.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_parse_encoding_name ()">
<a name="enca-parse-encoding-name"></a><h3>enca_parse_encoding_name ()</h3>
<pre class="programlisting"><a class="link" href="libenca-Typedefs-and-Constants.html#EncaEncoding" title="EncaEncoding">EncaEncoding</a>        enca_parse_encoding_name            (const char *name);</pre>
<p>
Transofrms encoding specification charset/surface into numeric <a class="link" href="libenca-Typedefs-and-Constants.html#EncaEncoding" title="EncaEncoding"><span class="type">EncaEncoding</span></a>.
</p>
<p>
When the charset name is not recognized, surfaces are not parsed at all and
<a class="link" href="libenca-Typedefs-and-Constants.html#ENCA-CS-UNKNOWN--CAPS" title="ENCA_CS_UNKNOWN"><span class="type">ENCA_CS_UNKNOWN</span></a> is returned as charset.  However, unrecognized surfaces are
considered only a minor problem causing <a class="link" href="libenca-Typedefs-and-Constants.html#ENCA-SURFACE-UNKNOWN--CAPS"><code class="literal">ENCA_SURFACE_UNKNOWN</code></a> flag to be
set in the result, beside recognized surface flags.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
<td> An encoding specification.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The charset/surface pair.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_natural_surface ()">
<a name="enca-charset-natural-surface"></a><h3>enca_charset_natural_surface ()</h3>
<pre class="programlisting"><a class="link" href="libenca-Typedefs-and-Constants.html#EncaSurface" title="enum EncaSurface">EncaSurface</a>         enca_charset_natural_surface        (int charset);</pre>
<p>
Returns natural surface of a charset.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>charset</code></em> :</span></p></td>
<td> A charset.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The requested charset natural surface (called `implied' in recode),
         zero for invalid <em class="parameter"><code>charset</code></em> or for charsets with no natural surface.

         Natrual surface is the surface one expects for a given charset --
         e.g. CRLF EOLs for IBM/Microsoft charsets, CR EOLs for Macintosh
         charsets and LF EOLs for ISO/Unix charsets.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_properties ()">
<a name="enca-charset-properties"></a><h3>enca_charset_properties ()</h3>
<pre class="programlisting"><a class="link" href="libenca-Typedefs-and-Constants.html#EncaCharsetFlags" title="enum EncaCharsetFlags">EncaCharsetFlags</a>    enca_charset_properties             (int charset);</pre>
<p>
Returns charset properties.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>charset</code></em> :</span></p></td>
<td> A charset.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The requested charset properties; zero for invalid <em class="parameter"><code>charset</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_is_7bit()">
<a name="enca-charset-is-7bit"></a><h3>enca_charset_is_7bit()</h3>
<pre class="programlisting">#define             enca_charset_is_7bit(cs)</pre>
<p>
Expands to nonzero when characters are represented with 7bit characters.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cs</code></em> :</span></p></td>
<td> Charset id.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_is_8bit()">
<a name="enca-charset-is-8bit"></a><h3>enca_charset_is_8bit()</h3>
<pre class="programlisting">#define             enca_charset_is_8bit(cs)</pre>
<p>
Expands to nonzero when characters are represented with bytes.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cs</code></em> :</span></p></td>
<td> Charset id.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_is_16bit()">
<a name="enca-charset-is-16bit"></a><h3>enca_charset_is_16bit()</h3>
<pre class="programlisting">#define             enca_charset_is_16bit(cs)</pre>
<p>
Expands to nonzero when characters are represented with 2byte words.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cs</code></em> :</span></p></td>
<td> Charset id.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_is_32bit()">
<a name="enca-charset-is-32bit"></a><h3>enca_charset_is_32bit()</h3>
<pre class="programlisting">#define             enca_charset_is_32bit(cs)</pre>
<p>
Expands to nonzero when characters are represented with 4byte words.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cs</code></em> :</span></p></td>
<td> Charset id.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_is_fixed()">
<a name="enca-charset-is-fixed"></a><h3>enca_charset_is_fixed()</h3>
<pre class="programlisting">#define             enca_charset_is_fixed(cs)</pre>
<p>
Expands to nonzero when one characters consists of one fundamental piece.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cs</code></em> :</span></p></td>
<td> Charset id.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_is_variable()">
<a name="enca-charset-is-variable"></a><h3>enca_charset_is_variable()</h3>
<pre class="programlisting">#define             enca_charset_is_variable(cs)</pre>
<p>
Expands to nonzero when one character consists of variable number of
fundamental pieces.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cs</code></em> :</span></p></td>
<td> Charset id.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_is_binary()">
<a name="enca-charset-is-binary"></a><h3>enca_charset_is_binary()</h3>
<pre class="programlisting">#define             enca_charset_is_binary(cs)</pre>
<p>
Expands to nonzero when charset is binary from ASCII viewpoint.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cs</code></em> :</span></p></td>
<td> Charset id.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_is_regular()">
<a name="enca-charset-is-regular"></a><h3>enca_charset_is_regular()</h3>
<pre class="programlisting">#define             enca_charset_is_regular(cs)</pre>
<p>
Expands to nonzero when charset is language dependent (8bit) charset.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cs</code></em> :</span></p></td>
<td> Charset id.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_is_multibyte()">
<a name="enca-charset-is-multibyte"></a><h3>enca_charset_is_multibyte()</h3>
<pre class="programlisting">#define             enca_charset_is_multibyte(cs)</pre>
<p>
Expands to nonzero when charset is multibyte.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cs</code></em> :</span></p></td>
<td> Charset id.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enca_charset_is_known()">
<a name="enca-charset-is-known"></a><h3>enca_charset_is_known()</h3>
<pre class="programlisting">#define             enca_charset_is_known(cs)</pre>
<p>
Expands to nonzero when the charset is known (i.e. it's not
ENCA_CS_UNKNOWN).</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cs</code></em> :</span></p></td>
<td> Charset id.
</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>