Use strcspn instead of strtok
Cleanup header includes.
Discard unprintable single width characters instead.