Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/znerol/stringprep

PHP implementation of RFC 3454 - Preparation of Internationalized Strings ("stringprep")
https://github.com/znerol/stringprep

Last synced: 3 months ago
JSON representation

PHP implementation of RFC 3454 - Preparation of Internationalized Strings ("stringprep")

Awesome Lists containing this project

README

        

PHP stringprep
==============

[![Build Status](https://travis-ci.org/znerol/Stringprep.svg?branch=master)](https://travis-ci.org/znerol/Stringprep)

**Please note that this project is not maintained. It was implemented on a
weekend and never used in production by the author. If you intend to use it,
then please fork it, fix it and then sumbit a pull request updating this
document to point to the proper project.**

This is a PHP implementation of RFC 3454 - Preparation of Internationalized
Strings ("stringprep").

See: http://tools.ietf.org/html/rfc3454

Requierements
-------------

* PHP >= 5.3
* PHP intl extension (http://ch1.php.net/manual/en/book.intl.php)
* PHP iconv extension (http://ch1.php.net/manual/en/book.iconv.php)

Example
-------

```php
apply("intérnätional-chars");
print("+ International characters allowed\n");
}
catch (ProfileException $e) {
print("! Ooops, international characters should be allowed in this profile\n");
}

try {
$result = $nameprep->apply("spaces are not allowed");
print("! Ooops, spaces should be prohibited in this profile\n");
}
catch (ProfileException $e) {
print("* Spaces prohibited\n");
}
```

License
-------

This software is released under the GNU Lesser General Public License, version 3.0 (LGPL-3.0)

Acknowledgment
--------------

Parts of GNU libidn have been reused in this project:
* http://www.gnu.org/software/libidn/