Pesky multibyte characters

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.

2 Replies to “Pesky multibyte characters”

  1. 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

Comments are closed.

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.