std::iscntrl is somehow broken. Switch to manual check.