Yeah, weird eh? Right now I'm just doing it by hand like below, but I was
hoping for something a bit more robust, maybe flagging invalid unicode
values or something... I just think I must be missing something in the
framework...

Oh well, thanks for looking in any case,
Robin


string s = @"\u0497";
if(s[1] == ('u') || s[1] == ('U'))
{
    int len = s.Length / 2 - 1;
    byte[] bts = new Byte[len];
    for(int i = 0; i < len; i++)
    {
         string hexNums = s.Substring(i * 2 + 2, 2);
         bts[len - i - 1] =  (byte)int.Parse(hexNums,
NumberStyles.AllowHexSpecifier );
    }
    UnicodeEncoding ue = new UnicodeEncoding();
    char[] cs = ue.GetChars(bts);
    char c = cs[0];
}

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to