ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: "Aleksander N.Gorohovski" <angel@feht.dgtu.donetsk.ua>
To: "ALT Linux Community general discussions" <community@lists.altlinux.org>
Subject: Re: [Comm] Нужно пакетное переименование файлов на транслит.
Date: Fri, 01 Feb 2008 22:08:23 +0200
Message-ID: <op.t5u3j9t5mb8vzs@oc.peooc.net> (raw)
In-Reply-To: <200802012124.44587.andrew.klepcha@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]


Посмотрите в атаче мои наброски.
:)

Правда сделано для KOI8-R
поэтому  перекодируйте входящую в скрипт таблицу-кодировки

iconv

по вкусу.
:)

Да.
программа работает рекурсивно.


On Fri, 01 Feb 2008 21:24:44 +0200, Andrew G. Klepcha  wrote:

> В сообщении от Friday 01 February 2008 12:13:18 Peter V. Saveliev  
> написал(а):
>> В сообщении от Friday 01 February 2008 11:48:35 Kudashev Mike  
>> написал(а):
>> > Какими средствами можно переименовывать файлы с русского на транслит?
>>
>> сначала имя файла переводить в koi8-r, а потом отрезать бит:
>>
>> [peet@kelisaari peet]$ echo бала не дала | iconv -f utf-8 -t koi8-r |
>> ./bala.py BALA NE DALA
>>
>> [peet@kelisaari peet]$ cat bala.py
>> #!/usr/bin/python
>> import sys
>> r = ""
>> for i in sys.stdin.read():
>>         r += chr(ord(i) & 127)
>> print r,
>>
>>
>> Ну, для эстетики можно ещё кейс поменять местами.
>
> некошерно бит отрезать. что будет если встретятся разные щ,я,ё и т.п.?
> помнится были решения в сети на эту тему...
> вот например:
> http://mf.volsu.ru/pipermail/10-10/2005-August/005278.html
> _______________________________________________
> community mailing list
> community@lists.altlinux.org
> https://lists.altlinux.org/mailman/listinfo/community


[-- Attachment #2: translit.pl --]
[-- Type: application/octet-stream, Size: 1607 bytes --]

      reply	other threads:[~2008-02-01 20:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-01  8:48 Kudashev Mike
2008-02-01 10:13 ` Peter V. Saveliev
2008-02-01 19:24   ` Andrew G. Klepcha
2008-02-01 20:08     ` Aleksander N.Gorohovski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.t5u3j9t5mb8vzs@oc.peooc.net \
    --to=angel@feht.dgtu.donetsk.ua \
    --cc=community@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git