Sometimes when creating one-liners, when the source is not “clean”, you may end up with non-ascii characters which make the parsing harder.
To get rid of all of it, you can use perl.
cat dirty-source.txt|perl -pe 's/[^[:ascii:]]//g' > clean-output.txt
The same command can be used on a file[……]