https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112010-05-21T09:50:54ZRuby Issue Tracking SystemBackport191 - Backport #3329: Segfault using nokogirihttps://redmine.ruby-lang.org/issues/3329?journal_id=111532010-05-21T09:50:54Zjdrowell (John Rowell)me@jdrowell.com
<ul></ul><p>=begin<br>
This may be happening due to character encodings. A</p>
<pre><code> res = xslt.transform(page.search('//body'))
</code></pre>
<p>(where 'page' is a Mechanize instance) causes a segfault, while a</p>
<pre><code> res = xslt.transform(Nokogiri::HTML(page.content, nil, page.encoding))
</code></pre>
<p>does not. The original page is encoded with ISO-8859-1, and Mechanize doesn't always convert text to UTF-8 (#text is converted, #content is not). Maybe libxslt only accepts UTF-8 and Nokogiri is not properly converting the encodings before sending the text.<br>
=end</p> Backport191 - Backport #3329: Segfault using nokogirihttps://redmine.ruby-lang.org/issues/3329?journal_id=111642010-05-22T02:08:59Ztenderlovemaking (Aaron Patterson)tenderlove@ruby-lang.org
<ul></ul><p>=begin<br>
On Fri, May 21, 2010 at 09:50:54AM +0900, John Rowell wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-4 status-5 priority-4 priority-default closed" title="Backport: Segfault using nokogiri (Closed)" href="https://redmine.ruby-lang.org/issues/3329">#3329</a> has been updated by John Rowell.</p>
<p>This may be happening due to character encodings. A</p>
<pre><code>res = xslt.transform(page.search('//body'))
</code></pre>
<p>(where 'page' is a Mechanize instance) causes a segfault, while a</p>
<pre><code>res = xslt.transform(Nokogiri::HTML(page.content, nil, page.encoding))
</code></pre>
<p>does not. The original page is encoded with ISO-8859-1, and Mechanize doesn't always convert text to UTF-8 (#text is converted, #content is not). Maybe libxslt only accepts UTF-8 and Nokogiri is not properly converting the encodings before sending the text.</p>
</blockquote>
<p>This sounds like it may be a bug in Nokogiri and not Ruby. Can you<br>
please add a ticket to our tracker here:</p>
<p><a href="http://github.com/tenderlove/nokogiri/issues" class="external">http://github.com/tenderlove/nokogiri/issues</a></p>
<p>Also, if you provide the output of <code>nokogiri -v</code> and a script to<br>
reproduce the problem, that would be extremely helpful. Thanks!</p>
<p>--<br>
Aaron Patterson<br>
<a href="http://tenderlovemaking.com/" class="external">http://tenderlovemaking.com/</a></p>
<p>Attachment: (unnamed)<br>
=end</p> Backport191 - Backport #3329: Segfault using nokogirihttps://redmine.ruby-lang.org/issues/3329?journal_id=796082019-07-15T19:19:27Zjeremyevans0 (Jeremy Evans)merch-redmine@jeremyevans.net
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/79608/diff?detail_id=53325">diff</a>)</li><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul>