a copy from mozc for adding fcitx client support