While working with Unicode text, it is often required to get the Unicode code points of text for debugging. Using python, it is very easy to get the unicode codepoints of the text. Following examples illustrates it.

<br /> >>> "സന്തോഷ്".decode("utf-8")<br /> u'\u0d38\u0d28\u0d4d\u0d24\u0d4b\u0d37\u0d4d'<br />


<br /> >>> str=u"സന്തോഷ്"<br /> >>> print repr(str)<br /> u'\u0d38\u0d28\u0d4d\u0d24\u0d4b\u0d37\u0d4d'<br />

Well, But we need to take python console and type/paste the text etc..How can we make it more easy? What if pressing F12 key after selecting some text gives the codepoints?

So I wrote a plugin for gedit. I never knew that writing a gedit plugin is too easy. This tutorial gives all the required information.

Download the plugin file and python module and place it in .gnome2/gedit/plugins folder inside your home folder. And restart gedit. Enable the plugin from Edit->Preferences->Plugins menu. Note that you need to enable the External tools plugin too.

Select some text and press F12. If text is not selected, entire content of the document will be used.