First, convert the text to UTF-8:
iconv('CP1256', 'UTF-8', $it->getSubPathName());
Then, make sure the web browser decodes the page correctly as UTF-8. Put this as the top of your PHP file:
<?php
header("Content-Type: text/html; charset=UTF-8");
source
share