From: Mike Dalessio Date: 2011-06-01T01:44:36+09:00 Subject: Re: Nokogiri : Modifying Nodes and Attributes --90e6ba3fcc3b725ebe04a4951e6f Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2011/5/31 Une B=E9vue > In my test i do have : > > Because i know this declaration is false from Lynx saying it is UTF-8, i > want to change the content attribute by : > meta=3Ddoc.at_xpath("/html/head/meta") > meta['content']=3D"text/html; charset=3DUTF-8" if !meta.nil? && > meta['http-equiv'].downcase=3D=3D'content-type' > Have you tried using `Document#meta_encoding=3D` ? See http://nokogiri.org/search?q=3Dmeta_encoding%3D Also, prefer nokogiri-talk to ruby-talk for Nokogiri questions. Thank you! > > however, printing meta gives always : > > that's to say, no change at all. > > Is this behaviour implied by the fact the meta tag isn't self closed, ie > not ending by " />" ??? > > If yes, in that case i could unling all meta tags and create a good one > ? > No quicker solution ? > > -- > =AB Tout le monde savait que c'=E9tait impossible =E0 faire. Puis un jou= r > quelqu'un est arriv=E9 qui ne le savait pas, et il l'a fait. =BB > (Winston Churchill) > > --90e6ba3fcc3b725ebe04a4951e6f--