Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode content before calling LWP #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 4, 2014

  1. Encode content before calling LWP

    When LWP encodes a HASH-ref, as is done in generic_solr_request it will use the
    URI module to create the www-form-urlencoded content from the HASH-ref.
    
    The URI module will try to deduce the desired target charset from the utf8-flag
    on the strings, which means that the strings sent to Solr aren't UTF-8 encoded
    unless they have been either decoded, or encoded as utf8.
    
    This is confusing, as e.g. the string "\xc6" is passed on to Solr as an UTF-8
    encoded Æ passed through the add-method, but the same string will result in an
    error from Solr if used with the search-method.
    
    To fix this issue, encode all of the strings from the parameters in
    generic_solr_request before passing them on to LWP. This way the charset
    behaviour of generic_solr_request and _send_update is aligned.
    
    Note: This will break applications that encode strings to UTF-8 before calling
    WebService::Solr generic_solr_request, search or auto_suggest.
    ksmadsen committed Nov 4, 2014
    Configuration menu
    Copy the full SHA
    2dccf10 View commit details
    Browse the repository at this point in the history