Cool :) -----Original Message----- From: gateway0 [mailto:reiterwo...@yahoo.de] Sent: Friday, August 14, 2009 4:52 PM To: solr-user@lucene.apache.org Subject: RE: UTF8 Problem with http request?
Hi, thank you for your suggestions. I solved the problem now. It was the PHP function "strtolower()". As it turns out it can´t handle utf-8 strings. The solution is doing something like this in PHP: " $VALUE = "für"; $text = utf8_encode(strtolower(utf8_decode($VALUE))); " Thank you again "ANKITBHATNAGAR" kind regards, Sebastian ANKITBHATNAGAR wrote: > > I guess in the header you could try setting the Charest something like > this > > header('Content-Type: text/plain; charset=ISO-8859-1'); > > -----Original Message----- > From: gateway0 [mailto:reiterwo...@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 [reiterwo...@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. > > > -- View this message in context: http://www.nabble.com/UTF8-Problem-with-http-request--tp24977306p24978362.html Sent from the Solr - User mailing list archive at Nabble.com.