cherry-pick add unicode support from kghost