Correction for PHP versions without MB support

Hasn't been tested for regressions on a system with MB support but should work fine (to be tested before accepting @jsicot if you have time !)