Changed from substr to mb_substr to fix unicode issues

This should probably be done all over the place...