sed fails when working with UTF-8 locale and non-UTF symbols
I.e. when some file has a line with upper ASCII symbols:
* and L<E1>szl<F3> N<E9>meth (Hunspell). Portions created by the Initial Developers
and LANG is set to *.UTF8 running sed on that file results in:
+ /usr/bin/sed -i.bak -e 's|%%LOCALBASE%%|/usr/local|g' /tmp/ports/www/firefox/firefox-43.0.1/extensions/spellcheck/hunspell/glue/mozHunspell.cpp
sed: RE error: Illegal byte sequence
Unsetting lang makes sed silently accept the file.