File: iconv.php

package info (click to toggle)
codelite 17.0.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 136,244 kB
  • sloc: cpp: 491,547; ansic: 280,393; php: 10,259; sh: 8,930; lisp: 7,664; vhdl: 6,518; python: 6,020; lex: 4,920; yacc: 3,123; perl: 2,385; javascript: 1,715; cs: 1,193; xml: 1,110; makefile: 804; cobol: 741; sql: 709; ruby: 620; f90: 566; ada: 534; asm: 464; fortran: 350; objc: 289; tcl: 258; java: 157; erlang: 61; pascal: 51; ml: 49; awk: 44; haskell: 36
file content (445 lines) | stat: -rw-r--r-- 14,755 bytes parent folder | download | duplicates (6)
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
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<?php

// Start of iconv v.

/**
 * Convert string to requested character encoding
 * @link http://www.php.net/manual/en/function.iconv.php
 * @param in_charset string <p>
 *       The input charset.
 *      </p>
 * @param out_charset string <p>
 *       The output charset.
 *      </p>
 *      <p>
 *       If you append the string //TRANSLIT to
 *       out_charset transliteration is activated. This
 *       means that when a character can't be represented in the target charset,
 *       it can be approximated through one or several similarly looking
 *       characters. If you append the string //IGNORE,
 *       characters that cannot be represented in the target charset are silently
 *       discarded. Otherwise, str is cut from the first
 *       illegal character and an E_NOTICE is generated.
 *      </p>
 * @param str string <p>
 *       The string to be converted.
 *      </p>
 * @return string the converted string&return.falseforfailure;.
 */
function iconv ($in_charset, $out_charset, $str) {}

/**
 * Retrieve internal configuration variables of iconv extension
 * @link http://www.php.net/manual/en/function.iconv-get-encoding.php
 * @param type string[optional] <p>
 *       The value of the optional type can be:
 *       
 *        all
 *        input_encoding
 *        output_encoding
 *        internal_encoding
 *       
 *      </p>
 * @return mixed the current value of the internal configuration variable if
 *   successful&return.falseforfailure;.
 *  </p>
 *  <p>
 *   If type is omitted or set to "all",
 *   iconv_get_encoding returns an array that
 *   stores all these variables.
 */
function iconv_get_encoding ($type = null) {}

/**
 * Set current setting for character encoding conversion
 * @link http://www.php.net/manual/en/function.iconv-set-encoding.php
 * @param type string <p>
 *       The value of type can be any one of these:
 *       
 *        input_encoding
 *        output_encoding
 *        internal_encoding
 *       
 *      </p>
 * @param charset string <p>
 *       The character set.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function iconv_set_encoding ($type, $charset) {}

/**
 * Returns the character count of string
 * @link http://www.php.net/manual/en/function.iconv-strlen.php
 * @param str string <p>
 *       The string.
 *      </p>
 * @param charset string[optional] <p>
 *       If charset parameter is omitted,
 *       str is assumed to be encoded in
 *       iconv.internal_encoding.
 *      </p>
 * @return int the character count of str, as an integer.
 */
function iconv_strlen ($str, $charset = null) {}

/**
 * Cut out part of a string
 * @link http://www.php.net/manual/en/function.iconv-substr.php
 * @param str string <p>
 *       The original string.
 *      </p>
 * @param offset int <p>
 *       If offset is non-negative,
 *       iconv_substr cuts the portion out of
 *       str beginning at offset'th
 *       character, counting from zero.
 *      </p>
 *      <p>
 *       If offset is negative,
 *       iconv_substr cuts out the portion beginning
 *       at the position, offset characters
 *       away from the end of str.
 *      </p>
 * @param length int[optional] <p>
 *       If length is given and is positive, the return
 *       value will contain at most length characters
 *       of the portion that begins at offset
 *       (depending on the length of string).
 *      </p>
 *      <p>
 *       If negative length is passed,
 *       iconv_substr cuts the portion out of
 *       str from the offset'th
 *       character up to the character that is
 *       length characters away from the end of the string.
 *       In case offset is also negative, the start position
 *       is calculated beforehand according to the rule explained above.
 *      </p>
 * @param charset string[optional] <p>
 *       If charset parameter is omitted,
 *       string are assumed to be encoded in
 *       iconv.internal_encoding.
 *      </p>
 *      <p>
 *       Note that offset and length
 *       parameters are always deemed to represent offsets that are
 *       calculated on the basis of the character set determined by
 *       charset, whilst the counterpart
 *       substr always takes these for byte offsets.
 *      </p>
 * @return string the portion of str specified by the
 *   offset and length parameters.
 *  </p>
 *  <p>
 *   If str is shorter than offset
 *   characters long, false will be returned.
 */
function iconv_substr ($str, $offset, $length = null, $charset = null) {}

/**
 * Finds position of first occurrence of a needle within a haystack
 * @link http://www.php.net/manual/en/function.iconv-strpos.php
 * @param haystack string <p>
 *       The entire string.
 *      </p>
 * @param needle string <p>
 *       The searched substring.
 *      </p>
 * @param offset int[optional] <p>
 *       The optional offset parameter specifies
 *       the position from which the search should be performed.
 *      </p>
 * @param charset string[optional] <p>
 *       If charset parameter is omitted,
 *       string are assumed to be encoded in
 *       iconv.internal_encoding.
 *      </p>
 * @return int the numeric position of the first occurrence of
 *   needle in haystack.
 *  </p>
 *  <p>
 *   If needle is not found,
 *   iconv_strpos will return false.
 */
function iconv_strpos ($haystack, $needle, $offset = null, $charset = null) {}

/**
 * Finds the last occurrence of a needle within a haystack
 * @link http://www.php.net/manual/en/function.iconv-strrpos.php
 * @param haystack string <p>
 *       The entire string.
 *      </p>
 * @param needle string <p>
 *       The searched substring.
 *      </p>
 * @param charset string[optional] <p>
 *       If charset parameter is omitted,
 *       string are assumed to be encoded in
 *       iconv.internal_encoding.
 *      </p>
 * @return int the numeric position of the last occurrence of
 *   needle in haystack.
 *  </p>
 *  <p>
 *   If needle is not found,
 *   iconv_strrpos will return false.
 */
function iconv_strrpos ($haystack, $needle, $charset = null) {}

/**
 * Composes a <literal>MIME</literal> header field
 * @link http://www.php.net/manual/en/function.iconv-mime-encode.php
 * @param field_name string <p>
 *       The field name.
 *      </p>
 * @param field_value string <p>
 *       The field value.
 *      </p>
 * @param preferences array[optional] <p>
 *       You can control the behaviour of iconv_mime_encode
 *       by specifying an associative array that contains configuration items
 *       to the optional third parameter preferences.
 *       The items supported by iconv_mime_encode are
 *       listed below. Note that item names are treated case-sensitive.
 *       <table>
 *        Configuration items supported by iconv_mime_encode
 *        
 *         
 *          <tr valign="top">
 *           <td>Item</td>
 *           <td>Type</td>
 *           <td>Description</td>
 *           <td>Default value</td>
 *           <td>Example</td>
 *          </tr>
 *         
 *         
 *          <tr valign="top">
 *           <td>scheme</td>
 *           <td>string</td>
 *           <td>
 *            Specifies the method to encode a field value by. The value of
 *            this item may be either "B" or "Q", where "B" stands for
 *            base64 encoding scheme and "Q" stands for
 *            quoted-printable encoding scheme.
 *           </td>
 *           <td>B</td>
 *           <td>B</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>input-charset</td>
 *           <td>string</td>
 *           <td>
 *            Specifies the character set in which the first parameter
 *            field_name and the second parameter
 *            field_value are presented. If not given,
 *            iconv_mime_encode assumes those parameters
 *            are presented to it in the
 *            iconv.internal_encoding
 *            ini setting.
 *           </td>
 *           <td>
 *            iconv.internal_encoding
 *           </td>
 *           <td>ISO-8859-1</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>output-charset</td>
 *           <td>string</td>
 *           <td>
 *            Specifies the character set to use to compose the
 *            MIME header.
 *           </td>
 *           <td>
 *            iconv.internal_encoding
 *           </td>
 *           <td>UTF-8</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>line-length</td>
 *           <td>integer</td>
 *           <td>
 *            Specifies the maximum length of the header lines. The resulting
 *            header is "folded" to a set of multiple lines in case
 *            the resulting header field would be longer than the value of this
 *            parameter, according to
 *            RFC2822 - Internet Message Format.
 *            If not given, the length will be limited to 76 characters.
 *           </td>
 *           <td>76</td>
 *           <td>996</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>line-break-chars</td>
 *           <td>string</td>
 *           <td>
 *            Specifies the sequence of characters to append to each line
 *            as an end-of-line sign when "folding" is performed on a long header
 *            field. If not given, this defaults to "\r\n"
 *            (CR LF). Note that
 *            this parameter is always treated as an ASCII string regardless
 *            of the value of input-charset.
 *           </td>
 *           <td>\r\n</td>
 *           <td>\n</td>
 *          </tr>
 *         
 *        
 *       </table>
 *      </p>
 * @return string an encoded MIME field on success,
 *   or false if an error occurs during the encoding.
 */
function iconv_mime_encode ($field_name, $field_value, array $preferences = null) {}

/**
 * Decodes a <literal>MIME</literal> header field
 * @link http://www.php.net/manual/en/function.iconv-mime-decode.php
 * @param encoded_header string <p>
 *       The encoded header, as a string.
 *      </p>
 * @param mode int[optional] <p>
 *       mode determines the behaviour in the event
 *       iconv_mime_decode encounters a malformed
 *       MIME header field. You can specify any combination
 *       of the following bitmasks.
 *       <table>
 *        Bitmasks acceptable to iconv_mime_decode
 *        
 *         
 *          <tr valign="top">
 *           <td>Value</td>
 *           <td>Constant</td>
 *           <td>Description</td>
 *          </tr>
 *         
 *         
 *          <tr valign="top">
 *           <td>1</td>
 *           <td>ICONV_MIME_DECODE_STRICT</td>
 *           <td>
 *            If set, the given header is decoded in full conformance with the
 *            standards defined in RFC2047.
 *            This option is disabled by default because there are a lot of
 *            broken mail user agents that don't follow the specification and don't
 *            produce correct MIME headers.
 *           </td>
 *          </tr>
 *          <tr valign="top">
 *           <td>2</td>
 *           <td>ICONV_MIME_DECODE_CONTINUE_ON_ERROR</td>
 *           <td>
 *            If set, iconv_mime_decode_headers
 *            attempts to ignore any grammatical errors and continue to process
 *            a given header.
 *           </td>
 *          </tr>
 *         
 *        
 *       </table>
 *      </p>
 * @param charset string[optional] <p>
 *       The optional charset parameter specifies the
 *       character set to represent the result by. If omitted,
 *       iconv.internal_encoding
 *       will be used.
 *      </p>
 * @return string a decoded MIME field on success,
 *   or false if an error occurs during the decoding.
 */
function iconv_mime_decode ($encoded_header, $mode = null, $charset = null) {}

/**
 * Decodes multiple <literal>MIME</literal> header fields at once
 * @link http://www.php.net/manual/en/function.iconv-mime-decode-headers.php
 * @param encoded_headers string <p>
 *       The encoded headers, as a string.
 *      </p>
 * @param mode int[optional] <p>
 *       mode determines the behaviour in the event
 *       iconv_mime_decode_headers encounters a malformed
 *       MIME header field. You can specify any combination
 *       of the following bitmasks.
 *       <table>
 *        Bitmasks acceptable to iconv_mime_decode_headers
 *        
 *         
 *          <tr valign="top">
 *           <td>Value</td>
 *           <td>Constant</td>
 *           <td>Description</td>
 *          </tr>
 *         
 *         
 *          <tr valign="top">
 *           <td>1</td>
 *           <td>ICONV_MIME_DECODE_STRICT</td>
 *           <td>
 *            If set, the given header is decoded in full conformance with the
 *            standards defined in RFC2047.
 *            This option is disabled by default because there are a lot of
 *            broken mail user agents that don't follow the specification and don't
 *            produce correct MIME headers.
 *           </td>
 *          </tr>
 *          <tr valign="top">
 *           <td>2</td>
 *           <td>ICONV_MIME_DECODE_CONTINUE_ON_ERROR</td>
 *           <td>
 *            If set, iconv_mime_decode_headers
 *            attempts to ignore any grammatical errors and continue to process
 *            a given header.
 *           </td>
 *          </tr>
 *         
 *        
 *       </table>
 *      </p>
 * @param charset string[optional] <p>
 *       The optional charset parameter specifies the
 *       character set to represent the result by. If omitted,
 *       iconv.internal_encoding
 *       will be used.
 *      </p>
 * @return array an associative array that holds a whole set of
 *   MIME header fields specified by
 *   encoded_headers on success, or false
 *   if an error occurs during the decoding.
 *  </p>
 *  <p>
 *   Each key of the return value represents an individual
 *   field name and the corresponding element represents a field value.
 *   If more than one field of the same name are present,
 *   iconv_mime_decode_headers automatically incorporates
 *   them into a numerically indexed array in the order of occurrence.
 */
function iconv_mime_decode_headers ($encoded_headers, $mode = null, $charset = null) {}


/**
 * string
 * @link http://www.php.net/manual/en/iconv.constants.php
 */
define ('ICONV_IMPL', "glibc");

/**
 * string
 * @link http://www.php.net/manual/en/iconv.constants.php
 */
define ('ICONV_VERSION', 2.19);

/**
 * integer
 * @link http://www.php.net/manual/en/iconv.constants.php
 */
define ('ICONV_MIME_DECODE_STRICT', 1);

/**
 * integer
 * @link http://www.php.net/manual/en/iconv.constants.php
 */
define ('ICONV_MIME_DECODE_CONTINUE_ON_ERROR', 2);

// End of iconv v.
?>