Question

This question already has an answer here:

I want to conform my site's string handling to support other languages per UTF-8. It seems that the best way to do this is to forsake all the standard string functions.

So I have two options, I can set the mbstring.func_overload option in php.ini or I can go back over my code and just replace all the functions with mb_*. I would assume that the second option will be easier on people using my code as they won't have to change their sever config. (if they even can!)

What about when PHP 6 comes out? Should that have any baring on my choice since it will support proper multibyte processing.

Was it helpful?

Solution

I believe the argument against mbstring.func_overload is that if you use any 3rd party libraries/code whatsoever, that code may be relying on the "normal" functionality of the functions in question -- e.g., it may be calling substr() to truncate a string containing binary data at an exact byte boundary, or using strlen() to get length in bytes, rather than length in UTF-8 characters.

See also: Should I use multi-byte overloading (mbstring.func_overload)?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top