[Comm] Vi и кодировки

Andrew Borodin =?iso-8859-1?q?borodin_=CE=C1_zarya-k=2Eru?=
Ср Дек 31 12:36:50 MSK 2003


On Mon, Dec 29, 2003 at 04:57:56PM +0300, Alexej Kryukov wrote:
> therion wrote:
> 
> >В сообщении от 29 Декабрь 2003 13:57 Alexej Kryukov написал(a):
> > 
> >
> >>В принципе, перекодировку организовать несложно...
> >>Кто-то здесь предлагал даже готовый скрипт для этой цели.
> >>   
> >>
> >Хм... интересно, был бы очень полезен, если вдруг попадется, то буду 
> >благодарен. Он что же, перерывает весь винд и ищет русские имена?
> > 
> >
> 
> Ну, по логике вещей надо делать рекурсивный обход текущего каталога.
> *Весь* винт -- это было бы явно излишне. В принципе, логика-то ведь
> понятная... Получаем имя файла, транслируем его при помощи iconv,
> потом делаем mv old_name new_name... Такое любой может написать,
> разве что один потратит пару часов, а другой -- 10 минут :-)
> 

  http://freshmeat.net/projects/convmv/

  convmv converts filenames (not file content), directories, and even
  whole filesystems to a different encoding. This comes in very handy
  if, for example, one switches from an 8-bit locale to an UTF-8 locale.
  It has some smart features: it automagically recognises if a
  file is already UTF-8 encoded (thus partly converted
  filesystems can be fully moved to UTF-8) and it also takes
  care of symlinks. Additionally, it is able to convert from
  normalization form C (UTF-8 NFC) to NFD and vice-versa. This
  is important for interoperability with Mac OS X, for example,
  which uses NFD, while Linux and most other Unixes use NFC.
  Though it's primary written to convert from/to UTF-8 it can
  also be used with almost any other charset encoding. Note that
  this is a command line tool which requires at least Perl
  version 5.8.0.

  С уважением,
  А. Бородин.




Подробная информация о списке рассылки community