You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Donovan Jimenez (JIRA)" <ji...@apache.org> on 2009/05/06 17:33:30 UTC

[jira] Issue Comment Edited: (SOLR-1091) "phps" (serialized PHP) writer produces invalid output

    [ https://issues.apache.org/jira/browse/SOLR-1091?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12706458#action_12706458 ] 

Donovan Jimenez edited comment on SOLR-1091 at 5/6/09 8:32 AM:
---------------------------------------------------------------

the character sequence specified seems to be windows 1252 - based on just getting it to look like what's in the description in a text editor. 

I see it getting the utf-8 byte length now, but is the output writer guaranteed to be outputting in utf-8? sorry if it's a naive question, I do see the content-type is text/plain; charset=utf-8 - does that change the output writer's encoding?

if it IS guaranteed, then maybe its how the character data is added - i.e. the add xml was interpreted utf-8 but the data was actually windows-1252 or similar.

      was (Author: djimenez):
    the character sequence specified seems to be windows 1251 - based on just getting it to look like what's in the description in a text editor. 

I see it getting the utf-8 byte length now, but is the output writer guaranteed to be outputting in utf-8? sorry if it's a naive question, I do see the content-type is text/plain; charset=utf-8 - does that change the output writer's encoding?

if it IS guaranteed, then maybe its how the character data is added - i.e. the add xml was interpreted utf-8 but the data was actually windows-1251 or similar.
  
> "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 certain (unusual) input values.  Specifically, I had a document containing the following 6 byte character sequence: \xED\xAF\x80\xED\xB1\xB8
> I was able to create a document in the index containing this value without issue; however, when fetching the document back out using the serialized PHP writer, it returns a string like the following:
> s:4:"􀁸";
> 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 length to 6:
> # php -r 'var_dump(serialize("\xED\xAF\x80\xED\xB1\xB8"));'
> string(13) "s:6:"􀁸";"
> The "wt=php" writer, which produces output to be parsed with eval(), doesn't have any trouble with this string.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.