character encoding in history - fatal error
Posted: 31 Jan 2013, 12:13
Hello,
I have simple object in my repository:
If I display page with this capability and go to any other page I get the error: "net.sf.saxon.trans.XPathException: Illegal HTML character: decimal 132" in tomcat console
After some investigation the problem I can see is in file core_page_history.xsl in line
so the parameter 'breadcrumbs' which is copied from xsl parameter 'pageHistory' is bad.
After changing the line to :
it does not raise java exception and in history I see "65 112 112 108 105 99 97 116 105 111 110 32 67 97 112 97 98 105 108 105 116 121 32 83 117 109 109 97 114 121 32 45 197 132 197 132 197 132 197 132"
As You can see four characters from name "ńńńń" are represented by eight characters with decimal codes "197 132 197 132 197 132 197 132"
It seems that java code inproperly translates utf-8 codes into some one-byte encoding (in my windows default encoding is windows-1250 - maybe somewhere default encoding is used) and puts that value into transformation as pageHistory parameter.
Best Regards
Jacek Szpyrka
I have simple object in my repository:
Code: Select all
<simple_instance>
<name>ra_1_imported_data_p638_Class5</name>
<type>Application_Capability</type>
<own_slot_value>
<slot_reference>name</slot_reference>
<value value_type="string">ńńńń</value>
</own_slot_value>
</simple_instance>
After some investigation the problem I can see is in file core_page_history.xsl in line
Code: Select all
<xsl:value-of select="$aLabel"></xsl:value-of>
After changing the line to :
Code: Select all
<xsl:value-of select="string-to-codepoints($aLabel)"></xsl:value-of>
As You can see four characters from name "ńńńń" are represented by eight characters with decimal codes "197 132 197 132 197 132 197 132"
It seems that java code inproperly translates utf-8 codes into some one-byte encoding (in my windows default encoding is windows-1250 - maybe somewhere default encoding is used) and puts that value into transformation as pageHistory parameter.
Best Regards
Jacek Szpyrka