lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ankit Bhatnagar <abhatna...@vantage.com>
Subject RE: UTF8 Problem with http request?
Date Fri, 14 Aug 2009 20:35:43 GMT
Or this // Setting the Content-Type header with charset
header('Content-Type: text/html; charset=utf-8');


-----Original Message-----
From: gateway0 [mailto:reiterworld@yahoo.de] 
Sent: Friday, August 14, 2009 4:08 PM
To: solr-user@lucene.apache.org
Subject: RE: UTF8 Problem with http request?


Hi,

1.
I use PHP5 what you suggested is a java function I would guess.
In PHP there is something like this:
"
urlencode(utf8_encode($url));
"
But sadly that doesnt help.

2. I don´t use Spring 

Strange thing.



ANKITBHATNAGAR wrote:
> 
> Hey Sebastian,
> 
> Did u try - 
> 1;
> URLEncoder.encode(url, "UTF-8");
> 
> 
> 2:if you application is Spring based-try this
> <filter>
> 		<filter-name>CharacterEncoding</filter-name>
> 		<filter-class>
> 			org.springframework.web.filter.CharacterEncodingFilter
> 		</filter-class>
> 		<init-param>
> 			<param-name>encoding</param-name>
> 			<param-value>UTF-8</param-value>
> 		</init-param>
> 		<init-param>
> 			<param-name>forceEncoding</param-name>
> 			<param-value>true</param-value>
> 		</init-param>
> 	</filter>
> 	<filter-mapping>
> 		<filter-name>CharacterEncoding</filter-name>
> 		<url-pattern>/*</url-pattern>
> 	</filter-mapping>	
> 
> 
> 
> 
> Ankit
> ________________________________________
> From: gateway0 [reiterworld@yahoo.de]
> Sent: Friday, August 14, 2009 3:32 PM
> To: solr-user@lucene.apache.org
> Subject: UTF8 Problem with http request?
> 
> Hi,
> 
> First of all I know that there is a utf8 problem with tomcat. So I updated
> the "server.xml" tomcat file with
> "
> <Connector port="8080" protocol="HTTP/1.1"
>                connectionTimeout="20000"
>                redirectPort="8443"
>                URIEncoding="UTF-8" />
> "
> 
> - So now the solr admin console returns an successful result
> for example:
> q=für
> 
> result:
> "
> <response>
> −
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">0</int>
> −
> <lst name="params">
> <str name="indent">on</str>
> <str name="start">0</str>
> <str name="q">für
> </str>
> <str name="rows">10</str>
> <str name="version">2.2</str>
> </lst>
> </lst>
> −
> <result name="response" numFound="2" start="0">
> "
> 
> - However if I use a http request through php5 I´ll get this result:
> "
> {"responseHeader":{"status":0,"QTime":0,"params":{"fl":"db_id,name,def,deadline","start":"0","q":"text:f�r
> text_two:f�r*
> ","wt":"json","fq":"","rows":"10"}},"response":{"numFound":0,"start":0,"docs":[]}}
> "
> 
> If I look into the tomcat console I see this:
> "
> 14.08.2009 21:21:42 org.apache.solr.core.SolrCore execute
> INFO: [] webapp=/solr path=/select
> params={fl=db_id,name,def,deadline&start=0&q=text:f?r+text_two:f?r*+&wt=json&fq=&rows=10}
> hits=0 status=0 QTime=0
> "
> 
> I am quite sure it has something to do with the http request. Is it
> possible
> to set the charakterset for an http request?
> I cant find anything regarding the subject.
> 
> kind regards, Sebastian
> 
> --
> View this message in context:
> http://www.nabble.com/UTF8-Problem-with-http-request--tp24977306p24977306.html
> Sent from the Solr - User mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/UTF8-Problem-with-http-request--tp24977306p24977744.html
Sent from the Solr - User mailing list archive at Nabble.com.

Mime
View raw message