How to prevent CKEditor from replacing spaces with &nbsp;? I'm using CKEditor 4.2 with D7 and the editor is replacing every space with an HTML non-breaking space. For instance, if I type: This is a paragraph and then either save or view source, I'll get the following:

&lt;p&gt;This&amp;nbsp;is&amp;nbsp;a&amp;nbsp;paragraph.&lt;/p&gt;


I don't have any HTML correctors/prettifiers running as filters and I'm banging my head against the wall trying to figure out what's causing this.

Oh, I also have Convert all applicable characters to HTML entities. unchecked, so that's not it.

Has anyone seen this before? Any solutions out there?
I solve this with a text filter

/**
 * Implements hook_filter_info().
 */
function MYMODULE_filter_info() {
  $filters = array();

  $filters['kill_nbsp'] = array(
    'title' =&gt; t('Kill Non-Breaking Spaces'),
    'description' =&gt; t('Remove non-breaking spaces.'),
    'process callback' =&gt; '_MYMODULE_filters_kill_nbsp',
    'tips callback' =&gt; '_MYMODULE_filters_kill_nbsp_tips',
  );

  return $filters;
}

/**
 * Filter callbacks.
 */
function _MYMODULE_filters_kill_nbsp($text, $filter) {
  return preg_replace('/&amp;nbsp;/', ' ', $text);
}

/**
 * Filter tips.
 */
function _MYMODULE_filters_kill_nbsp_tips($filter, $format, $long = FALSE) {
  if (!$long) {
    // This string will be shown in the content add/edit form.
    return t('Don\'t use non-breaking spaces.  Ever.');
  }
  else {
    // And this one on the "Filter Tips" page.
    return t('Non-breaking spaces are evil and will be eradicated.');
  }
}


The code simply searches for non-breaking spaces and replaces them with normal spaces.

Stuff this in a custom module, and then assign the filter to the input formats that have WYSIWYG enabled.  This does assume that you never want actual non-breaking spaces in your output, which is good for my sites.