View Single Post
Old 01-08-2013, 07:56 AM   PM User | #1
fail
Regular Coder

 
Join Date: Dec 2009
Location: Hong Kong
Posts: 118
Thanks: 8
Thanked 0 Times in 0 Posts
fail is an unknown quantity at this point
Punycode converter not working on ONE page - why?

I have another strange problem. Since I work a lot with URLs


PHP Code:
include_once('idna_convert.class.php');
$IDN = new idna_convert();
   
$feeder = array("glühwein.dk","你好吗.com","madrid.com","zürich.eu","hallo.de");

foreach( 
$feeder as $key => $value )
{

echo 
$value."<br>";
$url $IDN->encode($value);

echo 
$url."<p>";

}

/*
Output:
glühwein.dk
xn--glhwein-o2a.dk

你好吗.com
xn--6qqu8ipsf.com

madrid.com
madrid.com

zürich.eu
xn--zrich-kva.eu

hallo.de
hallo.de
*/ 
The sample page outputs exactly as above. However, in my 'real' page it works perfectly only on not alphanumeric URLs (Chinese, Japanese) - but not on URLs with ü , ö etc. Could it be performance related?

Any clue why that is?

PS: I am on PHP 5.3.1

Last edited by fail; 01-08-2013 at 08:42 AM..
fail is offline   Reply With Quote