The PHP XML parser does not handle windows-1252 encoding. This is basically the same as ISO-8869-1, but not quite (see here for differences). However, this patch will make it at least not throw an error. This is technically a PHP bug/FR, but this is a simple workaround that can be placed in the import.module in the import_refresh function.

// added by kwb 3/6/2004 - check if using windows-1252 - if so, convert into ISO-8859-1
// I realize windows-1252 and ISO-8859-1 are not exactly the same, but they are close enough
// see http://en.wikipedia.org/wiki/ISO_8859-1 for an explanation of the differences
if (strcasecmp($encoding, "windows-1252") == 0) {
   $encoding = "ISO-8859-1";
}

// parse the data:
$xml_parser = xml_parser_create($encoding);

Comments

Steven’s picture

Such a mechanism exists in Drupal 4.4, where iconv can be used (if support for it in PHP is present) to convert other encodings to UTF-8. Because Drupal has all its data in UTF-8, treating Windows-1252 as ISO-8859-1 would not be a good idea.