I\'m in the process of making my PHP site Unicode-aware. I\'m wondering if anyone has experience with the mbstring.func_overload
setting, which replaces the nor
one issue you should definitely watch for is 3rd party scripts (perhaps a library or pear extension) which uses non mb-aware versions of functions. for example, libraries that use strlen()
could cause issues if you overload it.
as well, this bug report shows that the virtual host bleeding of mb_overloaded functions have been corrected in 5.2/5.3 CVS versions. the bug is specific to per-directory configurations.
My answer is: definitely not!
The problem is that there is no easy way to "reset" str* functions once they are overloaded.
For some time this can work well with your project, but almost surely you will run into an external library that uses string functions to, for example, implement a binary protocol, and they will fail. They will fail and you will spend hours trying to find out why they are failing.
After you have found that it's mbstring.func_overload
, you don't have too much option. You can ini_set the mbstring.internal_encoding
to some one-byte-per-char encoding every time you call the external library and set it back right after, but if your library makes callbacks to your application, it will just mess up things.
Another option is to tweak the library manually, changing all str* functions to their mb_string counterpart and passing a one-byte-per-char as encoding parameter. This, however, isn't a great idea either, because you lose the ability to easily update your external, and you might cause some performance issues as well.
So, again, don't use func_overload
. If you work with multi-byte strings, use the appropriate mb_ functions.