SproutCMS

This is the code documentation for the SproutCMS project

class utf8

A port of phputf8 to a unified file/class. Checks PHP status to ensure that
UTF-8 support is available and normalize global variables to UTF-8. It also
provides multi-byte aware replacement string functions.

This file is licensed differently from the rest of Kohana. As a port of
phputf8, which is LGPL software, this file is released under the LGPL.

PCRE needs to be compiled with UTF-8 support (--enable-utf8).
Support for Unicode properties is highly recommended (--enable-unicode-properties).

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2026-09-16
**/
class NewClassName extends utf8 {
    
    /**
    * Recursively cleans arrays, objects, and strings. Removes ASCII control
    * codes and converts to UTF-8 while silently discarding incompatible
    * UTF-8 characters.
    **/
    public function clean (string|array|object $str) {
        // Method code goes here
    }
    
    /**
    * Strips out all non-7bit ASCII bytes.
    **/
    public function stripNonAscii (string $str) {
        // Method code goes here
    }
    
    /**
    * Strips out device control codes in the ASCII range.
    **/
    public function stripAsciiCtrl (string $str) {
        // Method code goes here
    }
    
    /**
    * Tests whether a string contains only 7bit ASCII bytes. This is used to
    * determine when to use native functions or UTF-8 functions.
    **/
    public function isAscii (string $str) {
        // Method code goes here
    }
    
}
?>

See also