Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
* [sup-devel] Accept ASCII_8BIT in String.check
       [not found] <b0bc07101003241915t22d13ea2w26468d9d72df972f@mail.gmail.com>
@ 2010-03-25  2:21 ` Johann Klähn
  2010-03-25  3:20   ` Rich Lane
  0 siblings, 1 reply; 3+ messages in thread
From: Johann Klähn @ 2010-03-25  2:21 UTC (permalink / raw)
  To: sup-devel

I was having problems with encoded emails. Using archlinux / ruby
1.9.1_p378 Iconv.iconv returns the encoding ASCII_8BIT,
which was rejected by String.check.

Before I was getting debug messages like this when converting mails or
building the index:
 couldn't transcode text from ISO-8859-1 (ISO-8859-1) to utf8) (...)
(got unexpected encoding ASCII-8BIT (String::CheckError))
My String.check now contains:
  if respond_to?(:encoding) && !(encoding == Encoding::UTF_8 ||
encoding == Encoding::ASCII || encoding == Encoding::ASCII_8BIT)
And everything is working as expected. Instead of text.ascii the real
umlauts are displayed.

Hope that helps,
Johann
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [sup-devel] Accept ASCII_8BIT in String.check
  2010-03-25  2:21 ` [sup-devel] Accept ASCII_8BIT in String.check Johann Klähn
@ 2010-03-25  3:20   ` Rich Lane
  2010-03-25  8:02     ` Johann Klähn
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Lane @ 2010-03-25  3:20 UTC (permalink / raw)
  To: Johann Klähn; +Cc: sup-devel

Excerpts from Johann Klähn's message of 2010-03-24 22:21:32 -0400:
> I was having problems with encoded emails. Using archlinux / ruby
> 1.9.1_p378 Iconv.iconv returns the encoding ASCII_8BIT,
> which was rejected by String.check.
> 
> Before I was getting debug messages like this when converting mails or
> building the index:
>  couldn't transcode text from ISO-8859-1 (ISO-8859-1) to utf8) (...)
> (got unexpected encoding ASCII-8BIT (String::CheckError))
> My String.check now contains:
>   if respond_to?(:encoding) && !(encoding == Encoding::UTF_8 ||
> encoding == Encoding::ASCII || encoding == Encoding::ASCII_8BIT)
> And everything is working as expected. Instead of text.ascii the real
> umlauts are displayed.
> 
> Hope that helps,
> Johann

An ASCII_8BIT string means there's a bug in sup. Please add an assertion
so that the program exits when the encoding is ASCII_8BIT and post the
backtrace. Also, what sup version is this?
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [sup-devel] Accept ASCII_8BIT in String.check
  2010-03-25  3:20   ` Rich Lane
@ 2010-03-25  8:02     ` Johann Klähn
  0 siblings, 0 replies; 3+ messages in thread
From: Johann Klähn @ 2010-03-25  8:02 UTC (permalink / raw)
  To: sup-devel

Ah, now it's perfectly clean to me, I guess I just shouldn't do any debugging
when I'm too tired.
The problem is that the call to Iconv.iconv(target, ..., ...) in
Iconv.easy_decode
expects target to be typed as "UTF-8", and my environment has
$encoding = "utf8".
Iconv can't handle this and thus returns ASCII_8BIT (does no real conversion).
(I'm using sup 0.11 with ruby 1.9.1_p378.)
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-25  8:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <b0bc07101003241915t22d13ea2w26468d9d72df972f@mail.gmail.com>
2010-03-25  2:21 ` [sup-devel] Accept ASCII_8BIT in String.check Johann Klähn
2010-03-25  3:20   ` Rich Lane
2010-03-25  8:02     ` Johann Klähn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox