Microsoft KB Archive/925847

= Japanese characters are encoded with an escaped reference when you switch to HTML view after you save Japanese characters in the HTMLPlaceholder control in Content Management Server 2002 SP2 =

Article ID: 925847

Article Last Modified on 10/26/2007

-

APPLIES TO


 * Microsoft Content Management Server 2002 Service Pack 2

-



SYMPTOMS
You install Microsoft Content Management Server (MCMS) 2002 Service Pack 2. When you switch to HTML view after you save Japanese characters in the HTMLPlaceholder control, you notice that the Japanese characters are encoded with an escaped reference. For example, you may see an escaped reference, such as &#12345.



WORKAROUND
To work around this problem, follow these steps:   Create a Microsoft Visual Basic Scripting Edition (VBScript) file that is named ActiveXToolbarHooks.vbs and that has the following code. On Error Resume Next

Dim previousEditingSourceState previousEditingSourceState = false

Call EnableCompatibleToolbarHooks

Sub OnToolbarInitialize( ByVal pToolbarInterface ) ' No action required End Sub

Sub OnToolbarStateInitialize( ByVal strPlaceholderName, ByVal pState ) ' No action required End Sub

Sub OnToolbarUpdate( ByVal pActiveHtmlEditor, ByVal bEditingSource ) ' If switching from typical view to HTML source ‘ editing then perform a special decode operation If (Not previousEditingSourceState) And bEditingSource Then pActiveHtmlEditor.dom.body.innerHtml = DecodeUnicodeChars(pActiveHtmlEditor.dom.body.innerHtml) Else End If   previousEditingSourceState = bEditingSource End Sub

Sub OnToolbarEvent( Byval pActiveHtmlEditor, ByVal bstrId, ByVal pItem, ByVal bEditingSource ) ' No action required End Sub

Function DecodeUnicodeChars(inputHTML)

Dim charEntityRegExp Set charEntityRegExp = New RegExp charEntityRegExp.Pattern = &quot;&amp;#(\d{1,5});&quot;

charEntityRegExp.Multiline = True charEntityRegExp.Global = True charEntityRegExp.IgnoreCase = True

Dim outputHtml outputHtml = inputHtml

outputHtml = charEntityRegExp.Replace(outputHtml, GetRef(&quot;DecodeMatchedChar&quot;))

Set charEntityRegExp = Nothing

DecodeUnicodeChars = outputHtml End Function

Function DecodeMatchedChar(fullMatch, subMatch, position, sourceString) DecodeMatchedChar = ChrW(subMatch) End Function  Copy the ActiveXToolbarHooks.vbs file to the MCMS server location that is available by a virtual path. For example, you may copy the file to the MCMS project directory.  Add the following code to every active server page (ASPX) template file in the MCMS project. Alternatively, you may add the following code to DefaultConsole.aspx file and then add the user control to all ASPX template files.    Notes   is a placeholder for the relative path of the ActiveXToolbarHooks.vbs file.  Make sure that you use the following MCMS tag prefix: <%@ Register TagPrefix=&quot;Cms&quot; Namespace=&quot;Microsoft.ContentManagement.WebControls&quot; Assembly=&quot;Microsoft.ContentManagement.WebControls&quot; %>  After you complete these steps, the encoded Japanese characters will be decoded in the HTML view when you save a posting.</li></ul> </li></ol>

Keywords: kbqfe kbprb KB925847

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.