title: punycode and .рф cyrillic domain redirect
body: <p>I have a website with cyrillic domain name. There is an authorization lib which redirects the user to login page, but the url is somehow missformed.</p>
  
  <p>The website is on CodeIgniter and the redirect function used is the standard redirect function of 
  the codeigniter. I have modified a bit 
  and it looks now like this</p>
  
  <pre><code>function redirect($uri = '', $method = 'location', $http_response_code = 302)
  {
      if ( ! preg_match('#^https?://#ui', $uri))
      {
          $uri = site_url($uri);
      }
  
  
      //exit(idn_to_ascii($uri));
      switch($method)
      {
          case 'refresh'  : header("Refresh:0;url=http://".idn_to_ascii($uri));
              break;
          default         : header("Location:http://".idn_to_ascii($uri), TRUE, $http_response_code);
              break;
      }
      exit;
  }
  </code></pre>
  
  <p>idn_to_ascii functions seems not rightly coding the UTF url string ...</p>
  
  <p>Can anybody hint a solution? </p>
  
  <p>Instead of </p>
  
  <pre><code>http://xn-------63dat7alb0aizbbjcoujt7j3a6e.xn--p1ai/auth/admin/
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>xn-------63dat7alb0aizbbjcoujt7j3a6e.xn--/auth/login-foj4c
  </code></pre>
  
  <p>Any ideas ?</p>