         if u.error == 1 {
             throw URIError.invalidURI
         }
-        
+
         if u.field_set & 1 != 0 {
             let string = URI.getSubstring(string, start: u.scheme_start, end: u.scheme_end)
             scheme = try String(percentEncoded: string)

        if let fragment = fragment {
            string += "#\(fragment)"
        }
        
        return string
    }
}

            string += "?"
        }

        for (offset: queryIndex, element: key) in query.keys.sorted().enumerated() {
            for (offset: valueIndex, element: value) in query[key]!.enumerated() {
                string += "\(key)"

                if var value = try value?.percentEncoded() {
