如何在json编码期间保留特殊字符

$listing_description = "Suitable for working meals and family nights out, Palmers – which is located on Roman Road, has earned an enviable reputation with local food-lovers".

after iconv('UTF-8', 'ISO-8859-1//IGNORE',$listing_description) doing this during json encode the dash is replaced by space.

output

Suitable for working meals and family nights out, Palmers which is located on Roman Road, has earned an enviable reputation with local food-lovers.

ISO-8859-1 doesn't have a mdash sign so it seems to be impossible to keep it under this encoding

you can change all mdashes to some character that iso-8859-1 has using for example str_replace

Before using iconv you should add

    $listing_description = str_replace("–", html_entity_decode("—"), $listing_description );