Use mb_strtolower to prevent issues with unicode chars

Fixes #6525