This function reads (document.doc) files.. But it turns arabic characters into english characters

I want to make it read arabic characters , Or remove it at least.

PHP Code:
function word($filename){
    
    
    if((
$fh fopen($filename'r')) !== false ) {
        
       
$headers fread($fh0xA00);
       
$n1 = ( ord($headers[0x21C]) - );
       
$n2 = ( ( ord($headers[0x21D]) - ) * 256 );
       
$n3 = ( ( ord($headers[0x21E]) * 256 ) * 256 );
       
$n4 = ( ( ( ord($headers[0x21F]) * 256 ) * 256 ) * 256 );
       
$textLength = ($n1 $n2 $n3 $n4);
       if(
$extracted_plaintext = @fread($fh$textLength)){

       }else{
            return 
docx2text($filename); // Save this contents to file
       
}
       
        
$text=str_replace(  chr(13) , "\n"$extracted_plaintext);

        echo 
$text;
    }
    
    
}

word('filename.doc');