<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #1798: API search in non-q fields has exception for unicode characters</title>
    <link>http://localhost/ticket/1798</link>
    <description>&lt;p&gt;
You get an exception if you use the API to search packages and specify a non-ascii character in a field other than q.
&lt;/p&gt;
&lt;p&gt;
For example:
&lt;/p&gt;
&lt;pre class="wiki"&gt;http://catalogue.data.gov.uk/api/search/package?title=%E2%80%93
&lt;/pre&gt;&lt;p&gt;
This "N-dash" (Unicode character 2013) causes this exception:
&lt;/p&gt;
&lt;pre class="wiki"&gt;Module ckan.controllers.api:460 in search
&amp;lt;&amp;lt;                      if ver in u'12':
                               # Otherwise, put all unrecognised ones into the q parameter
                               params = convert_legacy_parameters_to_solr(params)
                           query = query_for(model.Package)
                           results = query.run(params)
&amp;gt;&amp;gt;  params = convert_legacy_parameters_to_solr(params)
Module ckan.lib.search.query:38 in convert_legacy_parameters_to_solr
&amp;lt;&amp;lt;      for search_key in non_solr_params:
               value_obj = legacy_params[search_key]
               value = str(value_obj).replace('+', ' ')
               if search_key == 'all_fields':
                   if value:
&amp;gt;&amp;gt;  value = str(value_obj).replace('+', ' ')
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 30: ordinal not in range(128)
&lt;/pre&gt;&lt;p&gt;
This problem affects CKAN 1.5 and 1.5.1 only.
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/1798</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Thu, 16 Feb 2012 12:32:40 GMT</pubDate>
      <title>status changed; cc, resolution set</title>
      <link>http://localhost/ticket/1798#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/1798#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;cc&lt;/strong&gt;
              &lt;em&gt;icmurray&lt;/em&gt; added
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Was fixed by Ian in &lt;a class="ext-link" href="https://github.com/okfn/ckan/commit/5a9054459e3833443bed3e118bbbb6c442e55b0b"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://github.com/okfn/ckan/commit/5a9054459e3833443bed3e118bbbb6c442e55b0b&lt;/a&gt; on branch feature-1453-flexible-tag-names.
&lt;/p&gt;
&lt;p&gt;
This has gone into CKAN 1.6.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>