fix utf8_encode/decode shim on edge case
fix mbstring shim on edge case