From: Michel Demazure Date: 2010-08-25T15:29:32+09:00 Subject: Re: Nokogiri SAX parser encoding problem Bob Hutchison wrote: > > Actually this is allowed by the XML spec, annoying as it is. Many > parsers do this when encountering an entity (e.g. ') in the input > stream (you get three strings, before, entity character, after). Some > XML parsers have a parameter that tells it to join adjacent strings > together before reporting a single string. I don't know if Nokogiri > provides this functionality, but it might be worth a quick peek. > @Bob : Yes, it is allowed. From the nokogiri doc for the 'characters' method : "This method might be called multiple times given one contiguous string of characters." @Ryan : strange as it is, it's a feature. So, IMHO, no bug report. Actually, it is very strange. Parsing 'deuxi竪me', you get two calls 'deuxi' + '竪me', but parsing the more complex '辿p辿e deuxi竪me', you get only one ... Thanks to both of you. _md -- Posted via http://www.ruby-forum.com/.