diff -u -ur TYPO3core/t3lib/class.t3lib_div.php TYPO3core.jsutf8/t3lib/class.t3lib_div.php
--- TYPO3core/t3lib/class.t3lib_div.php	2005-12-13 13:08:50.306518024 +0100
+++ TYPO3core.jsutf8/t3lib/class.t3lib_div.php	2005-12-13 13:32:17.224633960 +0100
@@ -3894,6 +3894,24 @@
 		}
 		return $paramsArr;
 	}
+
+
+	/**
+	 * Quotes a string for usage as JS parameter. Depends wheter the value is used in script tags (it doesn't need/must not get htmlspecialchared in this case)
+	 *
+	 * @param	string		The string to encode.
+	 * @param	boolean		If the values get's used in <script> tags.
+	 * @return	string	The encoded value already quoted
+	 */
+	function quoteJSvalue($value, $inScriptTags = false)	{
+		$value = addcslashes($value, '\''.chr(10).chr(13));
+		if (!$inScriptTags)	{
+			$value = htmlspecialchars($value);
+		}
+		return '\''.$value.'\'';
+	}
+
+
 }
 
 ?>
\ No newline at end of file
diff -u -ur TYPO3core/t3lib/jsfunc.menu.js TYPO3core.jsutf8/t3lib/jsfunc.menu.js
--- TYPO3core/t3lib/jsfunc.menu.js	2005-10-20 15:09:47.000000000 +0200
+++ TYPO3core.jsutf8/t3lib/jsfunc.menu.js	2005-12-13 13:15:56.486728784 +0100
@@ -52,7 +52,7 @@
 function JSmenuAddItem (parent,prevItem,openID,title,url,target) {
 	this.count++;
 	var entryID = this.count;
-	this.entry[entryID] = new JSmenuItem (this, entryID, 0, parent, openID, unescape(title), unescape(url), target);
+	this.entry[entryID] = new JSmenuItem (this, entryID, 0, parent, openID, title, url, target);
 	if (prevItem) {
 		this.entry[prevItem].nextItem = entryID;
 	} else if(parent) {
diff -u -ur TYPO3core/typo3/browse_links.php TYPO3core.jsutf8/typo3/browse_links.php
--- TYPO3core/typo3/browse_links.php	2005-12-12 13:33:27.752788032 +0100
+++ TYPO3core.jsutf8/typo3/browse_links.php	2005-12-13 13:32:00.758137248 +0100
@@ -214,8 +214,8 @@
 		$title = $row[$titleCol];
 
 		$ficon = t3lib_iconWorks::getIcon($table,$row);
-		$aOnClick = "return insertElement('".$table."', '".$row['uid']."', 'db', unescape('".rawurlencode($title)."'), '', '', '".$ficon."');";
-		$ATag = '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">';
+		$aOnClick = "return insertElement('".$table."', '".$row['uid']."', 'db', ".t3lib_div::quoteJSvalue($title).", '', '', '".$ficon."');";
+		$ATag = '<a href="#" onclick="'.$aOnClick.'">';
 		$ATag_alt = substr($ATag,0,-4).',\'\',1);">';
 		$ATag_e = '</a>';
 
@@ -428,11 +428,11 @@
 	function wrapTitle($title,$v,$ext_pArrPages)	{
 		if ($ext_pArrPages)	{
 			$ficon=t3lib_iconWorks::getIcon('pages',$v);
-			$onClick = "return insertElement('pages', '".$v['uid']."', 'db', unescape('".rawurlencode($v['title'])."'), '', '', '".$ficon."','',1);";
+			$onClick = "return insertElement('pages', '".$v['uid']."', 'db', ".t3lib_div::quoteJSvalue($v['title']).", '', '', '".$ficon."','',1);";
 		} else {
 			$onClick = 'return jumpToUrl(\'browse_links.php?act='.$GLOBALS['SOBE']->act.'&mode='.$GLOBALS['SOBE']->mode.'&expandPage='.$v['uid'].'\');';
 		}
-		return '<a href="#" onclick="'.htmlspecialchars($onClick).'">'.$title.'</a>';
+		return '<a href="#" onclick="'.$onClick.'">'.$title.'</a>';
 	}
 }
 
@@ -1622,8 +1622,8 @@
 			$ATag2='';
 			if (in_array('pages',$tablesArr))	{
 				$ficon=t3lib_iconWorks::getIcon('pages',$mainPageRec);
-				$ATag="<a href=\"#\" onclick=\"return insertElement('pages', '".$mainPageRec['uid']."', 'db', unescape('".rawurlencode($mainPageRec['title'])."'), '', '', '".$ficon."','',1);\">";
-				$ATag2="<a href=\"#\" onclick=\"return insertElement('pages', '".$mainPageRec['uid']."', 'db', unescape('".rawurlencode($mainPageRec['title'])."'), '', '', '".$ficon."','',0);\">";
+				$ATag="<a href=\"#\" onclick=\"return insertElement('pages', '".$mainPageRec['uid']."', 'db', ".t3lib_div::quoteJSvalue($mainPageRec['title']).", '', '', '".$ficon."','',1);\">";
+				$ATag2="<a href=\"#\" onclick=\"return insertElement('pages', '".$mainPageRec['uid']."', 'db', ".t3lib_div::quoteJSvalue($mainPageRec['title']).", '', '', '".$ficon."','',0);\">";
 				$ATag_alt=substr($ATag,0,-4).",'',1);\">";
 				$ATag_e='</a>';
 			}
diff -u -ur TYPO3core/typo3/sysext/cms/tslib/class.tslib_content.php TYPO3core.jsutf8/typo3/sysext/cms/tslib/class.tslib_content.php
--- TYPO3core/typo3/sysext/cms/tslib/class.tslib_content.php	2005-12-13 13:09:10.412461456 +0100
+++ TYPO3core.jsutf8/typo3/sysext/cms/tslib/class.tslib_content.php	2005-12-13 13:15:56.490728176 +0100
@@ -1998,7 +1998,7 @@
 		$hiddenfields = '<div style="display:none;">'.$hiddenfields.'</div>';
 
 		if ($conf['REQ'])	{
-			$validateForm=' onsubmit="return validateForm(\''.$formname.'\',\''.implode(',',$fieldlist).'\',\''.rawurlencode($conf['goodMess']).'\',\''.rawurlencode($conf['badMess']).'\',\''.rawurlencode($conf['emailMess']).'\')"';
+			$validateForm=' onsubmit="return validateForm(\''.$formname.'\',\''.implode(',',$fieldlist).'\','.t3lib_div::quoteJSvalue($conf['goodMess']).','.t3lib_div::quoteJSvalue($conf['badMess']).','.t3lib_div::quoteJSvalue($conf['emailMess']).')"';
 			$GLOBALS['TSFE']->additionalHeaderData['JSFormValidate'] = '<script type="text/javascript" src="'.$GLOBALS['TSFE']->absRefPrefix.'t3lib/jsfunc.validateform.js"></script>';
 		} else $validateForm='';
 
@@ -5878,12 +5878,12 @@
 				reset($value);
 				while(list(,$Nvalue)=each($value))	{
 					$JSPart.="
-	updateForm('".$formName."','".$arrPrefix."[".$fKey."][]',unescape('".rawurlencode($Nvalue)."'))";
+	updateForm('".$formName."','".$arrPrefix."[".$fKey."][]',".t3lib_div::quoteJSvalue($Nvalue, true).")";
 				}
 
 			} else {
 				$JSPart.="
-	updateForm('".$formName."','".$arrPrefix."[".$fKey."]',unescape('".rawurlencode($value)."'))";
+	updateForm('".$formName."','".$arrPrefix."[".$fKey."]',".t3lib_div::quoteJSvalue($value, true).")";
 			}
 		}
 		$JSPart='<script type="text/javascript">
@@ -6883,7 +6883,7 @@
 			}
 		} else {
 			if ($confirm)	{
-				$cf1="if (confirm(unescape('".t3lib_div::rawurlencodeJS($confirm)."'))){";
+				$cf1="if (confirm(".str_replace(chr(10), '\n', t3lib_div::quoteJSvalue($confirm, true)).")){";			// Gets htmlspecialchared later
 				$cf2='}';
 			} else {
 				$cf1=$cf2='';
diff -u -ur TYPO3core/typo3/sysext/cms/tslib/class.tslib_menu.php TYPO3core.jsutf8/typo3/sysext/cms/tslib/class.tslib_menu.php
--- TYPO3core/typo3/sysext/cms/tslib/class.tslib_menu.php	2005-12-12 13:33:35.753571728 +0100
+++ TYPO3core.jsutf8/typo3/sysext/cms/tslib/class.tslib_menu.php	2005-12-13 13:15:56.492727872 +0100
@@ -2733,7 +2733,7 @@
 					} else {
 						$addLines = '';
 					}
-					$title=rawurlencode($data['title']);
+					$title=$data['title'];
 					$url='';
 					$target='';
 					if ((!$addLines && !$levelConf['noLink']) || $levelConf['alwaysLink']) {
@@ -2745,7 +2745,7 @@
 						$url = rawurlencode($LD['totalURL']);
 						$target = rawurlencode($LD['target']);
 					}
-					$codeLines.="\n".$var.$count."=".$menuName.".add(".$parent.",".$prev.",0,'".$title."','".$GLOBALS['TSFE']->baseUrlWrap($url)."','".$target."');";
+					$codeLines.="\n".$var.$count."=".$menuName.".add(".$parent.",".$prev.",0,".t3lib_div::quoteJSvalue($title, true).",'".$GLOBALS['TSFE']->baseUrlWrap($url)."','".$target."');";
 						// If the active one should be chosen...
 					$active = ($levelConf['showActive'] && $data['uid'] == $this->tmpl->rootLine[$count]['uid']);
 						// If the first item should be shown
@@ -2770,7 +2770,7 @@
 			$levelConf['firstLabel'] = $this->mconf['firstLabelGeneral'];
 		}
 		if ($levelConf['firstLabel'] && $codeLines)	{
-			$codeLines.="\n".$menuName.".defTopTitle[".$count."] = unescape('".rawurlencode($levelConf['firstLabel'])."');";
+			$codeLines.= chr(10).$menuName.'.defTopTitle['.$count.'] = '.t3lib_div::quoteJSvalue($levelConf['firstLabel'], true).';';
 		}
 		return $codeLines;
 	}
