Hi phpBB team,
I opened a pull request on github at https://github.com/phpbb/phpbb/pull/1880
This pull request is an open invitation to use patchwork/utf8 as phpBB's fallback UTF-8 handling implementation.
See https://github.com/nicolas-grekas/Patchwork-UTF8
As a quick introduction, patchwork/utf8 is both a portability layer for mbstring, iconv, and intl Normalizer and grapheme_* functions, and an UTF-8 grapheme clusters aware replica of native string functions.
It is included in Laravel4 and ownCloud, and as such, it tops more than 400k installs on packagist and a dedicated package in debian. It is well unit tested.
By using directly intl's Normalizer and mbstring in phpBB, and delegating portability to patchwork/utf8, you could gain a lot of code cleanups and simplification. The patch attached shows what is already and quickly possible. That would mean less code to maintain on your side, and more collaboration between projects, as fixes for Laravel4/ownCloud/phpBB/etc. would benefit the community as a whole.
I'm an old user of phpBB and learned a lot of PHP reading your code. patchwork/utf8 also takes some inspiration in what you did. I would be very happy to contribute back, and that's why I'm doing this also.
If you consider this request, I believe that more features of patchwork/utf8 could be used in phpBB, and reciprocally that some problems you address in phpBB could migrate to patchwork/utf8 (e.g. confusable handling).
Waiting for your opinion on that,
With best regards,
Nicolas
[RFC] Rely on Intl and mbstring, use patchwork/utf8 as fallback
- EXreaction
- Registered User
- Posts: 1555
- Joined: Sat Sep 10, 2005 2:15 am
Re: [RFC] Rely on Intl and mbstring, use patchwork/utf8 as fallback
Would really be fantastic to use this rather than our own mess of code to maintain.
Does anything behave differently before the patch than it does with this patch applied?
Does anything behave differently before the patch than it does with this patch applied?
Re: [RFC] Rely on Intl and mbstring, use patchwork/utf8 as fallback
Thank you for your reply.
I tried to make the current patch as conservative as possible. So, I don't expect any change in behavior.
if you accept the pull request, more cleanups could be done later, but this one was an easy and safe patch
I tried to make the current patch as conservative as possible. So, I don't expect any change in behavior.
if you accept the pull request, more cleanups could be done later, but this one was an easy and safe patch
Re: [RFC] Rely on Intl and mbstring, use patchwork/utf8 as fallback
Intl is already a requirement for Symfony2 so integrating this in phpbb3.1 should be a logical step. however, intl and ICU is frequently not a part of the php stack so you have to add it yourself, which is not evident. i had to patch my mamp install to add those extensions.