anchor.diff:    let decodeURIComponent = 
       decodeURI
   
  +  let private encodeUTF8 (v:int) : byte[] =
  +    if v < 0x0080 then
  +      let octetA = (v>>>0  &&& 0x7F) ||| 0x00 |> byte
  +      [| octetA |]
  +    elif v < 0x0800 then
  +      let octetA = (v>>>6  &&& 0x1F) ||| 0xC0 |> byte
  +      let octetB = (v>>>0  &&& 0x3F) ||| 0x80 |> byte
  +      [| octetA; octetB |]
  +    elif v < 0x010000 then
  +      let octetA = (v>>>12 &&& 0x0F) ||| 0xE0 |> byte
  +      let octetB = (v>>>6  &&& 0x3F) ||| 0x80 |> byte
  +      let octetC = (v>>>0  &&& 0x3F) ||| 0x80 |> byte
  +      [| octetA; octetB; octetC |]
  +    elif v < 0x110000 then
  +      let octetA = (v>>>18 &&& 0x07) ||| 0xF0 |> byte
  +      let octetB = (v>>>12 &&& 0x3F) ||| 0x80 |> byte
  +      let octetC = (v>>>6  &&& 0x3F) ||| 0x80 |> byte
  +      let octetD = (v>>>0  &&& 0x3F) ||| 0x80 |> byte
  +      [| octetA; octetB; octetC; octetD |]
  +    else
  +      raise (new UriFormatException(String.Format("An attempt was made to encode an unknown character (0x{0:X}).", v)))
  +
  +  let private encode (s:string) (unescapedSet:string) : string =
  +    let strLen = s.Length
  +    let R = new System.Text.StringBuilder(strLen * 3 / 2)
  +    let mutable k = 0
  +    while k <> strLen do
  +      let C = s.[k]
  +      if unescapedSet.IndexOf(C) <> -1 then
  +        R.Append(C) |> ignore
  +      else
  +        let cChar = int C
  +        if cChar >= 0xDC00 && cChar <= 0xDFFF then raise (new UriFormatException(String.Format("An invalid character was detected at position {0} (0x{1:X4}).", k, cChar)))
  +        let V =
  +          if cChar < 0xD800 || cChar > 0xDBFF then
  +            cChar
  +          else
  +            k <- k + 1
  +            if k = strLen then raise (new UriFormatException("An incomplete URI string was detected."))
  +            let kChar = int s.[k]
  +            if kChar < 0xDC00 || kChar > 0xDFFF then raise (new UriFormatException(String.Format("An invalid character was detected at position {0} (0x{1:X4}).", k, kChar)))
  +            ((cChar - 0xD800) * 0x400 + (kChar - 0xDC00) + 0x10000)
  +        let Octets = encodeUTF8 V
  +        let L = Octets.Length
  +        let mutable j = 0
  +        while j < L do
  +          R.AppendFormat("%{0:X2}", Octets.[j]) |> ignore
  +          j <- j + 1
  +      k <- k + 1
  +    R.ToString()
  +
     ///
     let encodeURI (func:FO) (_:CO) (uri:BoxedValue) =
       match uri.Tag with
       | TypeTags.Undefined -> "" |> BV.Box
       | _ ->
         try
  -        let uri = uri |> TypeConverter.ToString |> Uri.EscapeDataString
  -        let uri = Array.fold replaceChar uri reservedEncoded
  -        let uri = Array.fold replaceChar uri reservedEncodedComponent
  -        uri.ToUpperInvariant() |> BV.Box
  +        let uriString = uri |> TC.ToString
  +        encode uriString unescapedURISet |> BV.Box
   
         with
           | :? UriFormatException as e -> 
  
positive.code:     | TypeTags.Undefined -> "" |> BV.Box
      | _ ->
        try
          let uri = uri |> TypeConverter.ToString |> Uri.EscapeDataString
          let uri = Array.fold replaceChar uri reservedEncodedComponent
          uri.ToUpperInvariant() |> BV.Box
  
        with
          | :? UriFormatException as e -> 
  
negative.code:   let private reservedEncoded = [|';'; ','; '/'; '?'; ':'; '@'; '&'; '='; '+'; '$'; '#'|]
    let private reservedEncodedComponent = [|'-'; '_'; '.'; '!'; '~'; '*'; '\''; '('; ')'; '['; ']'|]
  
    let private uriReserved = ";/?:@&=+$,"
    let private uriUnescaped = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.!~*'()"
    let private unescapedURISet = uriReserved + "#" + uriUnescaped
  
    ///
    let private replaceChar (uri:string) (c:char) =
      uri.Replace(Uri.EscapeDataString(string c), string c)
  