in reply to Re: RFC: How to unaccent text?
in thread RFC: How to unaccent text?
Looking at Text::StripAccents source code, it seems quite inefficient: it splits the string in chars, loops over them replacing accented ones by their ASCII equivalent and then joins the string again.Ouch. That sounds to me like it could be improved, and probably without changing the API. So, it could be better in a next version... (if somebody lends the author a hand. It could be you.)
It's so simple that it makes me think if a module is actually required...What about the datatable... Are you going to construct it by hand, every time? Or will you be using copy-and-paste?
Make it a module, it's the perfect place for it.
p.s. I suppose tr/// would be a lot more efficient than s///, at least for single character replacements. You might benchmark it, to compare.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: RFC: How to unaccent text?
by salva (Canon) on Apr 11, 2007 at 10:55 UTC |