Feature Request #2104

Remove the utf8 class and use mb_* functions instead

Added by Isaiah DeRose-Wilson almost 5 years ago. Updated almost 5 years ago.

Status:ClosedStart date:09/12/2009
Priority:HighDue date:
Assignee:Isaiah DeRose-Wilson% Done:

0%

Category:Core
Target version:2.4
Resolution:fixed Points:

Description

We should just require the mbstring extension, and delete the utf8 class. utf8::clean() is still handy and should be moved to the input library.

Associated revisions

Revision 4620
Added by Isaiah DeRose-Wilson almost 5 years ago

Removed utf8 class and related utf8 files. Some of the old utf8 functions can now be found in the new utf8 helper. Moved utf8::clean() into the input library. mbstring is now required. Refs #2104

Revision 4622
Added by Isaiah DeRose-Wilson almost 5 years ago

Added phputf8 copyright details to functions moved into the text helper. Refs #2104

Revision 4623
Added by Isaiah DeRose-Wilson almost 5 years ago

Removed PCRE_UNICODE_PROPERTIES constant, install.php already checks for it (and it's required). Cleaned up new utf8 helper. Still need to write some unit tests to make sure the functions still work! Refs #2104

History

#1 Updated by Isaiah DeRose-Wilson almost 5 years ago

  • Priority changed from Urgent to High

#2 Updated by Isaiah DeRose-Wilson almost 5 years ago

There are a few (ok more than a few) functions in the utf8 class that don't have mb_* equivalents. Maybe a utf8 helper would be a good idea?

utf8::clean() -> move to input library because it can clean for any charset
utf8::is_ascii() -> move to string helper?
utf8::strip_ascii_ctrl -> move to string helper?
utf8::strip_non_ascii() -> move to string helper?
utf8::transliterate_to_ascii() -> Do we need it?
utf8::substr_replace() -> Do we need it?
utf8::ucfirst() -> arg.... why aren't there mb_* versions of these functions?
utf8::strcasecmp()
utf8::str_ireplace()
utf8::stristr()
utf8::strspn()
utf8::strcspn()
utf8::str_pad()
utf8::str_split()
utf8::strrev()
utf8::strrev()
utf8::trim()
utf8::ltrim()
utf8::rtrim()
utf8::ord()
utf8::to_unicode()
utf8::from_unicode()

#3 Updated by Isaiah DeRose-Wilson almost 5 years ago

  • Status changed from New to Closed
  • Resolution set to fixed

Still need to write unit tests to make sure all the utf::* functions are still working correctly, but I will open another issue for that.

Also available in: Atom PDF