From: Aaron Patterson Date: 2010-05-22T02:08:45+09:00 Subject: [ruby-core:30351] Re: [Backport #3329] Segfault using nokogiri --45Z9DzgjV8m4Oswq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 21, 2010 at 09:50:54AM +0900, John Rowell wrote: > Issue #3329 has been updated by John Rowell. >=20 >=20 > This may be happening due to character encodings. A >=20 > res =3D xslt.transform(page.search('//body')) >=20 > (where 'page' is a Mechanize instance) causes a segfault, while a >=20 > res =3D xslt.transform(Nokogiri::HTML(page.content, nil, page.encodin= g)) >=20 > does not. The original page is encoded with ISO-8859-1, and Mechanize doe= sn't always convert text to UTF-8 (#text is converted, #content is not). Ma= ybe libxslt only accepts UTF-8 and Nokogiri is not properly converting the = encodings before sending the text. This sounds like it may be a bug in Nokogiri and not Ruby. Can you please add a ticket to our tracker here: http://github.com/tenderlove/nokogiri/issues Also, if you provide the output of `nokogiri -v` and a script to reproduce the problem, that would be extremely helpful. Thanks! --=20 Aaron Patterson http://tenderlovemaking.com/ --45Z9DzgjV8m4Oswq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) iQEcBAEBAgAGBQJL9r4gAAoJEJUxcLy0/6/GE90H+wTaFDww4E0Tuth2fFPtOq/1 8u3f0v8i7L+tjcLNLKqTqtmLoq4z3htisfz3wWO9jmH56A8ye7hWFEvO+gdprnbS Wkee8UdgDnAN/bNF61vofr26IEOQrs7KzHKPTFS8RoBhYiwo+Bj4ZWfUH8jThh2T lc7DKPntSDxWwpz/bGbmIBvl97vwmF6jbF7keJ4E5DuzRNGJa5gcIQIlfahHt+1N 3G4H+5OrvrTDSr5noYVToBbIP/KxycVuHfnA1g2xOVyXVH2twWBCmV8/St/PuLPt mrVmtC2MEHxmSKzk24P6zoKFi8rgcsxVQrthp2xQJIXo8bY5oC7OIMIOJmBSN04= =/jhi -----END PGP SIGNATURE----- --45Z9DzgjV8m4Oswq--