can you use rand_text here? Sounds like if badchars analysis is accure, you should be able to do it with rand_text.