Welcome to mirror list, hosted at ThFree Co, Russian Federation.

iconv.tex « iconv « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5542f9b7f9517cd9d479dd908f40699643812151 (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
@node Iconv
@chapter Character-set conversions (@file{iconv.h})

This chapter describes the Newlib iconv library.
The iconv functions declarations are in
@file{iconv.h}.

@menu
* iconv::                 Character set conversion routines
* iconv configuration::   Newlib iconv-specific configure options
@end menu

@page
@include iconv/iconv.def

@page
@node iconv configuration
@section iconv configuration
@findex iconv configuration
@findex encoding
@*
To enable iconv, the --enable-newlib-iconv configuration option should be
used when configuring Newlib. 

@*
Iconv library is intended to perform conversions from one encoding to
another encoding. Thus, the only user-visible abstraction is encoding.
To enable particular encoding support user should enable it using
Newlib's configure script options. Encoding's support is divided into
two parts: "to" and "from". For example, if it is only wanted to have
UTF-8 -> UCS-4 coding capabilities, "from" UTF-8 and "to" UCS-4 support
should be enabled. In this case backward (UCS-4 -> UTF-8) conversion 
won't be possible (iconv_open will return error). Such division on "to"
and "from" parts helps to save memory.

@*
To enable encoding support --enable-newlib-iconv-encodings configure
script option should be used. This option accepts a comma-separated list
of encodins that should be enabled. Option enables each encoding in both
("to" and "from") directions.

@*
--enable-newlib-iconv-from-encodings configure script option enables
"from" support for each encoding that was passed to it.

@*
--enable-newlib-iconv-to-encodings configure script option enables
"to" support for each encoding that was passed to it.

@*
Example: if user plans only KOI8-R -> UTF-8, UTF-8 -> ISO-8859-5 and
KOI8-R -> UCS-2 conversions, the most optimal way (minimal iconv's
code and data will be linked) is to configure Newlib with 
--enable-newlib-iconv-encodings=UTF-8
--enable-newlib-iconv-from-encodings=KOI8-R
--enable-newlib-iconv-to-encodings=KOI8-R,ISO-8859-5

@*
There is one more configue script option for iconv library:
--enable-newlib-iconv-external-ccs. This options enables iconv's
capabilities to work with external CCS files. Exteral CCS files are just
conversion tables used by iconv. Without this option all conversion
tables are linked-in and occupy a lot of ROM. If target system has
some fyle-system, it can benefit using external CCS files which are
loaded on iconv_open and unloaded on iconv_close. But this way require
more RAM. Moreover, in current implementation, distinct copy of CCS file
is loaded for each fore each opended iconv decriptor for the same
encoding. This means that if, for example, two iconv descriptors for
KOI8-R -> UCS-4BE and KOI8-R -> UTF-16BE are opened, two copies of
koi8-r.cct file will be loaded. 

@*
Note: not evry encoding needs CCS tiles. For example, UTF-8, UTF-16,
UCS-2, UCS-4 doesn't use such files at all.

@*
Note: CCS file contains a number of tables, and only several needed tables
are loaded from this file. This means, that there is a possibility to save
some "fyle-system space" not including unneeded tables to that CCS
files. Such task may be performed using "mktbl.pl" Perl script
destributed with iconv library.

@*
Note: CCS files are searched by iconv_open in $NLSPATH/iconv_data/ directory.