charcter encode