Switch encode