[ class tree: core ] [ index: core ] [ all elements ]

Class: utf8

Source Location: /lib-utf8.php

Class utf8

Class Overview

UTF-8 friendly replacement functions - v0.2 Copyright (C) 2004-2006 Niels Leenheer & Andy Matsubara

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Supported functions:

  • utf8::convert()
  • utf8::detect()
  • utf8::strtolower()
  • utf8::strtoupper()
  • utf8::strlen()
  • utf8::strwidth()
  • utf8::substr()
  • utf8::strimwidth()
  • utf8::strcut()
  • utf8::strrpos()
  • utf8::strpos()
  • utf8::substr_count()
  • utf8::encode_mimeheader()
  • utf8::send_mail()
  • utf8::encode_javascript()
  • utf8::encode_numericentity()

Located in /lib-utf8.php [line 37]



		
		
		
		

Properties

Methods

[ Top ]
Property Summary
mixed   $charsets   Character set translation support
mixed   $iconv_sets  
mixed   $mb_sets  

[ Top ]
Method Summary
static void   detect()   Detect the encoding of the string
static void   encode_javascript()   Prepare an UTF-8 string for use in JavaScript
static void   encode_mimeheader()   Encode a string for use in a MIME header
static void   encode_numericentity()   Encode an UTF-8 string with numeric entities
static void   sanitize()   replaces invalid UTF-8 characters with blanks
static void   send_mail()   Send mail
static void   strcut()   Return part of a string, length and offset in bytes
static void   strimwidth()   Get truncated string with specified width
static void   strlen()   Determine the number of characters of a string
static void   strpos()   Find position of first occurance of a string in another string
static void   strrpos()   Find position of last occurance of a string in another string
static void   strtolower()   Convert a string to lower case
static void   strtoupper()   Convert a string to upper case
static void   strwidth()   Determine the width of a string
static void   substr()   Return part of a string, length and offset in characters
static void   substr_count()   Count the number of substring occurances
utf8   utf8()  
void   convert()   Convert a foreign charset encoding from or to UTF-8

[ Top ]
Properties
mixed   $charsets [line 44]

Character set translation support


[ Top ]
mixed   $iconv_sets [line 46]

[ Top ]
mixed   $mb_sets [line 45]

[ Top ]
Methods
static method detect  [line 254]

  static void detect( $string  )

Detect the encoding of the string

Parameters:
   $string: 


[ Top ]
static method encode_javascript  [line 499]

  static void encode_javascript( $string  )

Prepare an UTF-8 string for use in JavaScript

Parameters:
   $string: 


[ Top ]
static method encode_mimeheader  [line 448]

  static void encode_mimeheader( $str  )

Encode a string for use in a MIME header

Simplied replacement for mb_encode_mimeheader()

Parameters:
   $str: 


[ Top ]
static method encode_numericentity  [line 554]

  static void encode_numericentity( $string  )

Encode an UTF-8 string with numeric entities

Simplied replacement for mb_encode_numericentity()

Parameters:
   $string: 


[ Top ]
static method sanitize  [line 198]

  static void sanitize( $text  )

replaces invalid UTF-8 characters with blanks

Parameters:
   $text: 


[ Top ]
static method send_mail  [line 475]

  static void send_mail( $to, $subject, $message, [ $additional_headers = ''], [ $additional_parameter = '']  )

Send mail

Replacement for mb_send_mail(), an UTF-8 friendly replacement for mail()

Parameters:
   $to: 
   $subject: 
   $message: 
   $additional_headers: 
   $additional_parameter: 


[ Top ]
static method strcut  [line 314]

  static void strcut( $str, $start, [ $length = NULL]  )

Return part of a string, length and offset in bytes

Compatible with mb_strcut()

Parameters:
   $str: 
   $start: 
   $length: 


[ Top ]
static method strimwidth  [line 364]

  static void strimwidth( $str, $start, $width, [ $trimmarker = '']  )

Get truncated string with specified width

Compatible with mb_strimwidth()

Parameters:
   $str: 
   $start: 
   $width: 
   $trimmarker: 


[ Top ]
static method strlen  [line 283]

  static void strlen( $str  )

Determine the number of characters of a string

Compatible with mb_strlen(), an UTF-8 friendly replacement for strlen()

Parameters:
   $str: 


[ Top ]
static method strpos  [line 411]

  static void strpos( $haystack, $needle, [ $offset = 0]  )

Find position of first occurance of a string in another string

Compatible with mb_strpos(), an UTF-8 friendly replacement for strpos()

Parameters:
   $haystack: 
   $needle: 
   $offset: 


[ Top ]
static method strrpos  [line 399]

  static void strrpos( $haystack, $needle  )

Find position of last occurance of a string in another string

Compatible with mb_strrpos(), an UTF-8 friendly replacement for strrpos()

Parameters:
   $haystack: 
   $needle: 


[ Top ]
static method strtolower  [line 430]

  static void strtolower( $str  )

Convert a string to lower case

Compatible with mb_strtolower(), an UTF-8 friendly replacement for strtolower()

Parameters:
   $str: 


[ Top ]
static method strtoupper  [line 439]

  static void strtoupper( $str  )

Convert a string to upper case

Compatible with mb_strtoupper(), an UTF-8 friendly replacement for strtoupper()

Parameters:
   $str: 


[ Top ]
static method strwidth  [line 352]

  static void strwidth( $str  )

Determine the width of a string

Compatible with mb_strwidth()

Parameters:
   $str: 


[ Top ]
static method substr  [line 299]

  static void substr( $str, $start, [ $length = NULL]  )

Return part of a string, length and offset in characters

Compatible with mb_substr(), an UTF-8 friendly replacement for substr()

Parameters:
   $str: 
   $start: 
   $length: 


[ Top ]
static method substr_count  [line 291]

  static void substr_count( $haystack, $needle  )

Count the number of substring occurances

Compatible with mb_substr_count(), an UTF-8 friendly replacement for substr_count()

Parameters:
   $haystack: 
   $needle: 


[ Top ]
Constructor utf8  [line 48]

  utf8 utf8( )



[ Top ]
convert  [line 210]

  void convert( $string, [ $encoding = NULL], [ $destination = 'UTF-8']  )

Convert a foreign charset encoding from or to UTF-8

Parameters:
   $string: 
   $encoding: 
   $destination: 


[ Top ]

Documentation generated on Sat, 07 Jun 2014 18:03:37 +0200 by phpDocumentor 1.4.3