html - How to deal with foreign characters while scanning files using php? -
i made script locating , displaying music in music folder (/musicdir/). i've got of worked out, still struggle when songs have weird characters.
script: http://pastebin.com/usklnnuz
specific file has problem, goes name:
clint mansell – lux aeterna(adЕПТ проd dnb remix)2012 (promodj.com).mp3
after script finished, spits out this:
clint mansell � lux aeterna(ad??? ???d dnb remix)2012 (promodj.com).mp3
have tried setting can utf-8, solved nothing. need use scandir in special way include weird letters? remember had same problem æ ø , å, when including filenames containing characters in php, on website designed.
there way make sure characters go through way , don't obscured?
edit:
have got æøå working ramraider, russian characters turning questionmarks still problem.
i faced similar issue and, you, tried various methods display nicely , ended using iconv. try following see if meets needs.
$value='clint mansell – lux aeterna(adЕПТ проd dnb remix)2012 (promodj.com).mp3'; echo iconv( mb_detect_encoding( $value ), 'ascii//ignore', $value );
Comments
Post a Comment