commit e06112326d2c09cb5d803f3b494d194e7ac8c697
Author: Yannick ROGER <yannick.roger@ez.no>
Date:   Wed Aug 7 15:27:05 2013 +0200

    Fix EZP-21336: In IE8, every publish adds another empty paragraph at the end
    
    Custom patch for EE 5.0 and 5.1

diff --git a/ezpublish_legacy/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php b/ezpublish_legacy/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php
index b16394c..662c76f 100644
--- a/ezpublish_legacy/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php
+++ b/ezpublish_legacy/extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php
@@ -586,11 +586,20 @@ class eZOEXMLInput extends eZXMLInputHandler
             if ( $lastChild && $lastChild->nodeName === 'paragraph' )
             {
                 $textChild = $lastChild->lastChild;
-                // $textChild->textContent == "??" : string(2) whitespace in Opera
-                if ( !$textChild ||
-                     ( $lastChild->childNodes->length == 1 &&
-                       $textChild->nodeType == XML_TEXT_NODE &&
-                       ( $textChild->textContent == "??" || $textChild->textContent == ' ' || $textChild->textContent == '' || $textChild->textContent == '&nbsp;' ) ) )
+                if (
+                    !$textChild ||
+                    (
+                        $lastChild->childNodes->length == 1 &&
+                        $textChild->nodeType == XML_TEXT_NODE &&
+                        (
+                            $textChild->textContent == " " || // that's a non breaking space (Opera)
+                            $textChild->textContent == ' ' ||
+                            $textChild->textContent == '' ||
+                            $textChild->textContent == '&nbsp;' ||
+                            $textChild->textContent == "\xC2\xA0" // utf8 non breaking space
+                        )
+                    )
+                )
                 {
                     $parent->removeChild( $lastChild );
                 }
