[Alpine-info] using w3m to view HTML attachments is pretty nice

Mike Miller mbmiller+l at gmail.com
Sat May 21 12:34:46 PDT 2011


On Sat, 21 May 2011, Werner Scheinast wrote:


> On 20.05.11 Mike Miller wrote:

>

>> It can display pictures in an xterm? I thought that was impossible.

>

> Try it! It seems to work only in xterm. Other terminal emulators are too

> poor in functionality.


Wow. This is amazing. It didn't work for me at first, but I found I
needed to install w3m-img. I used Synaptic on Ubuntu to install w3m-img,
and then it worked. Here's a screen shot of my web page in an xterm:

http://mlug.missouri.edu/~mbmiller/pics/misc/w3m_screenshot.png

This was the command:

w3m http://mlug.missouri.edu/~mbmiller/

But the image didn't just appear. I hit 'h' and it appeared. I don't
know why I had to hit the 'h' key (I was going to go to "help").

I used to think that was impossible, so now I'm wondering if PuTTY on
Windows connected to the Ubuntu box by SSH can do this. That seems
impossible, too, but I have to rethink what is possible until I understand
this better.



> w3m is the only program with this capability. But don't ask me how they

> do it. Unfortunately, w3m is poorly documented. Feel like reading the

> source code?


I almost want to! I think w3m-img would also be necessary.



>> Thanks for pointing this out. To clarify: I didn't use cut/paste in

>> the xterm. I used pipe to filter the attachment through w3m and into a

>> file:

>>

>> w3m -dump -cols 74 -T text/html > html_attachment.txt

>

> This outputs UTF-8 text to the file. (I tested.)

>

>> Then in the Alpine composer (Pico under the hood, I guess) I used ^R to

>> bring in the html_attachment.txt file where I deleted some lines using

>> ^K. I don't know if that matters, but it was "Read File" and not paste

>> that brought the table into the message.

>

> I manually decoded the base64 block in your message. It is not UTF-8.

> The box drawing characters are single bytes (0x80, 0x86, 0x87, 0x8a

> etc.), no UTF-8 sequences.

>

> As I read about Alpines behaviour, it "minimizes" the character set,

> i.e. it finds the smallest character set sufficient for the message to

> send. For some strange reason it chose KOI8-R. Okay, I begin to

> understand. The Alpine mailing list software then packs each non-ASCII

> message in a multipart format, the first part base64-encoded, the second

> part only some mailing list information in US-ASCII.

>

> This is probably correct. But then there is a bug in pico which gets

> confused with the box drawing characters when I want to edit the message

> for reply. Can anybody acknowledge this? Try to reply on Mikes first

> post and edit the text with the table.


Replying to my own message works for me, but that copy was the one Alpine
stored locally, not something that came to me through the list.



>> Regarding the "bug in Mike" question -- it is quite possible that I

>> have a bad setting somewhere. I would ike to find out. What do I need

>> to do? These are my locale settings:

>

> You have generally UTF-8, which is usual today.

>

>> LC_COLLATE=C

>

> (I also prefer this. All others are just not bearable.)

>

>> The following lines are from my ~/.pinerc file. The "character-set"

>> setting of "ISO-8859-1" surprises me a little because I thought I had

>> UTF-8 settings all over. But I know there was some discussion on this

>> list about it, so maybe these settings are correct...

>

> Is this setting not obsolete? AFAIK there are only display-, keyboard-,

> posting-, and unknown-character-set.


I hope someone else will answer this because I have no idea.



> Could you tell me the details of this (my) post here? I include now some

> Russian letters: АБВГДЕЖЗИ


Those look like Russian letters here in my xterm.



> And I send it both to the ML and directly to you. How is it encoded in

> the latter case? (The former I see myself.)


When I look at View for attachment info, I see this:

Text/PLAIN (charset: KOI8-R "Latin & Russian")



> Have a nice Sunday


It's still Saturday here! Also it's Judgment Day, or so I'm told.
Rapture is due here in about 3.5 hours, so it must have happened already
where you are. ;-)

Mike


More information about the Alpine-info mailing list