views:

158

answers:

1

Hi, 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  A: 

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).

Romain
Actualy I resolved the problem by setting two parameters in server.xml file configuration of Tomcat "<connector ... ... URIEncoding="UTF-8" useBodyEncodingForURI="true"/>", by which I force-specify UTF-8 encoding on both URI string, furthermore I added a Servlet Filter to Solr webapp to make sure that requests and responses are brought in UTF-8