change encoding method