views:

209

answers:

1

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.

+1  A: 

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: http://stackoverflow.com/questions/222630/should-i-use-multi-byte-overloading-mbstring-funcoverload

Frank Farmer
Weird, what's with this question being asked each year late in October?
Xeoncross
It's a centuries-old tradition. That's how Halloween was started, you know. Santa asked the thanksgiving turkey, "Should I use mbstring.func_overload?". The rest is history.
Frank Farmer