(07/20/09 20:49), Tony Mechelynck-san wrote:
> Won't Vim +iconv accept any charset known by your installed version of
> iconv, even charsets not compiled into Vim? You can list them (at least

I'm not sure if I understand 'Vim +iconv' exactly however 'vim --version' shows 
'+iconv' in my env.

% env vim --version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jul  8 2009 16:34:32)
Included patches: 1-148
Huge version without GUI.  Features included (+) or not (-):
... +iconv ...

The problem is:
1. Invoke vim windows-31j-text.txt
2. Invoke ':set fileencoding=windows-31j' on vim screen.

Then vim cannot show the WINDOWS-31J text.
After I applied my patch, vim can show the contents correctly.

> if you have a posix-compliant iconv executable in addition to the iconv
> shared library) by means of "iconv -l" (pipe the output into more or
> less since there are a lot of them) or maybe, in Vim, ":new | 0r !iconv
> -l".

Yes, 'iconv -l' shows the correct encodings.
However vim has the hard-coded charset table in itself as I attached the patch.

>
> Most of the charsets you want are already accepted by my iconv version;
> the exceptions are two Sun encodings (with no equivalents that I can
> see) and cswindows31j for cswindows-31j, ms_kanji for ms-kanji.
>
> I'm appending a small file containing a paragraph from jp.wikipedia.org
> which I saved in "cseucpkdfmtjapanese" encoding in gvim 7.2.234 after
> removing HTML formatting. I suppose you could do
>
> :view ++enc=cseucpkdfmtjapanese pkdfmt.txt

When I applied my patch, this line can shows the charset correctly in my env.
I cannot show the content of pkdfmt.txt correctly without my patch.

>
> in gvim to see if it is proper Japanese. In any case it is not UTF-8,
> and it looks like gibberish in Latin1, but the above ex-command gives me
> what "looks" to me (the illiterate Westerner) as Japanese writing.
>
>
> Personally, I would rather trust iconv than your statement that, let's
> say, "shift-jisx0213 is not cp932 exactly but making it an alias would
> help".

My iconv is 2.10.1
% iconv --versoin
iconv (GNU libc) 2.10.1

My understanding is vim has the table enc_canon_table[] in src/mbyte.c .
If we add a new codepage DBCS_JPN_SHIFT_JIS0213 in the table, we will need the 
furthermore investigations.
I mean the suggestion of my patch can work with a lot of code points at the 
moment without changing more source codes.

Thanks,
fujiwara

>
> FWIW, this is what I get in answer to "iconv --version":
>> iconv (GNU libc) 2.9
>> Copyright (C) 2008 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions. There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
>> PURPOSE.
>> Written by Ulrich Drepper.
>
>
> Best regards,
> Tony.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui