static void copyvalidchars(char *text, char *rawtext);