add protable support,; fix console encodings