trim unprintable characters