* [sup-devel] Encoding of message snippet in xapian
@ 2011-02-09 21:27 Gaudenz Steinlin
2011-02-17 14:42 ` Gaudenz Steinlin
0 siblings, 1 reply; 2+ messages in thread
From: Gaudenz Steinlin @ 2011-02-09 21:27 UTC (permalink / raw)
To: sup-devel
Hi
While debuging the trackeback posted below I discovered that my xapian
index contains some of the message snippets in ASCII-8BIT and others
in UTF-8. This leads to probelems when building the thread-view for
collapsed messages for messages wich have non 7-bit ASCII characters
in their snippet. message_patina_lines combines the snippet which
comes from the xapian index and is (sometimes) in ASCII-8BIT with
other parts of the message which are in UTF-8.
I don't know exactly how I ended up with a xapian index which has some
strings in ASCII-8BIT and others in UTF-8. I guess it's because I
first used sup with Ruby 1.8 and only recently switched to Ruby 1.9.1.
What's the expected encoding of things coming from the xapian index?
Is there a way to fix the index? Or is a fix in sup needed for this?
Or should I just recreate my index from scratch?
Running sup with Ruby 1.8 avoids the problem. But I guess it only
masks it because 1.8 is not encoding aware.
Gaudenz
--- Encoding::CompatibilityError from thread: load messages for thread-view-mode
incompatible character encodings: UTF-8 and ASCII-8BIT
/home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:792:in `message_patina_lines'
/home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:853:in `chunk_to_lines'
/home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:724:in `block in regen_text'
/home/gaudenz/projects/sup/lib/sup/thread.rb:68:in `block in each'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:174:in `each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
/home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
/home/gaudenz/projects/sup/lib/sup/thread.rb:67:in `each'
/home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:713:in `regen_text'
/home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:175:in `buffer='
/home/gaudenz/projects/sup/lib/sup/buffer.rb:387:in `spawn'
(eval):1:in `spawn'
/home/gaudenz/projects/sup/lib/sup/modes/thread-index-mode.rb:120:in `block in select'
/home/gaudenz/projects/sup/lib/sup.rb:78:in `block in reporting_thread'
--
Ever tried. Ever failed. No matter.
Try again. Fail again. Fail better.
~ Samuel Beckett ~
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [sup-devel] Encoding of message snippet in xapian
2011-02-09 21:27 [sup-devel] Encoding of message snippet in xapian Gaudenz Steinlin
@ 2011-02-17 14:42 ` Gaudenz Steinlin
0 siblings, 0 replies; 2+ messages in thread
From: Gaudenz Steinlin @ 2011-02-17 14:42 UTC (permalink / raw)
To: sup-devel
[-- Attachment #1.1: Type: text/plain, Size: 5166 bytes --]
HI
Excerpts from Gaudenz Steinlin's message of 2011-02-09 22:27:13 +0100:
> Hi
>
> While debuging the trackeback posted below I discovered that my xapian
> index contains some of the message snippets in ASCII-8BIT and others
> in UTF-8. This leads to probelems when building the thread-view for
> collapsed messages for messages wich have non 7-bit ASCII characters
> in their snippet. message_patina_lines combines the snippet which
> comes from the xapian index and is (sometimes) in ASCII-8BIT with
> other parts of the message which are in UTF-8.
>
> I don't know exactly how I ended up with a xapian index which has some
> strings in ASCII-8BIT and others in UTF-8. I guess it's because I
> first used sup with Ruby 1.8 and only recently switched to Ruby 1.9.1.
> What's the expected encoding of things coming from the xapian index?
> Is there a way to fix the index? Or is a fix in sup needed for this?
> Or should I just recreate my index from scratch?
>
> Running sup with Ruby 1.8 avoids the problem. But I guess it only
> masks it because 1.8 is not encoding aware.
Just for the record. I solved the issue by dumping all labels and
recreating the index with ruby 1.9. That's what I did:
sup-dump > label-dump.txt
rm -r ~/.sup/xapian
sup-sync --restore label-dump.txt --all-sources
While reimporting all my messages I discovered a few message parsing
bugs and some bugs related to GPGME. I created patches for all these
problems and will submit these in separate mails.
Gaudenz
>
> Gaudenz
>
> --- Encoding::CompatibilityError from thread: load messages for thread-view-mode
> incompatible character encodings: UTF-8 and ASCII-8BIT
> /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:792:in `message_patina_lines'
> /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:853:in `chunk_to_lines'
> /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:724:in `block in regen_text'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:68:in `block in each'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block (2 levels) in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:174:in `each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:176:in `block in each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:175:in `each_with_stuff'
> /home/gaudenz/projects/sup/lib/sup/thread.rb:67:in `each'
> /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:713:in `regen_text'
> /home/gaudenz/projects/sup/lib/sup/modes/thread-view-mode.rb:175:in `buffer='
> /home/gaudenz/projects/sup/lib/sup/buffer.rb:387:in `spawn'
> (eval):1:in `spawn'
> /home/gaudenz/projects/sup/lib/sup/modes/thread-index-mode.rb:120:in `block in select'
> /home/gaudenz/projects/sup/lib/sup.rb:78:in `block in reporting_thread'
--
Ever tried. Ever failed. No matter.
Try again. Fail again. Fail better.
~ Samuel Beckett ~
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 482 bytes --]
[-- Attachment #2: Type: text/plain, Size: 143 bytes --]
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-17 14:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-09 21:27 [sup-devel] Encoding of message snippet in xapian Gaudenz Steinlin
2011-02-17 14:42 ` Gaudenz Steinlin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox