     
     func compileWithReturn() -> Int32
     {
-        let line = NSString(CString: lua_tolstring(self.L, -1, nil), encoding: NSASCIIStringEncoding)
+        let line = NSString(cString: lua_tolstring(self.L, -1, nil), encoding: String.Encoding.ascii.rawValue)
         if let lline = line {
             if !lline.hasPrefix("return ") {
                 let newInput = NSString(format: "return %@", lline)
-                lua_pushstring(self.L, newInput.cStringUsingEncoding(NSASCIIStringEncoding))
+                lua_pushstring(self.L, newInput.cString(using: String.Encoding.ascii.rawValue))
             }
         }
  

    
    
    
    private func processLine(var script: String)
    {
        let n = lua_gettop(self.L)
        
        script = script.stringByTrimmingCharactersInSet(RETURN_CHARSET)
        
        // legacy handling from Lua 5.2
        if n == 0 && script.hasPrefix("=") {
            let afterEqualsIndex = script.startIndex.successor()
            script = "return " + script.substringFromIndex(afterEqualsIndex)
        }
        lua_pushstring(self.L, script.cStringUsingEncoding(NSASCIIStringEncoding)!)
        
        // If we already have the start of a Lua command, combine our new
        // input with what was leftover.

    {
        var status = compile()
        if status != LUA_OK {
            if incomplete(status: status) {
                status = LUA_ERRINCOMPLETE
            }
        }
