Special non-utf-8 characters appearing in feed imported from a windows based system? I have a custom feed importer that import content from an external feed. The import happens on cron and everything is working fine except that the content comes with special non-utf-8 characters. I looked on stackoverflow and there are a few suggestions about how to do this in code, I tried couple and it has not worked for me yet. I am hoping to see if there is a drupal way of handling it.
The character that I am having problem with is Â. It represent a space I believe and it only appear at end/and beginning of sentences.
You can use the Feeds Tamper module to do this with a custom plugin.

In your module:

/**
 * Implements hook_ctools_plugin_directory().
 */
function MYMODULE_ctools_plugin_directory($owner, $plugin_type){
  if ($owner == 'feeds_tamper' &amp;&amp; $plugin_type == 'plugins') {
    return 'plugins';
  }
}


and in your module/plugins/utf8_encode.inc

$plugin = array(
  'form' =&gt; 'MYMODULE_utf8_encode_form',
  'callback' =&gt; 'MYMODULE_utf8_encode_callback',
  'name' =&gt; 'Convert ISO-8859-1 to UTF-8',
  'multi' =&gt; 'loop',
  'category' =&gt; 'Text',
);

function MYMODULE_utf8_encode_form($importer, $element_key, $settings) {
  $form = array();
  $form['html'] = array(
    '#markup' =&gt; t('This will convert all ISO-8859-1 characters to their UTF-8 equivalents.'
),
  );
  return $form;
}

function MYMODULE_utf8_encode_callback($result, $item_key, $element_key, &amp;$field, $settings, $source) {
  $field = utf8_encode($field);
}


If that doesn't work, then you can use one of the strip-non-UTF8 regex functions to do it in the callback instead.  I use 

$regex = '/((?:[\x00-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}[\xF0-\xF7][\x80-\xBF]{3}){1,100})|./x';

preg_replace($regex, '$1', $field);