Aug. 31st, 2019

victor_sudakov: (Default)
Изначально мои репозитории с текстами создавались ещё в CVS и в кодировке KOI8-R. Потом были экспортированы в SVN и Mercurial, но кодировка текстов осталась KOI8-R.

Появилось желание перекодировать тексты в Unicode, вместе с их историей, как будто они изначально были в Unicode. В рассылке mercurial@mercurial-scm.org Steve Fink дал мне расширение к расширению convert, которое это позволяет.
No promises, but you could give this a try: https://hg.sr.ht/~sfink/cmdconvert

Clone it to somewhere like ~/lib/hg. Add

    [extensions]
    cmdconvert = ~/lib/hg/cmdconvert

to your ~/.hgrc (or hgrc.ini or whatever it is on Windows.)

Then try running

    hg convert --command 'iconv -f KOI8-R -t UTF-8' your_repo new_repo

Odds of it working on the first try are somewhat low (I don't really know what
I'm doing.)

If you want to restrict by file extension, do something like

    hg convert --ext .txt --ext .html --command 'iconv -f KOI8-R -t UTF-8' your_repo
new_repo

It's not going to be fast, either.

Сработало прекрасно.

Profile

victor_sudakov: (Default)
Виктор Судаков

November 2025

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 14th, 2025 02:33 pm
Powered by Dreamwidth Studios