GithubHelp home page GithubHelp logo

franzliedke-pulls / php-utf8 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fluxbb/utf8

1.0 2.0 0.0 1.9 MB

A library for UTF-8 in PHP providing UTF-8 aware functions to mirror PHP's own string functions. The library doesn't require PHP mbstring extension although, if found, it will use it to gain performance.

Home Page: http://php-utf8.61924.nl/

License: GNU Lesser General Public License v2.1

PHP 100.00%

php-utf8's Introduction

PHP-UTF8

Introduction

PHP-UTF-8 is a UTF-8 aware library of functions mirroring PHP's own string functions. Does not require PHP mbstring extension though will use it, if found, for a (small) performance gain.

The project was initially on sourceforge where it died due to lack of development and support. This project has been forked and moved to github.com so that many more people can actually contribute with more ease.

Use the issue tracker here on github.com, to post about problems and feature requests.

Please feel free to fork and get back to us with fork requests for optimizations and new features.

Documentation & Usage Information

Using the php-utf8 library is quite easy. Just include the php-utf8.php and any additional functions that you may need from the functions folder.

Sample Code:

// get the core functions included ...
require('php-utf8_path/php-utf8.php');

// ... and any other functions/*.php or utils/*.php files you may need.
require('php-utf8_path/functions/trim.php');

Make sure that you are confident about using the library by reading Character Sets / Character Encoding Issues and Handling UTF-8 with PHP.

Use these functions only if you really need them & you understand why you need to use them.

In particular, do not blindly replace all use of PHP's string functions which functions found here. Most of the time you will not need to, and you will be introducing a significant performance overhead to your application.

Most of the functions here are not operating defensively, mainly for performance reasons. For example there is no extensive parameter checking and it is assumed that they are fed with well formed UTF-8. This is particularly relevant when is comes to catching badly formed UTF-8. You should screen input on the outer perimeter with help from functions in the utils/validation.php and utils/bad.php files.

Throughout the library all ASCII characters (control characters included) are treated as valid throughout the library. Make sure you take the appropriate measures before outputting into XML since it can become ill-formed with some control characters. more info

Licensing

The initial code of PHP-UTF8 is published under LGPL. Please find a copy of the license in the LICENSE file.

Parts of the code in this library come from other places, under different licenses. The authors involved have been contacted (see below). Attribution for which code came from elsewhere can be found in the source code itself.

  • Andreas Gohr / Chris Smith of Dokuwiki. There is a fair degree of collaboration/exchange of ideas and code between Dokuwiki's UTF-8 library and phputf8. Although Dokuwiki is released under GPL, its UTF-8 library is released under LGPL, hence no conflict with phputf8
  • Henri Sivonen (site) has also given permission for his code to be released under the terms of the LGPL. He ported a Unicode / UTF-8 converter from the Mozilla codebase to PHP, which is re-used in php-utf8.

php-utf8's People

Contributors

franzliedke avatar fsx avatar petsagouris avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.