fixed build and charset issues