Adding encode for String and Binary