Return-Path: Delivered-To: apmail-lucene-solr-dev-archive@minotaur.apache.org Received: (qmail 75185 invoked from network); 27 Aug 2009 00:01:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Aug 2009 00:01:22 -0000 Received: (qmail 69289 invoked by uid 500); 27 Aug 2009 00:01:21 -0000 Delivered-To: apmail-lucene-solr-dev-archive@lucene.apache.org Received: (qmail 69198 invoked by uid 500); 27 Aug 2009 00:01:21 -0000 Mailing-List: contact solr-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-dev@lucene.apache.org Delivered-To: mailing list solr-dev@lucene.apache.org Received: (qmail 69187 invoked by uid 99); 27 Aug 2009 00:01:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Aug 2009 00:01:21 +0000 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Aug 2009 00:01:19 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6CEB3234C04C for ; Wed, 26 Aug 2009 17:00:59 -0700 (PDT) Message-ID: <273260017.1251331259445.JavaMail.jira@brutus> Date: Wed, 26 Aug 2009 17:00:59 -0700 (PDT) From: "Yonik Seeley (JIRA)" To: solr-dev@lucene.apache.org Subject: [jira] Commented: (SOLR-1091) "phps" (serialized PHP) writer produces invalid output In-Reply-To: <492618424.1238192690595.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SOLR-1091?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D12748= 212#action_12748212 ]=20 Yonik Seeley commented on SOLR-1091: ------------------------------------ Hmmm, I thought this might be a decoding error. Instead it perhaps looks l= ike the JVM not handling UTF8 encoding the same as Jetty. As one can see by this: $ curl --trace - 'http://localhost:8983/solr/select?q=3Dabcdef&a=3D%ED%AF%8= 0%ED%B1%B8&wt=3Dphps' The ascii portion of the dump looks like: s:4:"......"; So the JVM is telling us that the string will serialize to 4 bytes, and whe= n Jetty actually does the serialization, it comes out to 6. Java's String.getBytes() does have the following warning: *

The behavior of this method when this string cannot be encoded i= n * the given charset is unspecified. > "phps" (serialized PHP) writer produces invalid output > ------------------------------------------------------ > > Key: SOLR-1091 > URL: https://issues.apache.org/jira/browse/SOLR-1091 > Project: Solr > Issue Type: Bug > Components: search > Affects Versions: 1.3 > Environment: Sun JRE 1.6.0 on Centos 5 > Reporter: frank farmer > Priority: Minor > Fix For: 1.4 > > > The serialized PHP output writer can outputs invalid string lengths for c= ertain (unusual) input values. Specifically, I had a document containing t= he following 6 byte character sequence: \xED\xAF\x80\xED\xB1\xB8 > I was able to create a document in the index containing this value withou= t issue; however, when fetching the document back out using the serialized = PHP writer, it returns a string like the following: > s:4:"=C3=AD=C2=AF=E2=82=AC=C3=AD=C2=B1=C2=B8"; > Note that the string length specified is 4, while the string is actually = 6 bytes long. > When using PHP's native serialize() function, it correctly sets the lengt= h to 6: > # php -r 'var_dump(serialize("\xED\xAF\x80\xED\xB1\xB8"));' > string(13) "s:6:"=C3=AD=C2=AF=E2=82=AC=C3=AD=C2=B1=C2=B8";" > The "wt=3Dphp" writer, which produces output to be parsed with eval(), do= esn't have any trouble with this string. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.