support non-UTF8 mouse coordinates