better unicode detection