[ Index ]
 

Code source de Drupal 5.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/ -> unicode.inc (sommaire)

Indicates an error during check for PHP unicode support.

Poids: 508 lignes (17 kb)
Inclus ou requis: 3 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 17 fonctions

  unicode_check()
  _unicode_check()
  unicode_requirements()
  drupal_xml_parser_create()
  drupal_convert_to_utf8()
  truncate_utf8()
  mime_header_encode()
  mime_header_decode()
  _mime_header_decode()
  decode_entities()
  _decode_entities()
  drupal_strlen()
  drupal_strtoupper()
  drupal_strtolower()
  _unicode_caseflip()
  drupal_ucfirst()
  drupal_substr()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

unicode_check()   X-Ref
Wrapper around _unicode_check().


_unicode_check()   X-Ref
Perform checks about Unicode support in PHP, and set the right settings if
needed.

Because Drupal needs to be able to handle text in various encodings, we do
not support mbstring function overloading. HTTP input/output conversion must
be disabled for similar reasons.

param: $errors

unicode_requirements()   X-Ref
Return Unicode library status and errors.


drupal_xml_parser_create(&$data)   X-Ref
Prepare a new XML parser.

This is a wrapper around xml_parser_create() which extracts the encoding from
the XML data first and sets the output encoding to UTF-8. This function should
be used instead of xml_parser_create(), because PHP 4's XML parser doesn't
check the input encoding itself. "Starting from PHP 5, the input encoding is
automatically detected, so that the encoding parameter specifies only the
output encoding."

This is also where unsupported encodings will be converted. Callers should
take this into account: $data might have been changed after the call.

param: &$data
return:

drupal_convert_to_utf8($data, $encoding)   X-Ref
Convert data to UTF-8

Requires the iconv, GNU recode or mbstring PHP extension.

param: $data
param: $encoding
return:

truncate_utf8($string, $len, $wordsafe = FALSE, $dots = FALSE)   X-Ref
Truncate a UTF-8-encoded string safely to a number of bytes.

If the end position is in the middle of a UTF-8 sequence, it scans backwards
until the beginning of the byte sequence.

Use this function whenever you want to chop off a string at an unsure
location. On the other hand, if you're sure that you're splitting on a
character boundary (e.g. after using strpos() or similar), you can safely use
substr() instead.

param: $string
param: $len
param: $wordsafe
return:

mime_header_encode($string)   X-Ref
Encodes MIME/HTTP header values that contain non-ASCII, UTF-8 encoded
characters.

For example, mime_header_encode('tést.txt') returns "=?UTF-8?B?dMOpc3QudHh0?=".

See http://www.rfc-editor.org/rfc/rfc2047.txt for more information.

Notes:
- Only encode strings that contain non-ASCII characters.
- We progressively cut-off a chunk with truncate_utf8(). This is to ensure
each chunk starts and ends on a character boundary.
- Using \n as the chunk separator may cause problems on some systems and may
have to be changed to \r\n or \r.

mime_header_decode($header)   X-Ref
Complement to mime_header_encode


_mime_header_decode($matches)   X-Ref
Helper function to mime_header_decode


decode_entities($text, $exclude = array()   X-Ref
Decode all HTML entities (including numerical ones) to regular UTF-8 bytes.
Double-escaped entities will only be decoded once ("&amp;lt;" becomes "&lt;", not "<").

param: $text
param: $exclude

_decode_entities($prefix, $codepoint, $original, &$table, &$exclude)   X-Ref
Helper function for decode_entities


drupal_strlen($text)   X-Ref
Count the amount of characters in a UTF-8 string. This is less than or
equal to the byte count.


drupal_strtoupper($text)   X-Ref
Uppercase a UTF-8 string.


drupal_strtolower($text)   X-Ref
Lowercase a UTF-8 string.


_unicode_caseflip($matches)   X-Ref
Helper function for case conversion of Latin-1.
Used for flipping U+C0-U+DE to U+E0-U+FD and back.


drupal_ucfirst($text)   X-Ref
Capitalize the first letter of a UTF-8 string.


drupal_substr($text, $start, $length = NULL)   X-Ref
Cut off a piece of a string based on character indices and counts. Follows
the same behaviour as PHP's own substr() function.

Note that for cutting off a string at a known character/substring
location, the usage of PHP's normal strpos/substr is safe and
much faster.



Généré le : Fri Nov 30 16:20:15 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics