fix support for UCS-2