refactor wide-char scanf string handling