1 |
El Wed, Jul 27, 2005 at 09:04:29AM +0300, Moshe Kaminsky me decía: |
2 |
> * Fernando Canizo <conan@××××××××××.ar> [27/07/05 07:15]: |
3 |
> > |
4 |
> > Hi all. |
5 |
> > |
6 |
> > I'm having trouble with my encoding using mutt + vim + utf-8, |
7 |
> > basically mi emails are sent with wrong encoding when *replying*. I've |
8 |
> > tracked the problem, searched, readed FAQs and i found that maybe my |
9 |
> > problem is this: that while mutt is linked to libncursesw (wide |
10 |
> > library) vim is to libncurses (normal), this is the output of ldd: |
11 |
> |
12 |
> I find it hard to believe that this is the problem. You say that you can |
13 |
> use utf8 when you are composing (or writing some other stuff), right? |
14 |
> What are the values of 'encoding' and 'fileencoding' in vim when |
15 |
> replying? |
16 |
> Moshe |
17 |
|
18 |
Like i said to Richard, maybe you're right. I mean: i can write an |
19 |
utf-8 file from scratch using vim alone, so why would not when |
20 |
invoking vim from mutt? Maybe is that mutt is telling vim something |
21 |
incorrect when they communicate. |
22 |
|
23 |
Well, i'll give more information, but this gonna grow large ;) |
24 |
|
25 |
Reading the mutt FAQ (http://wiki.mutt.org/index.cgi?MuttFaq/Charset) |
26 |
and checking everything is ok: |
27 |
|
28 |
locale seems to be ok: |
29 |
~$ locale |
30 |
LANG=es_AR.utf-8 |
31 |
LC_CTYPE="es_AR.utf-8" |
32 |
LC_NUMERIC="es_AR.utf-8" |
33 |
LC_TIME="es_AR.utf-8" |
34 |
LC_COLLATE="es_AR.utf-8" |
35 |
LC_MONETARY="es_AR.utf-8" |
36 |
LC_MESSAGES="es_AR.utf-8" |
37 |
LC_PAPER="es_AR.utf-8" |
38 |
LC_NAME="es_AR.utf-8" |
39 |
LC_ADDRESS="es_AR.utf-8" |
40 |
LC_TELEPHONE="es_AR.utf-8" |
41 |
LC_MEASUREMENT="es_AR.utf-8" |
42 |
LC_IDENTIFICATION="es_AR.utf-8" |
43 |
LC_ALL=es_AR.utf-8 |
44 |
|
45 |
the locales settings are supported: |
46 |
~$ locale -a |
47 |
C |
48 |
es_AR |
49 |
es_AR.utf8 |
50 |
POSIX |
51 |
|
52 |
checking if the locales work with perl: |
53 |
~$ perl -e "" |
54 |
ok doesn't show anything |
55 |
|
56 |
checking if perl is doing the right things by setting an erroneous |
57 |
locale: |
58 |
~$ env LC_ALL=nocharset perl -e "" |
59 |
perl: warning: Setting locale failed. |
60 |
perl: warning: Please check that your locale settings: |
61 |
LANGUAGE = "es_AR.utf-8", |
62 |
LC_ALL = "nocharset", |
63 |
LC_CTYPE = "es_AR.utf-8", |
64 |
LANG = "es_AR.utf-8" |
65 |
are supported and installed on your system. |
66 |
perl: warning: Falling back to the standard locale ("C"). |
67 |
|
68 |
ok, it cries, so it's working ok |
69 |
|
70 |
my ~/.signature is in utf-8, my ~/.alias is too |
71 |
|
72 |
i got this in my ~/.vimrc: |
73 |
set encoding=utf-8 |
74 |
set fileencoding=utf-8 |
75 |
set termencoding=utf-8 |
76 |
|
77 |
and when mutt invokes vim i re-check that this is ok, and is ok (i |
78 |
mean i check in runtime and it obbeys the configuration) |
79 |
|
80 |
i got this in my ~/.muttrc: |
81 |
set send_charset="us-ascii:utf-8" |
82 |
set charset="utf-8" |
83 |
set locale="es_AR.utf8" |
84 |
|
85 |
from the mutt man i know this settings should not be necessary, since |
86 |
the system is configured ok, but i try with and without and get no |
87 |
difference. |
88 |
|
89 |
Ok, that's all concerning configuration. Now i tell you how the |
90 |
problem works: in mutt, if i compose a mail from scratch, without |
91 |
anything, not even signature, and put a LATIN SMALL LETTER A WITH |
92 |
ACUTE (got that name from unicode chart), and then send it to myself, |
93 |
and to a friend, my friend sees it ok and i too. |
94 |
|
95 |
But if now i reply to this same mail, when vim comes with the quoted |
96 |
text that mutt passes to it y see garbage. |
97 |
|
98 |
So mutt is ok seeing and sending utf-8, vim is ok writing and reading |
99 |
utf-8, but when both "cooperate", things get screwed. |
100 |
|
101 |
I investigate what was in the archives, so i saved a copy (using 'C' |
102 |
command from mutt) of the first message (the one i receive from me) |
103 |
and file says: 'UTF-8 Unicode mail text', check what's inside with |
104 |
hexedit and see that LATIN SMALL LETTER A WITH ACUTE is encoded with |
105 |
this hex: C3 A1 (which is not 00 E1 from unicode chart from |
106 |
http://www.unicode.org/charts/) |
107 |
|
108 |
Then i got that same mail and press 'r' from mutt to respond, comes |
109 |
vim with garbled text, and without touching anything i save it under |
110 |
some other name, and then cancel message, file in this saved text |
111 |
gives me: 'UTF-8 Unicode text', but when i see inside with hexedit, i |
112 |
got this hex for the same letter: C3 83 C2 A1, so now i have 4 bytes |
113 |
instead of the too before. So vim-mutt (?) is re-encoding the stuff. |
114 |
|
115 |
Like i said before, checking in vim when called from mutt for enc, and |
116 |
fenc gives utf-8 like it should. |
117 |
|
118 |
I create a file with vim to check this differences with the unicode |
119 |
chart and i got C3 A1 too, so maybe the problem is with vim, it should |
120 |
put 00 E1 for LATIN SMALL LETTER A WITH ACUTE. |
121 |
|
122 |
Well, that's all i remember to have done for this problem. I'm with |
123 |
this for 4 months now, i think, i took the problem, get tired of |
124 |
searching and testing stuff, leave for a month, get to charge again, |
125 |
and so on. But now i really want to solve it. |
126 |
|
127 |
I think i'm going to crosspost this to vim and mutt mailing lists. But |
128 |
if someone here knows how to solve this, i appreciate any help, tip, |
129 |
direction to look or search, or maybe praying would do the job. |
130 |
|
131 |
Linking after build vim to libncursesw the way Richard say a couple of |
132 |
mails before didn't solve it. If there is a way to say to emerge that |
133 |
link vim to this library from the beginning i would like to try it. |
134 |
|
135 |
Besides if anyone knows how to get which programs are using a library |
136 |
(i have done it before, but at this time my brain is screwed). |
137 |
|
138 |
What i didn't tried yet is 'the redmond way', i want to stay away from |
139 |
that metod, if possible. |
140 |
|
141 |
Thanks in advance. |
142 |
|
143 |
-- |
144 |
Fernando Canizo - LUGMen: www.lugmen.org.ar - A8N: a8n.lugmen.org.ar |
145 |
Antonym, n.: |
146 |
The opposite of the word you're trying to think of. |
147 |
-- |
148 |
gentoo-user@g.o mailing list |