Discussion:
weird appearance of Chinese email in pager
Yubin Ruan
2018-03-09 00:34:28 UTC
Permalink
Hi, I am writing to ask if anyone have any solution for properly formating
mails in Chinese in the pager. I am using the builtin pager but it seems to
not be able to calculate the width of Chinese characters. It tend to take a
whole line of Chinese characters as just one unit, and when it is too long,
this whole line is shown in a second line, which make the appearance ugly:

+------------------------------------------------------------------------+
|这是一个例子, |
|这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子|
|这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子|
|这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子|
| |
| ... |
| |
+------------------------------------------------------------------------+

You see, the second line should begin from where the first line ends, but now
it is just chopped as a whole...

VIM used to have this problem, but it can be solved by "set ambiwidth=double".
Does mutt has similar option?

I guess this is due to my local configuration, as my local is entirely in
English. But I don't know the local things that much, so I don't know how to
configure it properly.

Thanks,
Yubin
Yubin Ruan
2018-03-09 01:31:21 UTC
Permalink
Post by Yubin Ruan
Hi, I am writing to ask if anyone have any solution for properly formating
mails in Chinese in the pager. I am using the builtin pager but it seems to
not be able to calculate the width of Chinese characters. It tend to take a
whole line of Chinese characters as just one unit, and when it is too long,
+------------------------------------------------------------------------+
|这是一个例子, |
|这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子|
|这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子|
|这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子|
It renders Ok for me; I see
这是一个
at the beginning of each line.
Oh - I think I see what you're saying; if it's a single long string,
这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子
Mutt can't infer any boundaries, and so doesn't wrap it?
Exactly.

Yubin
Yubin Ruan
2018-03-09 02:03:53 UTC
Permalink
Post by Yubin Ruan
Oh - I think I see what you're saying; if it's a single long string,
这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子
Mutt can't infer any boundaries, and so doesn't wrap it?
Exactly.
Do you have $wrap set to a value, or to 0?
set wrap=72
works for me, however, you might then have problems with other things
breaking (long links, and such)
set wrap=72 will only force wrapping long line, but it does not solve the
continuation problem. For example, check this very long line:

长长。这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子......这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子(shit ! very long line),这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子

note there is only one line above, and I want the line to show as it is.

Yubin
Patrick Shanahan
2018-03-08 02:20:37 UTC
Permalink
Post by Yubin Ruan
Post by Yubin Ruan
Oh - I think I see what you're saying; if it's a single long string,
这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子
Mutt can't infer any boundaries, and so doesn't wrap it?
Exactly.
Do you have $wrap set to a value, or to 0?
set wrap=72
works for me, however, you might then have problems with other things
breaking (long links, and such)
set wrap=72 will only force wrapping long line, but it does not solve the
长长。这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子......这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子(shit ! very long line),这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子
note there is only one line above, and I want the line to show as it is.
you realize you can set the pager to something outside mutt such as "less"
in a terminal

see man muttrc
--
(paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri
http://en.opensuse.org openSUSE Community Member facebook/ptilopteri
Registered Linux User #207535 @ http://linuxcounter.net
Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode
Yubin Ruan
2018-03-09 02:40:16 UTC
Permalink
Post by Patrick Shanahan
Post by Yubin Ruan
Post by Yubin Ruan
Oh - I think I see what you're saying; if it's a single long string,
这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子这是一个很长的句子
Mutt can't infer any boundaries, and so doesn't wrap it?
Exactly.
Do you have $wrap set to a value, or to 0?
set wrap=72
works for me, however, you might then have problems with other things
breaking (long links, and such)
set wrap=72 will only force wrapping long line, but it does not solve the
长长。这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子......这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子(shit ! very long line),这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子,这是一个很长的句子
note there is only one line above, and I want the line to show as it is.
you realize you can set the pager to something outside mutt such as "less"
in a terminal
see man muttrc
Yes, I can even use vim as the pager. But that is not clean...

Yubin

Loading...