xslt disable-output-escaping turns non-latin characters into question marks "...???????????..."

1.3k Views Asked by At

I'm using xslt do display Solr response in html, my xsl file is in UTF-8 and non-latin characters (arabic) are nicely displayed, the problem is that when I use disable-output-escaping="yes" to parse html tag, the non-latin chars become a series of question marks ?????????

Any clue ?

Thanks in advance

1

There are 1 best solutions below

1
On BEST ANSWER

You "non-latin" characters aren't correctly processed by your XSL processor (maybe it's not unicode-aware?), so they get replaced with "?". Escaping will replace those with their unicode counterparts or with XML entities that represent the character.

Your best option here is to force-specify an encoding that is appropriate for your text, and ensure you use an XSL processor that honors that encoding (some poorly written software frequently assume the whole world writes for en_US locales, sadly).