Microsoft KB Archive/925847: Difference between revisions
m (Text replacement - "<" to "<") |
m (Text replacement - ">" to ">") |
||
Line 105: | Line 105: | ||
<li>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.</li> | <li>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.</li> | ||
<li><p>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.</p> | <li><p>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.</p> | ||
<pre class="codesample"><cms:AuthoringModeContainer mode="Both" runat="server" id="UnicodeHtmlFixup" | <pre class="codesample"><cms:AuthoringModeContainer mode="Both" runat="server" id="UnicodeHtmlFixup"> | ||
<script language="vbscript" type="text/vbscript" src="/<cmsproject | <script language="vbscript" type="text/vbscript" src="/<cmsproject>/ActiveXToolbarHooks.vbs"></script> | ||
</cms:AuthoringModeContainer | </cms:AuthoringModeContainer></pre> | ||
<p>'''Notes'''</p> | <p>'''Notes'''</p> | ||
<ul> | <ul> | ||
<li><code><cmsproject | <li><code><cmsproject></code> is a placeholder for the relative path of the ActiveXToolbarHooks.vbs file.</li> | ||
<li><p>Make sure that you use the following MCMS tag prefix:</p> | <li><p>Make sure that you use the following MCMS tag prefix:</p> | ||
<pre class="codesample"><%@ Register TagPrefix="Cms" Namespace="Microsoft.ContentManagement.WebControls" | <pre class="codesample"><%@ Register TagPrefix="Cms" Namespace="Microsoft.ContentManagement.WebControls" | ||
Assembly="Microsoft.ContentManagement.WebControls" % | Assembly="Microsoft.ContentManagement.WebControls" %></pre></li> | ||
<li>After you complete these steps, the encoded Japanese characters will be decoded in the HTML view when you save a posting.</li></ul> | <li>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> | </li></ol> |
Revision as of 10:26, 21 July 2020
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 〹.
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 = "&#(\d{1,5});" charEntityRegExp.Multiline = True charEntityRegExp.Global = True charEntityRegExp.IgnoreCase = True Dim outputHtml outputHtml = inputHtml outputHtml = charEntityRegExp.Replace(outputHtml, GetRef("DecodeMatchedChar")) 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.
<cms:AuthoringModeContainer mode="Both" runat="server" id="UnicodeHtmlFixup"> <script language="vbscript" type="text/vbscript" src="/<cmsproject>/ActiveXToolbarHooks.vbs"></script> </cms:AuthoringModeContainer>
Notes
<cmsproject>
is a placeholder for the relative path of the ActiveXToolbarHooks.vbs file.Make sure that you use the following MCMS tag prefix:
<%@ Register TagPrefix="Cms" Namespace="Microsoft.ContentManagement.WebControls" Assembly="Microsoft.ContentManagement.WebControls" %>
- After you complete these steps, the encoded Japanese characters will be decoded in the HTML view when you save a posting.
Keywords: kbqfe kbprb KB925847