Convert char to UTF-16 unicode glyph index in C#

How is this done?

I am trying to integrate FontMapper in Unity because I want full control over my text mesh.

I have a font metrics array. Array indices correspond to glyph indices. All I need is to convert a given char to a glyph index so that I can retrieve the correct font metrics information. As far as I know, this:

int index = (int) ‘a’;

… is giving me the ASCII glyph index. But FontMapper is using UTF-16.

8-|
~ce

A good google search brought up this:

http://www.java2s.com/Code/CSharp/File-Stream/ConvertUTF8andASCIIencodedbytesbacktoUTF16encodedstring.htm

Thanks BigMisterB.

I made a major misunderstanding here. C# is natively UTF-16 which means that all I really needed to do was in fact:
int index = (int) ‘a’;

My error came from elsewhere.

Anyway. It works now.

~ce