static String removeNonPrintableChars(String input) { RegExp exp = RegExp(r'[^\x20-\x7E]'); return input.replaceAll(exp, ''); }