[//]: # (AUTO-GENERATED BY "PHP README Helper": base file -> docs/base.md)
[![Build Status](https://travis-ci.org/voku/portable-utf8.svg?branch=master)](https://travis-ci.org/voku/portable-utf8)
[![Build status](https://ci.appveyor.com/api/projects/status/gnejjnk7qplr7f5t/branch/master?svg=true)](https://ci.appveyor.com/project/voku/portable-utf8/branch/master)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fvoku%2Fportable-utf8.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fvoku%2Fportable-utf8?ref=badge_shield)
[![Coverage Status](https://coveralls.io/repos/voku/portable-utf8/badge.svg?branch=master&service=github)](https://coveralls.io/github/voku/portable-utf8?branch=master)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/997c9bb10d1c4791967bdf2e42013e8e)](https://www.codacy.com/app/voku/portable-utf8)
[![Latest Stable Version](https://poser.pugx.org/voku/portable-utf8/v/stable)](https://packagist.org/packages/voku/portable-utf8)
[![Total Downloads](https://poser.pugx.org/voku/portable-utf8/downloads)](https://packagist.org/packages/voku/portable-utf8)
[![License](https://poser.pugx.org/voku/portable-utf8/license)](https://packagist.org/packages/voku/portable-utf8)
[![Donate to this project using PayPal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/moelleken)
[![Donate to this project using Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/voku)
# 🉑 Portable UTF-8
## Description
It is written in PHP (PHP 7+) and can work without "mbstring", "iconv" or any other extra encoding php-extension on your server.
The benefit of Portable UTF-8 is that it is easy to use, easy to bundle. This library will also
auto-detect your server environment and will use the installed php-extensions if they are available,
so you will have the best possible performance.
As a fallback we will use Symfony Polyfills, if needed. (https://github.com/symfony/polyfill)
The project based on ...
+ Hamid Sarfraz's work - [portable-utf8](http://pageconfig.com/attachments/portable-utf8.php)
+ Nicolas Grekas's work - [tchwork/utf8](https://github.com/tchwork/utf8)
+ Behat's work - [Behat/Transliterator](https://github.com/Behat/Transliterator)
+ Sebastián Grignoli's work - [neitanod/forceutf8](https://github.com/neitanod/forceutf8)
+ Ivan Enderlin's work - [hoaproject/Ustring](https://github.com/hoaproject/Ustring)
+ and many cherry-picks from "GitHub"-gists and "Stack Overflow"-snippets ...
## Demo
Here you can test some basic functions from this library and you can compare some results with the native php function results.
+ [encoder.suckup.de](https://encoder.suckup.de/)
## Index
* [Alternative](#alternative)
* [Install](#install-portable-utf-8-via-composer-require)
* [Why Portable UTF-8?](#why-portable-utf-8)
* [Requirements and Recommendations](#requirements-and-recommendations)
* [Warning](#warning)
* [Usage](#usage)
* [Class methods](#class-methods)
* [Unit Test](#unit-test)
* [License and Copyright](#license-and-copyright)
## Alternative
If you like a more Object Oriented Way to edit strings, then you can take a look at [voku/Stringy](https://github.com/voku/Stringy), it's a fork of "danielstjules/Stringy" but it used the "Portable UTF-8"-Class and some extra methods.
```php
// Standard library
strtoupper('fòôbàř'); // 'FòôBàř'
strlen('fòôbàř'); // 10
// mbstring
// WARNING: if you don't use a polyfill like "Portable UTF-8", you need to install the php-extension "mbstring" on your server
mb_strtoupper('fòôbàř'); // 'FÒÔBÀŘ'
mb_strlen('fòôbàř'); // '6'
// Portable UTF-8
use voku\helper\UTF8;
UTF8::strtoupper('fòôbàř'); // 'FÒÔBÀŘ'
UTF8::strlen('fòôbàř'); // '6'
// voku/Stringy
use Stringy\Stringy as S;
$stringy = S::create('fòôbàř');
$stringy->toUpperCase(); // 'FÒÔBÀŘ'
$stringy->length(); // '6'
```
## Install "Portable UTF-8" via "composer require"
```shell
composer require voku/portable-utf8
```
If your project do not need some of the Symfony polyfills please use the `replace` section of your `composer.json`.
This removes any overhead from these polyfills as they are no longer part of your project. e.g.:
```json
{
"replace": {
"symfony/polyfill-php72": "1.99",
"symfony/polyfill-iconv": "1.99",
"symfony/polyfill-intl-grapheme": "1.99",
"symfony/polyfill-intl-normalizer": "1.99",
"symfony/polyfill-mbstring": "1.99"
}
}
```
## Why Portable UTF-8?[]()
PHP 5 and earlier versions have no native Unicode support. To bridge the gap, there exist several extensions like "mbstring", "iconv" and "intl".
The problem with "mbstring" and others is that most of the time you cannot ensure presence of a specific one on a server. If you rely on one of these, your application is no more portable. This problem gets even severe for open source applications that have to run on different servers with different configurations. Considering these, I decided to write a library:
## Requirements and Recommendations
* No extensions are required to run this library. Portable UTF-8 only needs PCRE library that is available by default since PHP 4.2.0 and cannot be disabled since PHP 5.3.0. "\u" modifier support in PCRE for UTF-8 handling is not a must.
* PHP 5.3 is the minimum requirement, and all later versions are fine with Portable UTF-8.
* PHP 7.0 is the minimum requirement since version 4.0 of Portable UTF-8, otherwise composer will install an older version
* To speed up string handling, it is recommended that you have "mbstring" or "iconv" available on your server, as well as the latest version of PCRE library
* Although Portable UTF-8 is easy to use; moving from native API to Portable UTF-8 may not be straight-forward for everyone. It is highly recommended that you do not update your scripts to include Portable UTF-8 or replace or change anything before you first know the reason and consequences. Most of the time, some native function may be all what you need.
* There is also a shim for "mbstring", "iconv" and "intl", so you can use it also on shared webspace.
## Info
Since version 5.4.26 this library will NOT force "UTF-8" by "bootstrap.php" anymore.
If you need to enable this behavior you can define "PORTABLE_UTF8__ENABLE_AUTO_FILTER", before requiring the autoloader.
```php
define('PORTABLE_UTF8__ENABLE_AUTO_FILTER', 1);
```
Before version 5.4.26 this behavior was enabled by default and you could disable it via "PORTABLE_UTF8__DISABLE_AUTO_FILTER",
but the code had potential security vulnerabilities via injecting code while redirecting via ```header('Location ...```.
This is the reason I decided to add this BC in a bug fix release, so that everybody using the current version will receive the security-fix.
## Usage
Example 1: UTF8::cleanup()
```php
echo UTF8::cleanup('�Düsseldorf�');
// will output:
// Düsseldorf
```
Example 2: UTF8::strlen()
```php
$string = 'string <strong>with utf-8 chars åèä</strong> - doo-bee doo-bee dooh';
echo strlen($string) . "\n<br />";
echo UTF8::strlen($string) . "\n<br />";
// will output:
// 70
// 67
$string_test1 = strip_tags($string);
$string_test2 = UTF8::strip_tags($string);
echo strlen($string_test1) . "\n<br />";
echo UTF8::strlen($string_test2) . "\n<br />";
// will output:
// 53
// 50
```
Example 3: UTF8::fix_utf8()
```php
echo UTF8::fix_utf8('Düsseldorf');
echo UTF8::fix_utf8('ä');
// will output:
// Düsseldorf
// ä
```
# Portable UTF-8 | API
The API from the "UTF8"-Class is written as small static methods that will match the default PHP-API.
## Class methods
<p id="voku-php-readme-class-methods"></p><table><tr><td>
没有合适的资源?快使用搜索试试~ 我知道了~
聊天室系统源码 匿名聊天系统源码 在线聊天室系统源码 可发语音 图片 适用PC+WAP
共1844个文件
php:624个
svg:532个
jpeg:138个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 81 浏览量
2023-10-31
12:59:19
上传
评论
收藏 27.27MB ZIP 举报
温馨提示
PHP匿名在线聊天室系统源码,适用于PC和WAP端,支持语音和图片传输 通过修改数据库config\settings.php,可以将其用于搭建客户聊天专用的网站 要搭建一个专门用于与客户聊天的网站,您可以使用这个PHP匿名在线聊天室系统源码 该源码适用于PC和WAP端,可以轻松地在不同的设备上访问 通过修改config\settings.php文件中的数据库配置,您可以定制系统以满足您的需求 无论是语音还是图片,这个系统都能够支持,并为您提供一个安全、便捷和高效的聊天平台
资源推荐
资源详情
资源评论
收起资源包目录
聊天室系统源码 匿名聊天系统源码 在线聊天室系统源码 可发语音 图片 适用PC+WAP (1844个子文件)
CHANGELOG 62KB
COMMITMENT 2KB
styles.rtl.min.css 224KB
styles.css 221KB
styles.ltr.min.css 165KB
index.css 77KB
animate.min.css 70KB
all.min.css 55KB
all.min.css 55KB
frontend.css 49KB
flag-icon.min.css 33KB
emojionearea.min.css 24KB
select2.min.css 21KB
summernote.min.css 19KB
admin.css 18KB
default-skin.css 11KB
theme-dark.css 11KB
dropzone.min.css 10KB
toastr.min.css 7KB
toastr.min.css 7KB
dataTables.bootstrap4.min.css 5KB
dataTables.bootstrap4.min.css 5KB
theme-custom.css 5KB
photoswipe.css 4KB
theme-dark.css 3KB
theme-default.css 0B
data.csv 140B
Thumbs.db 148KB
Thumbs.db 100KB
Thumbs.db 5KB
.php_cs.dist 799B
.editorconfig 224B
fa-solid-900.eot 188KB
fa-solid-900.eot 188KB
fa-brands-400.eot 127KB
fa-brands-400.eot 127KB
fa-regular-400.eot 34KB
fa-regular-400.eot 34KB
summernote.eot 12KB
loading-video.gif 21KB
loading.gif 9KB
preloader.gif 866B
.gitignore 70B
.gitignore 17B
.htaccess 1KB
.htaccess 1KB
htaccess 316B
settings.html 49KB
chat_room.html 37KB
404.html 36KB
color.html 17KB
base.index.html 16KB
chat_room_update.html 14KB
base.html 13KB
login.html 12KB
chatpage.html 11KB
user_view.html 10KB
general.html 9KB
image.html 9KB
chatroom_update.html 8KB
register.html 8KB
index.html 8KB
base.html 7KB
join_chatroom.html 7KB
user_add.html 7KB
password_reset.html 6KB
profile_modal.html 6KB
更多实用资源.html 6KB
advertisements.html 6KB
user_list.html 5KB
registration_settings.html 5KB
chat_room_loop_small.html 5KB
contact.html 5KB
chat_room_loop_large.html 5KB
user_chats.html 5KB
homepage.html 5KB
chatroom_list.html 5KB
index.html 4KB
chatroom_users.html 4KB
reset_password.html 4KB
forgot_password.html 3KB
contact.html 3KB
guest_list.html 3KB
languages.html 3KB
base.min.html 3KB
email.html 3KB
contact.html 3KB
policy.html 3KB
chat_room_list_modal.html 2KB
language_view.html 2KB
timing.html 2KB
profanity.html 2KB
language_translation.html 2KB
about.html 2KB
gif.html 1KB
header.html 1024B
footer.html 1008B
rebuild_translate.html 829B
terms.html 625B
privacy.html 609B
共 1844 条
- 1
- 2
- 3
- 4
- 5
- 6
- 19
资源评论
百创科技
- 粉丝: 2050
- 资源: 261
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于java的自习室管理和预约系统设计与实现.docx
- C++实现的基于huffman编码的文件压缩解压demo,供学习用
- No.1176 基于组态王和S7-200 PLC的锅炉温度控制系统设计 带解释的梯形图程序,接线图原理图图纸,io分配,组态画面
- 固体电介质电树枝击穿,以及SF6气体,流注放电过程
- libstdc++.so.6
- 两相交错并联buck boost变器仿真 采用双向结构,管子均为双向管 模型内包含开环,电压单环,电压电流双闭环三种控制方式 两个电感的电流均流控制效果好 matlab simulink plecs仿
- springboot在线教育平台.zip
- “互联网+”中国脉动地图——腾讯移动互联发展指数报告.pdf
- 【报告PDF】破解网络视频创新广告形式.pdf
- 【报告PDF】2015汽车消费新常态研究.pdf
- opencv-4.10.0-vs2019-x86
- 7大员工内推明星业.pdf
- 2013爱德曼新兴市场信任度调查.pdf
- 2014-2015 数字营销和O2O趋势.pdf
- 2014Q4与2015Q1新增对比报告.pdf
- 2014爱德曼中国企业信任度调查.pdf
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功