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.

0

1 Answer 1

5

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)?

Sign up to request clarification or add additional context in comments.

3 Comments

Weird, what's with this question being asked each year late in October?
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.
Anything that uses binary data in strings will get into trouble if you enable mbstring.func_overload.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.