And for "and switch the non-MB line functions to new mb functions" part of the question: you might be interested in http://php.net/mbstring.overload :
mbstring supports a function overload function that allows you to add multi-ticket information to such an application without modifying the code, overloading multi-byte copies of standard string functions. For example, mb_substr () is called instead of substr () if the overload function is enabled. This feature simplifies porting applications that support single-byte encodings in a multi-byte environment in many cases.
source share