Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (8)

View Page History
h2. Introduction

This document describes a request for a string helper class within Zend Framework. The reason I am writing this RFC is that I believe working with strings of different and/or multi-byte character sets in PHP isn't as simple as the build-in string functions supported by PHP.
This document describes a request for a string helper class within Zend Framework.

Wrote this RFC based on believing working with strings of different and/or multi-byte character sets in PHP isn't that simple as the build-in string functions supported by PHP.
The reason I am writing this RFC is that I believe working with strings of different and/or multi-byte character sets in PHP isn't as simple as the build-in string functions supported by PHP.

h2. Currently used in Zend Framework

For now most often ext/iconv is used to work with character sets but sometimes it's not enough because of high availability of a component that should not hard require ext/iconv but ext/mbstring instead or because of some missing functionalities with ext/iconv like upper/lower case a string.
Until now ext/iconv is often used to work with character sets within Zend Framework. But sometimes it's not enough because it isn't installed everywhere. You shouldn't hard require ext/iconv.
There is another extension ext/mbstring that can be used, too. As Fallback build-in functions can be used to handle single byte character sets.

h2. What should the utility solve and contain.

The utility class (or set of classes) should contain methods to work with different character sets like strlen, substr etc. It should contain methods to identify character set byte lengths and it should to be as fast as possible because of high frequency method calls.

This should solve the hard requirement of ext/iconv by ext/mbstring so users can choose the favorite extension for working with different character sets.

If a single byte character set or one of the unicode charsets is the only required required a user don't need an PHP extension to work with it (but it's recommended) by falling back to a wrapper for native PHP functions that can handle unicode byte sequences. So the components can be used without an error. Again that's not the recommended and not the most important feature.

h2. Where should the class live in?