Re: Bug report: display bug with accented characters and completion menu

2007-03-24 Thread Gombault Damien
 A few questions:

 - What is 'encoding' set to?
 - What is the actual text in the entries with problems?  Give this
   byte-for-byte.  You may need to insert an entry to find out.
 - Can you reproduce it by setting 'omnifunc' to a simple function that
   returns a fixed list of text entries?  If so, please give us the
   script with this.  Otherwise, give us a text file to reproduce the
   problem.
 - The entries in the menu appear not to be sorted.  How did this happen?
 - What did you type to get to these screenshots?

My system is UTF-8, so 'encoding' is also set to 'utf-8'. On the screenshot, 
the file was wrotten in 'latin1' charset.

After some tests, I noticed this bugs seems only appears when 'encoding' 
and 'fileencoding' are not the same. Finally, I could get this bug on win32 : 
I set 'encoding' to 'utf-8' then open some 'latin-1' files.

I wrote two very simple C++ file to help you to reproduce the bug. These two 
files are written in 'latin1' charset. Their content is simple C++ comments 
containing French text with accented characters like é, è, à, etc.

Put the two files in the same directory.
Then open gvim and set your 'encoding' to 'utf-8'.
Edit the '2.cpp' file.
Verify that 'fileencoding' is set to 'latin1'.
Insert a new line between #include and the begin of the /* comment. (o key)
Then type CTRL+x CTRL+i and the include completion menu appears like this :
http://img131.imageshack.us/img131/4117/vim5ls3.png

Another test : 
'encoding' = latin1 and utf-8 texts, you get this :
http://img78.imageshack.us/img78/483/vim6nt2.png
Accents are not correctly displayed.

The completion menu uses 'encoding' to display its text.
When you edit a file, the buffer is converted to the current encoding (the 
[converted] message). When you use the completion menu with current buffer 
words, accented characters will be correctly displayed.

But if you use completion menu with words in other files (like with include 
completion) with a different fileencoding than your current buffer encoding, 
accented characters will not be displayed correctly because they are not 
converted to the current encoding.

So words from other files should be converted to the current buffer 'encoding'  
before display them in the completion menu. That will certainly fix this 
problem.

Regards.
-- 
Gombault Damien | Powered by Gentoo Linux AMD64


texts.tar.gz
Description: application/tgz


Re: Bug report: display bug with accented characters and completion menu

2007-03-24 Thread Gombault Damien
Another test with 3 files :
   1.cpp : UTF-8 file with French accented characters.
   2.cpp : the same file but with Latin-1 charset.
   3.cpp : a file to test 'include' completion.

Yes, it's a bit strange because it's not a great idea to work with different 
encodings. But it shows the problem. :)

Put the 3 files in the same directory.
Run Gvim, set your 'encoding' to 'latin1'.
Edit 3.cpp file.
Type, before the comment, CTRL-x CTRL-i for 'include' completion. Words 
from 1.cpp are not displayed in the completion menu because words are not 
converted to the current encoding.

Run Gvim, set your 'encoding' to 'utf-8'.
Edit 3.cpp file.
Type, before the comment, CTRL-x CTRL-i for 'include' completion. Words 
from 2.cpp are displayed but you have a display bug with the completion 
menu because words are not converted to the current encoding. 

Regards.
-- 
Gombault Damien | Powered by Gentoo Linux AMD64


another_test.tar.gz
Description: application/tgz