...

View Full Version : dir() and reading directory with ut8 (special) character



matak
10-30-2007, 11:37 AM
hy guys. this is hard one :)

i'm using dir to read directories form folder. problem is that one of the directories i created under windows is called "početna" (start page).

now when i read dir where "početna" is located with this code


<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<?php
//žčćšđ
$pages_dir = "stranice";

$d = dir($pages_dir);

//echo "Handle: " . $d->handle . "\n";

//echo "Path: " . $d->path . "\n";

while (false !== ($entry = $d->read())) {
echo utf8_encode($entry)."\n";
}
$d->close();
?>

firefox echoes

. .. početna

i tried to google for solution, and failed. if anyone had similar problems, and solved it please help.. it's quite complex problem i think..:confused:

now, i'll try to create directory directly with php and then read it, maybe that will solve the problem.

tnx in advance

OK, if i create directory with mkdir() in PHP, director is ANSCII (i think it's ANSCII) created, and has strange chars when i look at it under windows. Going to test it under linux.

After edit:

Well problem is now that i need that directory to be a Link, and http protocol is not so friendly for utf8 special characters. Hmmm...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum