Emacs для начинающих


Tutorial-e - часть 4


From UNIX to DOS : -koi +alt -cr2crlf

From windows to UNIX : -win +koi -crlf2cr

From UNIX to windows : -koi +win -cr2crlf

From DOS to windows : -alt +win

From windows to DOS : -win +alt

 Probably most often tasks is converting text from UNIX to DOS, from UNIX to windows and back. Converting between DOS and windows styles usually unnecessary - for windows texts you can use Notepad, for DOS texts use can you old DOS file managers like Norton Commander.

 It is not good idea to type every time this sets of flags. So you can use abbreviations:

-dos2unix - the same as '-alt +koi -crlf2cr' -unix2dos - the same as '-koi +alt -cr2crlf' -win2unix - the same as '-win +koi -crlf2cr' -unix2win - the same as '-koi +win -cr2crlf'

 This abbreviations are usefull but and they are long enough. So you can cut them:

-d2u - the same as '-dos2unix' -u2d - the same as '-unix2dos' -w2u - the same as '-win2unix' -u2w - the same as '-unix2win'

rusconv -w2u index.html

** rusconv -- convertor of Russian codepages, v.3.11. ** (c)w_re -- Oleg A. Paraschenko http://beta.math.spbu.ru/~prof/w_re/ .\index.html -> .\index.koi: ok. 1 file(s) converted.

 


File overwriting.

 When converting, rusconv creates new files. But sometimes you don't need them or you wish only replace encoding in specified file. In this case use flag '-o'. Then rusconv for begin creates temporary file where results of recoding will be placed and then moves this temporary file on place of source. If any error occurs then source file will be unchanged and temporary file will be contain text converted before error.

 Example:

D:\HTML>rusconv -o -w2u index.html

** rusconv -- convertor of Russian codepages, v.3.11. ** (c)w_re -- Oleg A. Paraschenko http://beta.math.spbu.ru/~prof/w_re/ .\index.html -> D:\HTML\rcA290.TMP -> .\index.html: ok. 1 file(s) converted.

 


Converting to several encodings and specifing own extensions for files.

 Sometimes, especially when you create web site, file should be converted to several encodings. For example, you write HTML pages in DOS but your homepage is in windows and KOI encodings. You can run rusconv twice but better do so:




- Начало -  - Назад -  - Вперед -



Книжный магазин