diff --git a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/AbstractTextElement.java b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/AbstractTextElement.java
index 83812a1c3cd2981c1f69a67693e34b0735f62e31..11fcdd88f9cfb65edf0014e9ba7911bbf211c681 100644
--- a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/AbstractTextElement.java
+++ b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/AbstractTextElement.java
@@ -33,6 +33,7 @@ import org.olat.core.gui.components.Component;
 import org.olat.core.gui.components.form.ValidationError;
 import org.olat.core.gui.components.form.flexible.elements.TextElement;
 import org.olat.core.gui.components.form.flexible.impl.FormItemImpl;
+import org.olat.core.util.StringHelper;
 import org.olat.core.util.ValidationStatus;
 import org.olat.core.util.ValidationStatusImpl;
 import org.olat.core.util.filter.Filter;
@@ -167,7 +168,7 @@ public abstract class AbstractTextElement extends FormItemImpl implements TextEl
 			}
 		}
 
-		this.value = value;//.replaceAll("\\p{Cc}", "");
+		this.value = StringHelper.cleanUTF8ForXml(value);
 		Component c = getComponent();
 		if (c != null) {
 			// c may be null since it is only created when this formelement is added to a FormItemContainer
diff --git a/src/main/java/org/olat/core/util/StringHelper.java b/src/main/java/org/olat/core/util/StringHelper.java
index f18fab5bcfe18d5d86407616d4b94c849aa13ffd..2e65edb4d67b4e862192be4bfafdf97ce02cc19e 100644
--- a/src/main/java/org/olat/core/util/StringHelper.java
+++ b/src/main/java/org/olat/core/util/StringHelper.java
@@ -421,6 +421,32 @@ public class StringHelper {
 		return true;
 	}
 	
+	public static String cleanUTF8ForXml(String string) {
+		if(string == null) return null;
+		if(string.length() == 0) return string;
+		
+		StringBuilder sb = new StringBuilder();
+		char[] charArr = string.toCharArray();
+		int numOfCharacters = charArr.length;
+		for(int i=0; i<numOfCharacters; i++) {
+			char ch = charArr[i];
+			if(ch < 32) {
+				switch(ch) {
+					case '\n': sb.append(ch); break;//0x000A
+					case '\t': sb.append(ch); break;//0x0009
+					case '\r': sb.append(ch); break;//0x000D
+				}
+			} else if(ch >= 0x0020 && ch <= 0xD7FF) {
+				sb.append(ch);
+			} else if(ch >= 0xE000 && ch <= 0xFFFD) {
+				sb.append(ch);
+			} else if(ch >= 0x10000 && ch <= 0x10FFFF) {
+				sb.append(ch);
+			}
+		}
+		return sb.toString();
+	}
+	
 	public static String replaceAllCaseInsensitive(String expression, String name, String replacement) {
 		if(!StringHelper.containsNonWhitespace(expression)) {
 			return expression;
diff --git a/src/test/java/org/olat/core/gui/components/form/flexible/impl/elements/AbstractTextElementTest.java b/src/test/java/org/olat/core/gui/components/form/flexible/impl/elements/AbstractTextElementTest.java
deleted file mode 100644
index 5b1557243ee59be5e61f78c98c8014237e52cc3e..0000000000000000000000000000000000000000
--- a/src/test/java/org/olat/core/gui/components/form/flexible/impl/elements/AbstractTextElementTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * <a href="http://www.openolat.org">
- * OpenOLAT - Online Learning and Training</a><br>
- * <p>
- * Licensed under the Apache License, Version 2.0 (the "License"); <br>
- * you may not use this file except in compliance with the License.<br>
- * You may obtain a copy of the License at the
- * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
- * <p>
- * Unless required by applicable law or agreed to in writing,<br>
- * software distributed under the License is distributed on an "AS IS" BASIS, <br>
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
- * See the License for the specific language governing permissions and <br>
- * limitations under the License.
- * <p>
- * Initial code contributed and copyrighted by<br>
- * frentix GmbH, http://www.frentix.com
- * <p>
- */
-package org.olat.core.gui.components.form.flexible.impl.elements;
-
-import junit.framework.Assert;
-
-import org.junit.Ignore;
-import org.junit.Test;
-import org.olat.core.gui.UserRequest;
-import org.olat.core.gui.components.Component;
-import org.olat.test.OlatTestCase;
-
-/**
- * 
- * Initial date: 11.12.2013<br>
- * @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
- *
- */
-public class AbstractTextElementTest extends OlatTestCase {
-	
-	@Test @Ignore
-	public void filterPrintControlCharacter() {
-		TestTextElement element = new TestTextElement("test");
-		element.setValue("Hello world");
-		Assert.assertEquals("Dummy test", "Hello world", element.getValue());
-		
-		//print control
-		element.setValue("Hello\u0002 world");
-		Assert.assertEquals("Print \\x02 test", "Hello world", element.getValue());
-
-		//print control
-		element.setValue("Hello\u001F world");
-		Assert.assertEquals("Print \\x02 like test", "Hello world", element.getValue());
-
-		//it's a 0
-		element.setValue("Hello\u0030 world");
-		Assert.assertEquals("Print \\x02 test", "Hello0 world", element.getValue());
-			
-		//it's a u umlaut
-		element.setValue("Hello\u00FC world");
-		Assert.assertEquals("Umlaut test", "Hello\u00FC world", element.getValue());
-					
-		//it's a kanji
-		element.setValue("Hello\u30b0 world");
-		Assert.assertEquals("Umlaut test", "Hello\u30b0 world", element.getValue());
-		
-		//it's a return
-		element.setValue("Hello\n world");
-		Assert.assertEquals("Umlaut test", "Hello\n world", element.getValue());
-		
-		//it's a unicode emoticons
-		element.setValue("Hello\u1F605 world");
-		Assert.assertEquals("Umlaut test", "Hello\u1F605 world", element.getValue());
-	}
-	
-	public static class TestTextElement extends AbstractTextElement {
-		
-		public TestTextElement(String name) {
-			super(name, name, false);
-		}
-
-		@Override
-		protected Component getFormItemComponent() {
-			return null;
-		}
-
-		@Override
-		public void evalFormRequest(UserRequest ureq) {
-			//
-		}
-		
-	}
-}
diff --git a/src/test/java/org/olat/core/util/StringHelperTest.java b/src/test/java/org/olat/core/util/StringHelperTest.java
index e53944ee3233bfcda291f0ca33f743ab59bfb39c..5e33de1258278900f0b00076935b3171f958582f 100644
--- a/src/test/java/org/olat/core/util/StringHelperTest.java
+++ b/src/test/java/org/olat/core/util/StringHelperTest.java
@@ -58,4 +58,54 @@ public class StringHelperTest {
 		Assert.assertEquals("Webclass_Energie_20042005", StringHelper.transformDisplayNameToFileSystemName("Webclass Energie 2004:2005"));
 		Assert.assertEquals("Webclaess", StringHelper.transformDisplayNameToFileSystemName("Webcl\u00E4ss"));
 	}
+	
+	@Test
+	public void filterPrintControlCharacter() {
+		String value1 = StringHelper.cleanUTF8ForXml("Hello world");
+		Assert.assertEquals("Dummy test", "Hello world", value1);
+		
+		//print control
+		String value2 = StringHelper.cleanUTF8ForXml("Hello\u0002 world");
+		Assert.assertEquals("Print \\x02 test", "Hello world", value2);
+
+		//print control
+		String value3 = StringHelper.cleanUTF8ForXml("Hello\u001F world");
+		Assert.assertEquals("Print \\x02 like test", "Hello world", value3);
+
+		//it's a 0
+		String value4 = StringHelper.cleanUTF8ForXml("Hello\u0030 world");
+		Assert.assertEquals("Zero test", "Hello0 world", value4);
+			
+		//it's a u umlaut
+		String value5 = StringHelper.cleanUTF8ForXml("Hello\u00FC world");
+		Assert.assertEquals("Umlaut test", "Hello\u00FC world", value5);
+					
+		//it's a kanji
+		String value6 = StringHelper.cleanUTF8ForXml("Hello\u30b0 world");
+		Assert.assertEquals("Kanji test", "Hello\u30b0 world", value6);
+		
+		//it's a return
+		String value7 = StringHelper.cleanUTF8ForXml("Hello\n world");
+		Assert.assertEquals("Return test", "Hello\n world", value7);
+		
+		//it's a tab
+		String value8 = StringHelper.cleanUTF8ForXml("Hello\t world");
+		Assert.assertEquals("Tab test", "Hello\t world", value8);
+		
+		//it's a carriage
+		String value9 = StringHelper.cleanUTF8ForXml("Hello\r world");
+		Assert.assertEquals("Carriage test", "Hello\r world", value9);
+		
+		//it's a unicode emoticons
+		String value10 = StringHelper.cleanUTF8ForXml("Hello\u1F605 world");
+		Assert.assertEquals("Emoticons test", "Hello\u1F605 world", value10);
+		
+		//it's phoenician \u1090x
+		String value11 = StringHelper.cleanUTF8ForXml("Hello\u1090x phoenician");
+		Assert.assertEquals("Phoenician test", "Hello\u1090x phoenician", value11);
+		
+		//it's pahlavi \u10B7x
+		String value12 = StringHelper.cleanUTF8ForXml("Hello\u10B7x pahlavi");
+		Assert.assertEquals("Pahlavi test", "Hello\u10B7x pahlavi", value12);
+	}
 }
diff --git a/src/test/java/org/olat/test/AllTestsJunit4.java b/src/test/java/org/olat/test/AllTestsJunit4.java
index 2f9ee40f499aa9b813e3f4fba328b276b6deb15d..7235870dcb111167c92d0d9a3a765b8787b4a0da 100644
--- a/src/test/java/org/olat/test/AllTestsJunit4.java
+++ b/src/test/java/org/olat/test/AllTestsJunit4.java
@@ -49,7 +49,6 @@ import org.junit.runners.Suite;
 	org.olat.core.gui.components.table.TableEventTest.class,
 	org.olat.core.gui.components.table.TableMultiSelectEventTest.class,
 	org.olat.core.gui.components.table.SorterTest.class,
-	org.olat.core.gui.components.form.flexible.impl.elements.AbstractTextElementTest.class,
 	org.olat.core.commons.chiefcontrollers.ChiefControllerMessageEventTest.class,
 	org.olat.core.util.vfs.VFSManagerTest.class,
 	org.olat.core.util.filter.impl.XSSFilterTest.class,