Home > documentation, Vim > UTF-8 and byte order mark

UTF-8 and byte order mark

Problem

You have a text file with non-ASCII characters that you want to view within a web browser. But the browser jumbles up all those character accents, etc. How do you fix this?

Solution

With Vim, you can use bomb. But I just use Bash to prepend a text file with the relevant hex characters:

$ echo -n -e "\0357\0273\0277" | cat - myfile.txt > /tmp/myfile.tmp && mv /tmp/myfile.tmp myfile.txt

I wish it could be as easy and dramatic as letting the Bomberman take care of the above problem 🙂

Advertisements
Categories: documentation, Vim Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: