         func substringFromIndex( index: Int ) -> String {
             var out = self
             withCString { (bytes) in
-                out = String.fromCString( bytes+index )!
+                out = String(cString: bytes+index )!
             }
             return out
         }

                }
            }

            return String.fromCString( arr )
        }

        func stringByAddingPercentEscapesUsingEncoding( encoding: UInt ) -> String? {

                    while true {
                        let start = strstr( bytes, sbytes ) - UnsafeMutablePointer<Int8>( bytes )
                        if start < 0 {
                            out.append( String(cString: bytes )! )
                            break
                        }
                        bytes[start] = 0
                        out.append( String(cString: bytes )! )
                        bytes += start + Int(strlen( sbytes ))
                    }
                }
