本文整理匯總了PHP中utf8::init方法的典型用法代碼示例。如果您正苦於以下問題:PHP utf8::init方法的具體用法?PHP utf8::init怎麽用?PHP utf8::init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類utf8
的用法示例。
在下文中一共展示了utf8::init方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
<?php
/*
* BtiTracker v1.5.1 is a php tracker system for BitTorrent, easy to setup and configure.
* This tracker is a frontend for DeHackEd's tracker, aka phpBTTracker (now heavely modified).
* Updated and Maintained by Yupy.
* Copyright (C) 2004-2015 Btiteam.org
*/
require_once CLASS_PATH . 'class.String.php';
require_once CLASS_PATH . 'class.Memcached.php';
utf8::init();
class utf8
{
const TRANSKEY = 'utf8::utf8_win_iso::translation_table';
const NBSP = "Â ";
// # Non-Breaking Space
const TRIM_CHARLIST = ".. ..  ..â€� â�Ÿâ�  ";
private static $trans_table = array();
private static $utf8validator = false;
public static function init()
{
self::$utf8validator = (bool) extension_loaded('utf8validator');
mb_internal_encoding('UTF-8');
mb_language('uni');
mb_regex_encoding('UTF-8');
mb_detect_order(array('UTF-8', 'ISO-8859-1'));
mb_substitute_character(0xfffd);
MCached::connect();
$trans = MCached::get(self::TRANSKEY);
if ($trans === MCached::NO_RESULT) {
$win = "€" . implode('', range("‚", "Œ")) . "Ž" . implode('', range("‘", "œ")) . implode('', range("ž", "ÿ"));