encode_string added