2009/11/26 Bram Moolenaar <[email protected]>: > > Yongwei Wu wrote: > >> The help on iconv() writes: >> >> When the conversion fails an empty string is returned. >> >> In fact, I have not found a way to make the conversion fail. >> >> When a file containing the following text encoded in cp936 is read in >> Vim as euc-jp, Vim complains "[CONVERSION ERROR in line 1]": >> >> TV $B%"%K%a (B $BCh$N$^$K$^$K (B ED $B%F!<%...@16}$n%5%i%&%s%I!W!? (BCooRie >> >> However, when one tries to get the failure from an iconv call, the >> error is never got: >> >> (:set encoding=utf-8) >> :echo iconv(iconv('TV $B%"%K%a (B $BCh$N$^$K$^$K (B >> ED $B%F!<%...@16}$n%5%i%&%s%I!W!? >> (BCooRie','utf-8','cp936'),'euc-jp','utf-8') >> TV $B%"%K%a (B $BVf$N$^$K$^$K (B ED $B%F (B??` $B%^!8PGP<$N%5%i%&%s%I!9 >> (B????CooRie >> >> Any ideas? Is there a bug, or some issues with the help? >> >> This behaviour is reproduced on Windows, Mac OS X, and Linux. >> >> If the iconv call returned an empty string, it could be used in a >> plug-in to detect a mistake in guessing the encoding. > > I can't reproduce the problem. The example you give appears to be valid > text. You mention it's cp936, but the mail was sent as iso-2022-jp. > Can you attach a file with the text containing the illegal byte > sequence?
GMail automatically set the encoding, but I did not notice it at all since I work in the GUI, where the message encoding does not make a difference. Anyway, I am attaching it too. -- Wu Yongwei URL: http://wyw.dcweb.cn/ --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
TVアニメ 宙のまにまに EDテ�`マ「星屑のサラウンド」/CooRie
