[PEPr] Comment on Internationalization::I18N_Unicode
| From: | PEPr | Date: | Tue, 03 Aug 2004 14:27:05 +0000 |
| Subject: | [PEPr] Comment on Internationalization::I18N_Unicode | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-32393@lists.php.net to get a copy of this message | ||
Michael Wallner (http://pear.php.net/user/mike) has commented on the proposal for
Internationalization::I18N_Unicode.
Comment:
While I hope that PHP 5.1/5.2 ships with ext/i18n (or whatever it'll be called) it currently
lacks *a lot* of I18N support, so this might be a valuable class.
I'll let the others comment on CS...
What about a equals(&$I18N_Unicode) method? Doing an return !array_diff($this->_unicode,
$I18N_Unicode->_unicode); should be better than $u1->toUtf8String() == $u2->toUtf8String().
You should consider using a switch(strToUpper($encoding)) in setString() rather than using loads of
if(strtoupper()).
setString() doesn't complain if the encoding isn't recognized.
You load PEAR.php for error handling, but there's no evidence you do so.
What about some more methods like lastIndexOf(), subStringReplace(), (toUpper(), toLower() - these
might be evil)?
I18N_UnicodeString might be a better name.
Cheers
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=131
--
Sent by PEPr, the automatic proposal system at http://pear.php.net