Fan.Sys.Uri.percentEncodeChar C# (CSharp) Method

percentEncodeChar() static private method

static private percentEncodeChar ( StringBuilder buf, int c ) : void
buf StringBuilder
c int
return void
        static void percentEncodeChar(StringBuilder buf, int c)
        {
            if (c <= 0x007F)
              {
            percentEncodeByte(buf, c);
              }
              else if (c > 0x07FF)
              {
            percentEncodeByte(buf, 0xE0 | ((c >> 12) & 0x0F));
            percentEncodeByte(buf, 0x80 | ((c >>  6) & 0x3F));
            percentEncodeByte(buf, 0x80 | ((c >>  0) & 0x3F));
              }
              else
              {
            percentEncodeByte(buf, 0xC0 | ((c >>  6) & 0x1F));
            percentEncodeByte(buf, 0x80 | ((c >>  0) & 0x3F));
              }
        }