php 5.4ten itibaren varsayılan karakter kodlaması utf-8 oldu.. büyük ihtimalle yaşadığınız sorun bu yüzden.
Alıntı
encoding
Defines encoding used in conversion. If omitted, the default value for this argument is ISO-8859-1 in versions of PHP prior to 5.4.0, and UTF-8 from PHP 5.4.0 onwards.
htmlspecialchars($string, ENT_QUOTES, ISO-8859-1); şeklinde kullanırsanız sorun muhtemelen çözülecektir.