detect char signedness. fixes #2476