checked data for string before encoding