Re: Hi everybody
| From: | Vianney Briois | Date: | Fri, 10 Apr 2015 13:23:33 +0000 |
| Subject: | Re: Hi everybody | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-12791@lists.php.net to get a copy of this message | ||
Hi again,
So, i check the transliterator class via the ICU pecl package. It works
well on almost every tests i ran.
It's quite powerful, but it is slower and does not exactly fulfill my needs..
I did check the pecl translit extension before doing mine, and it does not
work with the full range of characters i need. (And if you don't provide
all parameters, you can have a segfault...)
Finally, according to your comments, i removed useless declarations,
complied to C88/C90, enhanced the error reporting, and added licence header..
thx for your time!
Vianney
2015-04-10 2:18 GMT+02:00 Johannes Schlüter <johannes@schlueters.de>:
> Bonjour,
>
> On Thu, 2015-04-09 at 18:50 +0200, Vianney Briois wrote:
> > I was motivate to do my own extension because i'm working with php 5.3,
> > migrate to 5.4 or more is far beyond the scope right now, and i needed a
> > powerful way to clean strings which might contain japanese, chinese, or
> > other exotic characters. As you know, Transliteror in php is only
> available
> > for php >= 5.4.
>
> That class should be available via the ICU pecl package in older
> versions, too. Also 5.3 is out of support and you should update your
> system to benefit from (security) fixes and better performance. There is
> hardly any BC (see migration guide)
>
> There is also https://pecl.php.net/package/translit
>
> If that all isn'T possible a few comments:
>
> > So, you can review the source code here :
> >
> > - https://github.com/vianneyb/pecl_unidecode
>
> 1. You should add license headers to the codeto make the license choice
> explicit
> 2. data/mapping.c should be called .h as t is not supposed to be
> compiled itself. Did you write the file or is that from Python?
> (License?)
> 3. We're using C89/C90 which requires variable declarations on top of
> the block, see
>
>
> https://wiki.php.net/internals/review_comments#don_t_use_c99_for_portability_reasons
> 4. If the conversion by utf8_to_utf32() returns an error
> (unidecode.c:160) it should emmit an error.
> 5. there are useless declarations in the php_unidecode.h header, see
>
>
> https://wiki.php.net/internals/review_comments#php_extnameh_should_be_minimal
>
> I haven't checked the logic or whether offsets etc. are correct, but
> otherwise looks ok.
>
> johannes
>
>
>
--
BRIOIS Vianney