Fix detecting utf-8 on some networks