Hi All,
I am try to parse an XML file.
The file contains place name that have accents. Such as “Mazarrón”
I am using the following to encode it:
htmlspecialchars($property_description_en, ENT_COMPAT, ‘UTF-8’);
however that is chaning “Mazarrón” to “Mazarrón”
What code should I be using?
code follows:
foreach($xml->property as $property)
{
$property_kyero_id = $property->id;
$property_date_modified = $property->date;
$property_agent_ref = $property->ref;
$property_price = $property->price;
$property_price_frequency = $property->price_freq;
$property_part_ownership = $property->part_ownership;
$property_leasehold = $property->leasehold;
$property_type = $property->type->en;
$property_location_id = $property->location_id;
$property_town = $property->town;
$property_province = $property->province;
$property_location_detail = $property->location_detail;
$property_beds = $property->beds;
$property_baths = $property->baths;
$property_pool = $property->pool;
$property_description_en = $property->desc->en;
$property_description_en = htmlspecialchars($property_description_en, ENT_COMPAT, 'UTF-8');
$property_description_es = $property->desc->es;
$property_description_es = htmlspecialchars($property_description_es, ENT_COMPAT, 'UTF-8');
$property_description_de = $property->desc->de;
$property_description_de = htmlspecialchars($property_description_de, ENT_COMPAT, 'UTF-8');
$property_description_nl = $property->desc->nl;
$property_description_nl = htmlspecialchars($property_description_nl, ENT_COMPAT, 'UTF-8');
$property_description_fr = $property->desc->fr;
$property_description_fr = htmlspecialchars($property_description_fr, ENT_COMPAT, 'UTF-8');
$property_description_da = $property->desc->da;
$property_description_da = htmlspecialchars($property_description_da, ENT_COMPAT, 'UTF-8');
$property_description_ru = $property->desc->ru;
$property_description_ru = htmlspecialchars($property_description_ru, ENT_COMPAT, 'UTF-8');
$property_description_de = $property->desc->de;
$property_description_de = htmlspecialchars($property_description_de, ENT_COMPAT, 'UTF-8');
$property_description_it = $property->desc->it;
$property_description_it = htmlspecialchars($property_description_it, ENT_COMPAT, 'UTF-8');
$property_description_pt = $property->desc->pt;
$property_description_pt = htmlspecialchars($property_description_pt, ENT_COMPAT, 'UTF-8');