fix build and unicode issues