[ 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 38]



		
		
		
		

Properties

Methods

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

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

[ Top ]
Properties
mixed   $charsets [line 45]

Character set translation support


[ Top ]
mixed   $iconv_sets [line 48]

[ Top ]
mixed   $mb_sets [line 47]

[ Top ]
mixed   $validsets [line 46]

[ Top ]
Methods
Constructor utf8  [line 50]

  utf8 utf8( )



[ Top ]
convert  [line 200]

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

Convert a foreign charset encoding from or to UTF-8

Parameters:
   $string: 
   $encoding: 
   $destination: 


[ Top ]
detect  [line 242]

  void detect( $string  )

Detect the encoding of the string

Parameters:
   $string: 


[ Top ]
encode_javascript  [line 496]

  void encode_javascript( $string  )

Prepare an UTF-8 string for use in JavaScript

Parameters:
   $string: 


[ Top ]
encode_mimeheader  [line 440]

  void encode_mimeheader( $str  )

Encode a string for use in a MIME header

Simplied replacement for mb_encode_mimeheader()

Parameters:
   $str: 


[ Top ]
encode_numericentity  [line 560]

  void encode_numericentity( $string  )

Encode an UTF-8 string with numeric entities

Simplied replacement for mb_encode_numericentity()

Parameters:
   $string: 


[ Top ]
send_mail  [line 469]

  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 ]
strcut  [line 303]

  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 ]
strimwidth  [line 355]

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

Get truncated string with specified width

Compatible with mb_strimwidth()

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


[ Top ]
strlen  [line 272]

  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 ]
strpos  [line 404]

  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 ]
strrpos  [line 392]

  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 ]
strtolower  [line 422]

  void strtolower( $str  )

Convert a string to lower case

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

Parameters:
   $str: 


[ Top ]
strtoupper  [line 431]

  void strtoupper( $str  )

Convert a string to upper case

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

Parameters:
   $str: 


[ Top ]
strwidth  [line 343]

  void strwidth( $str  )

Determine the width of a string

Compatible with mb_strwidth()

Parameters:
   $str: 


[ Top ]
substr  [line 288]

  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 ]
substr_count  [line 280]

  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 ]

Documentation generated on Tue, 20 Dec 2011 16:07:39 +0100 by phpDocumentor 1.4.3