title: How to use special character in NSURL?
body: <p>My application is using an NSURL like this:</p>
  
  <pre><code>var url = NSURL(string: "http://www.geonames.org/search.html?q=Aïn+Béïda+Algeria&amp;country=")
  </code></pre>
  
  <p>When I tried to make a task for getting data from this NSURL like this:</p>
  
  <pre><code>    let task = NSURLSession.sharedSession().dataTaskWithURL(url!, completionHandler: { (data: NSData!, response: NSURLResponse!, error: NSError!) -&gt; Void in
  
          if error == nil {
  
              var urlContent = NSString(data: data, encoding: NSUTF8StringEncoding)
              println("urlContent \(urlContent!)")
          } else {
  
              println("error mode")
          }
  </code></pre>
  
  <p>but I got error when trying to got data from that address, although when I using safari  go to link: "<a href="http://www.geonames.org/search.html?q" rel="noreferrer">http://www.geonames.org/search.html?q</a>=Aïn+Béïda+Algeria&amp;country=" I can see the data. How can I fix that?</p>