Posts Tagged ‘utf-8’

How-to find the Unicode value for a character in Vim

August 26th, 2009

I was looking for a way to easily find an Unicode value for a character in Vim.

The solution is actually quite trivial, move the cursor on a char and write ‘g8′ you should see the UTF-8 value for this char.

For example with a left curly bracket ‘{‘ Vim displays ’7b’ which results in U+007B.

It is also possible to use ‘ga’ to get the decimal, hexadecimal and octal value of a string.

How to find the unicode value of a character ?

Unicode characters are commonly referred to using a notation like U+nnnn where nnnn is a four-digit hexadecimal (base 16) number specifying the code position of the character in Unicode. For example, the space character has the same code number in Unicode as in ISO 8859-1, namely 32 decimal, 20 hexadecimal; thus, it can be denoted as U+0020. Generally, a notation like U+nnnn is needed for referring to characters uniquely in contexts where one cannot reliably present the character itself.

Source : http://www.cs.tut.fi/~jkorpela/latin1/all.html

Useful links

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)