A little tip picked up from Liam Foy Adrian Nida on #dragonflybsd on EFNet: If you have a 16-bit UTF file, cat
and less
will read it with ^@ characters all through the file. The pkgsrc package converters/recode
will allow cleanup like so:
cat file.utf16 | recode utf16..ascii > file.ascii
Update: Several people pointed out that iconv
can do the same thing.
Isn’t iconv installed by default? If so, that can be used instead of recode:
cat file.utf16 | iconv -f utf-16 -t ascii > file.ascii
Hey, Justin.
FYI. LabThug is me, not Liam :-P
Adrian