Open winding-lines opened 14 years ago
add
at the beginning of the file
add that to the beginning of what file? I am having an identical issue:
W, [2010-11-06T11:50:27.783913 #29449] WARN -- : EXCEPTION:
REXML::ParseException
/usr/local/lib/ruby/1.9.1/rexml/source.rb:212:in `match'
/usr/local/lib/ruby/1.9.1/rexml/source.rb:212:in`match'
/usr/local/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:425:in `pull'
/usr/local/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:92:in`parse'
/usr/local/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/streamparser.rb:79:in `parse'
/usr/local/lib/ruby/gems/1.9.1/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:75:in`block in start'
...
Exception parsing
Line:
Position: 0
Last 80 unconsumed characters:
At the beginning of the file where the error occurred add: #encoding: utf-8
it is occurring after the code connects to the server. it is when the xmpp4r stream parser is parsing the incoming stanzas. Are you saying that I should be adding this to the streamparser.rb (part of the core of the xmpp4r module?)
in every file that contains no ascii chars like for example шѓќч....so add it in the beginning of all files where there are non ascii chars...start with source.rb , baseparser.rb...it does no harm ...thats how 1.9 rolls ;) good luck
The problem is that the characters that it cannot parse are coming in from the xmpp stream. They are not in a local file. The are in the incoming stanzas when the code connects to the xmpp server.
see https://github.com/ln/xmpp4r/issues#issue/3 for possible solution. Please report if it helps. Regards
I am getting some encoding problems in REXML. Any idea on how to force the encodings to either UTF-8 or ASCII-8Bit?
Marius mseritan@de-co-de.com
REXML::ParseException
<Encoding::CompatibilityError: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)>
/Users/myself/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rexml/source.rb:212:in
match' /Users/myself/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rexml/source.rb:212:in
match' /Users/myself/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:369:inpull' /Users/myself/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:92:in
parse' /Users/myself/.rvm/gems/ruby-1.9.2-head/bundler/gems/xmpp4r-58529d875336b42d7dd5afe6bf577599f9305014-master/lib/xmpp4r/streamparser.rb:79:inparse' /Users/myself/.rvm/gems/ruby-1.9.2-head/bundler/gems/xmpp4r-58529d875336b42d7dd5afe6bf577599f9305014-master/lib/xmpp4r/stream.rb:75:in
block in start' ... Exception parsing Line:Position: 0 Last 80 unconsumed characters: <presence from='shawn@some.com/Shawn’s MacBook Pro' to='me@some.com/ /Users/myself/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:441:in
rescue in pull' /Users/myself/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rexml/parsers/baseparser.rb:332:in
pull' /Users/myself/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rexml/parsers/sax2parser.rb:92:inparse' /Users/myself/.rvm/gems/ruby-1.9.2-head/bundler/gems/xmpp4r-58529d875336b42d7dd5afe6bf577599f9305014-master/lib/xmpp4r/streamparser.rb:79:in
parse' /Users/myself/.rvm/gems/ruby-1.9.2-head/bundler/gems/xmpp4r-58529d875336b42d7dd5afe6bf577599f9305014-master/lib/xmpp4r/stream.rb:75:in `block in start'