1auto_ef(1) User Commands auto_ef(1)
2
3
4
6 auto_ef - auto encoding finder
7
9 /usr/bin/auto_ef [-e encoding_list] [-a] [-l level]
10 [file ...]
11
12
13 /usr/bin/auto_ef -h
14
15
17 The auto_ef utility identifies the encoding of a given file. The util‐
18 ity judges the encoding by using the iconv code conversion, determining
19 whether a certain code conversion was successful with the file, and
20 also by performing frequency analyses on the character sequences that
21 appear in the file.
22
23
24 The auto_ef utility might produce unexpected output if the string is
25 binary, a character table, a localized digit list, or a chronogram, or
26 if the string or file is very small in size (for example, less than one
27 100 bytes).
28
29 ASCII JIS
30 ISO-2022-JP
31
32 eucJP Japanese EUC
33
34
35 PCK Japanese PC Kanji, CP932, Shift JIS
36
37
38 UTF-8 Korean EUC
39 ko_KR.euc
40
41 ko_KR.cp949 Unified Hangul
42
43
44 ISO-2022-KR ISO-2022 Korean
45
46
47 zh_CN.iso2022-CN ISO-2022 CN/CN-EXT
48
49
50 zh_CN.euc Simplified Chinese EUC, GB2312
51
52
53 GB18030 Simplified Chinese GB18030/GBK
54
55
56 zh_TW-big5 BIG5
57
58
59 zh_TW-euc Traditional Chinese EUC
60
61
62 zh_TW.hkscs Hong Kong BIG5
63
64
65 iso-8859-1 West European, and similar
66
67
68 iso-8859-2 East European, and similar
69
70
71 iso-8859-5 Cyrillic, and similar
72
73
74 iso-8859-6 Arabic
75
76
77 iso-8859-7 Greek
78
79
80 iso-8859-8 Hebrew
81
82
83 CP1250 windows-1250, corresponding to ISO-8859-2
84
85
86 CP1251 windows-1251, corresponding to ISO-8859-5
87
88
89 CP1252 windows-1252, corresponding to ISO-8859-1
90
91
92 CP1253 windows-1253, corresponding to ISO-8859-7
93
94
95 CP1255 windows-1255, corresponding to ISO-8859-8
96
97
98 koi8-r corresponding to iso-8859-5
99
100
101
102 By default, auto_ef returns a single, most likely encoding for text in
103 a specified file. To get all possible encodings for the file, use the
104 -a option.
105
106
107 Also by default, auto_ef uses the fastest process to examine the file.
108 For more accurate results, use the -l option.
109
110
111 To examine data with a limited set of encodings, use the -e option.
112
114 The following options are supported:
115
116 -a Shows all possible encodings in order of possibil‐
117 ity, with scores in the range between 0.0 and 1.0.
118 A higher score means a higher possibility. For
119 example,
120
121 example% auto_ef -a test_file
122 eucJP 0.89
123 zh_CN.euc 0.04
124 ko_KR.euc 0.01
125
126
127 Without this option, only one encoding with the
128 highest score is shown.
129
130
131 -e encoding_list Examines data only with specified encodings. For
132 example, when encoding_list is specified as
133 "ko_KR.euc:ko_KR.cp949", auto_ef examines text only
134 with CP949 and ko_KR.euc. Without this option,
135 auto_ef examines text with all encodings. Multiple
136 encodings can be specified by separating the encod‐
137 ings using a colon (:).
138
139
140 -h Shows the usage message.
141
142
143 -l level Specifies the level of judgment. The value of level
144 can be 0, 1, 2, or 3. Level 3 produces the best
145 result but can be slow. Level 0 is fastest but
146 results can be less accurate than in higher levels.
147 The default is level 0.
148
149
151 The following operands are supported:
152
153 file File name to examine.
154
155
157 Example 1 Examining encoding of a file
158
159 example% auto_ef file_name
160
161
162
163 Example 2 Examining encoding of a file at level 2.
164
165 example% auto_ef -l 2 file_name
166
167
168
169 Example 3 Examining encoding of a file with only eucJP or ko_KR.euc
170
171 example% auto_ef -e "eucJP:ko_KR.euc" file_name
172
173
174
176 The following exit values are returned:
177
178 0 Successful completion
179
180
181 1 An error occurred.
182
183
185 See attributes(5) for descriptions of the following attributes:
186
187
188
189
190 ┌─────────────────────────────┬─────────────────────────────┐
191 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
192 ├─────────────────────────────┼─────────────────────────────┤
193 │Availability │SUNWautoef │
194 ├─────────────────────────────┼─────────────────────────────┤
195 │Interface Stability │See below. │
196 └─────────────────────────────┴─────────────────────────────┘
197
198
199 Interface Stability of output format, when option -a is specified, is
200 Evolving. Other interfaces are Stable.
201
203 auto_ef(3EXT), libauto_ef(3LIB), attributes(5)
204
205
206 International Language Environments Guide
207
208
209
210SunOS 5.11 26 Sep 2004 auto_ef(1)