2

CP1256 unicode table in php converts Persian character YEH (ی) to Arabic YEH (ي) with following code:

$str = iconv("CP1256", "UTF-8", $str);

I don't know if it has any other issues with other characters, any idea?

2 Answers 2

1

There is no such a thing as Persian YEH in CP1256. Read http://en.wikipedia.org/wiki/Windows-1256. This is an Arabic encoding for windows. The best way is to convert the ARABIC character to Persian after conversion.

1
  • Your suggested way won't work on strings those have both arabic and persian words.
    – user904550
    Oct 12, 2013 at 14:17
0

Try reporting it to PHP bug tracker.

1
  • Please explain, I don’t understand what you mean by Persian character YEH (ی) in the context of a string to be treated as CP1256 encoded. That encoding has no representation for ARABIC LETTER FARSI YEH (U+06CC). And if I test in the opposite direction, iconv("UTF-8", "CP1256", "testing ی character"), I get “testing ” and error indicator is set, i.e. iconv does not treat “ی” as representable in CP1256. Jan 14, 2012 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.