dos2unix-7.3.4/0000755000175500010010000000000012721132613012545 5ustar waterlanGeendos2unix-7.3.4/bcc.mak0000644000175500010010000000275012721132543013774 0ustar waterlanGeen!include version.mk CC = bcc DEFINES = -DVER_REVISION="$(DOS2UNIX_VERSION)" -DVER_DATE="$(DOS2UNIX_DATE)" CFLAGS = $(DEFINES) -Z -O -w -mc -1 WILDARGS = c:/bc4/lib/16bit/wildargs.obj all: dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe dos2unix.exe: dos2unix.obj querycp.obj common.obj bcc -mc dos2unix.obj querycp.obj common.obj $(WILDARGS) noehc.lib unix2dos.exe: unix2dos.obj querycp.obj common.obj bcc -mc unix2dos.obj querycp.obj common.obj $(WILDARGS) noehc.lib # remove noehc.lib if you are using Borland C version prior # to 4.0. noeh?.lib, where ? stands for the memory model, # removes the C++ exception handling from the startup-code # which is included by default since Borland 4.0 and # higher. Including noeh?.lib reduces the executable size # significant, provided your source is C only. #.c.obj: # $(CC) -c $(CFLAGS) $< dos2unix.obj : dos2unix.c dos2unix.h querycp.h common.h $(CC) -c $(CFLAGS) -o$@ dos2unix.c unix2dos.obj : unix2dos.c unix2dos.h querycp.h common.h $(CC) -c $(CFLAGS) -o$@ unix2dos.c querycp.obj : querycp.c querycp.h querycp.h $(CC) -c $(CFLAGS) -o$@ querycp.c common.obj : querycp.c querycp.h common.h $(CC) -c $(CFLAGS) -o$@ common.c mac2unix.exe: dos2unix.exe copy /v dos2unix.exe mac2unix.exe unix2mac.exe: unix2dos.exe copy /v unix2dos.exe unix2mac.exe strip : tdstrip dos2unix.exe tdstrip unix2dos.exe tdstrip mac2unix.exe tdstrip unix2mac.exe clean: del *.obj del *.exe dos2unix-7.3.4/BUGS.txt0000644000175500010010000000102412721132543014045 0ustar waterlanGeenKNOWN BUGS querycp.c: query_con_codepage() The DOS 16 and 32 bit versions compiled with OpenWatcom report a wrong active code page under Windows 98. A correct code page is reported under FreeDOS. REPORTING BUGS Report bugs at the dos2unix SourceForge page http://sourceforge.net/projects/dos2unix/ Bugs tracker: http://sourceforge.net/p/dos2unix/bugs/ Also patches and feature requests can be entered under the "Tickets" tab. or send an email to Erwin Waterlander dos2unix-7.3.4/ChangeLog.txt0000644000175500010010000016123512721132543015147 0ustar waterlanGeen2016-05-24 Erwin Waterlander * Version 7.3.4 * djgpp.mak: Fix targets install and dist by setting SHELL variable. 2016-05-03 Erwin Waterlander * common.c: Fix malloc() check in glob_warg(); 2016-05-02 Erwin Waterlander * common.c: Cleanup d2u_mktemp and MakeTempFileFrom(). 2016-04-30 Erwin Waterlander * common.c: New function d2u_mktemp(). Wrapper for mktemp() that uses GetTempFileName() on Windows. Use of mktemp() is not safe. * common.h: Use mktemp wrapper also for Watcom C on Windows. Now dos2unix built with Watcom C can also support Unicode file names on Windows. * wcc*.mak, wcc.mif: Enable Unicode file name support for Watcom C. * wcc*.mak, wcc.mif, vc.mak: Allow use of DEBUGMSG. * common.c, dos2unix.c, unix2dos.c: Fix compilation for Watcom C. Reducing scope of some variables (done on 2016-03-19) led to compile errors for Watcom C. Watcom C supports only declaration of variables at the beginning of a scope. 2016-04-29 Erwin Waterlander * common.c: Code cleanup. Simplify use of MakeTempFileFrom(). 2016-04-15 Erwin Waterlander * djgpp.mak: Extra comment for DJGPP 2.05. Extra variable CROSS_COMP. * INSTALL.txt: Extra info for DJGPP. 2016-03-28 Erwin Waterlander * INSTALL.txt: Mention that MSYS(2) is required for building with MinGW(-w64). 2016-03-19 Erwin Waterlander * *.c: Fix all cppcheck warnings. 2016-02-16 Erwin Waterlander * djgpp.mak: Support cross compilation from Cygwin. 2016-02-13 Erwin Waterlander * Version 7.3.3 2016-02-10 Erwin Waterlander * common.c: Don't print FILE column of header in stdio mode. 2016-02-05 Erwin Waterlander * common.c: Fix. Dos2unix was not quiet in all cases when option -q was used. 2016-02-04 Erwin Waterlander * common.c: Changed header for column text/binary to TXTBIN. 2016-02-02 Erwin Waterlander * common.c: New flags for options -i, --info. Flag h : print a header. Flag p : show file names without path. Thanks to Alan S. Jones. 2016-01-31 Erwin Waterlander * Makefile: Don't package international man pages when ENABLE_NLS is empty. 2016-01-29 Erwin Waterlander * Makefile: Don't install international man pages when ENABLE_NLS is empty. Thanks to anonymous. 2016-01-28 Erwin Waterlander * man/*/man1/dos2unix.po: Moved all manual .po file to directory po-man/. The .po files now have their original name. * Makefile, man/man1/Makefile: Build international manuals from the .po files in folder po-man/. 2016-01-20 Erwin Waterlander * common.c: Fixed printing text in unicode UTF-16 mode on Windows, so that when it is redirected to a file, a correct UTF-16 file is created. Thanks to Hans Passant. * common.c: Added display encoding methods "unicodebom" and "utf8bom". These methods add a BOM to stdout, which is required for correct redirection in PowerShell. * man/man1/dos2unix.pod: Updated manual for option -D. * test/testps16.ps1, test/testps8.ps1: Fixed select-string test. 2016-01-16 Erwin Waterlander * *.c: Fixed printing of East-Asian ANSI multi-byte encoded text on Windows with an East-Asian regional setting. It appears that when setlocale() sets the locale to "" in the beginning of main(), which is done for gettext translations, multi-byte ANSI is printed wrongly. On windows we need to set the locale to "C" to make East- Asian text printed correctly. On Unix setting the locale to "C" would disable the gettext translations, but on Windows it keeps working. * test/setlocale.c: New test program that proves that setlocale(LC_ALL, "") breaks printf() on Windows for Chinese CP936 encoded text in a CP936 regional setting, and for UTF-8 text. * test/setlocale.png: Example output of the test program. * common.h, *.c: Created macro D2U_FPRINTF, for correct printing of text when Unicode file names support is disabled. 2016-01-13 Erwin Waterlander * *.c: Use d2u_ansi_fprintf() for printing the help text, version information and license. It appears that printing Chinese text properly in a Windows Command Prompt in a Chinese regional setting requires the Unicode method. I would expect that standard printf() would work for ANSI CP936 encoded text. My tests show that I need to use option "-D unicode" to get proper output. When I use the ansi method I get wrong output, but when I redirect that to a text file, I get proper CP936 output in the text file. PS: See change of 2016-01-16 above. The cause of the problem was setlocale(). 2016-01-02 Erwin Waterlander * Makefile: Compilation for mingw, mingw32-w64, and mingw64-w64 works out of the box. * mingw*.mak: Deleted. 2015-12-27 Erwin Waterlander * man/man1/dos2unix.pod: Manual update. Binary file detection is not foolproof. * Moved Git repository: git clone git://git.code.sf.net/p/dos2unix/dos2unix 2015-12-22 Erwin Waterlander * Makefile: Split DEBUG=1 into DEBUG=1 and DEBUGMSG=1. DEBUG=1 will add option -g to CFLAGS for debugging with gdb. DEBUGMSG=1 makes dos2unix print extra messages about accessing the file system. * Makefile: Use GNU standard variables INSTALL_DATA and INSTALL_PROGRAM for installation. 2015-12-20 Erwin Waterlander * Moved Subversion repository to Git repository. git clone git://git.code.sf.net/p/dos2unix/gitcode dos2unix-gitcode * Removed execution permission from text and source files. 2015-12-08 Erwin Waterlander * DEVEL.txt: New text file with information about why dos2unix is made like it is. 2015-11-20 Erwin Waterlander * Version 7.3.2 * Makefile: Automatically detect if we are on MSYS 1 or 2. Unicode support is disabled for MSYS 1. 2015-11-09 Sebastian Rasmussen * po/sv.po: New Swedish translation of the messages. * man/sv/man1/dos2unix.po: New Swedish translation of the manual. 2015-11-08 Erwin Waterlander * Makefile, djgpp.mak, test/Makefile: Make it possible to run test suite in DJGPP environment. $SHELL must point to sh or bash. 2015-11-07 Erwin Waterlander * test: Be able to run tests when UTF-16 support is not enabled (UCS=). 2015-11-05 Erwin Waterlander * common.c: Fix option -iso. The -iso option was misinterpreted as a corrupted -i option. Thanks to report of Ulf-Dietrich Braumann. * test/iso.t: Added two tests for option -iso. 2015-10-09 Rafael Fontenelle * po/pt_BR.po: Updated Brazilian Portuguese translation. * man/pt_BR.po/man1/dos2unix.po: Updated Brazilian Portuguese translation. 2015-10-01 Erwin Waterlander * common.c: Fix compilation for MSYS 1. 2015-09-30 Erwin Waterlander * Version 7.3.1 2015-09-23 Erwin Waterlander * man/man1/dos2unix.pod: Added two examples for option -i, --info. * po/*.po: Updated several translations. See README.txt. 2015-09-05 zwpwjwtz * man/zh_CN/man1/dos2unix.po: New simplified Chinese translation of the manual. 2015-09-03 Erwin Waterlander * common.c: Skip UTF-16 files when UTF-16 conversion is not supported. Do not even try to convert. Conversion could go wrong when the UTF-16 file has no 8-bit binary symbols. 2015-09-02 Erwin Waterlander * common.c: Fix message printed, when dos2unix without Unicode support converts an UTF-16 file with only a BOM and no text. Output format was not printed. This fixed compile warning "unused parameter 'lout'". * common.h: Fixed compile warning "implicit declaration of function 'd2u_printf'" when Unicode support is disabled. 2015-09-02 Baruch Siach * common.c: Fix compilation error "'wchar_t' undeclared" when Unicode support is disabled. 2015-08-31 zwpwjwtz * po/zh_CN.po: New simplified Chinese translation. 2015-08-26 Erwin Waterlander * common.c, mingw.mak: Fix compilation for mingw.org. 2015-08-24 Erwin Waterlander * Version 7.3 2015-08-15 Erwin Waterlander * common.c: Fix: Options -ul and -ub caused option -i to report wrong BOM for no_bom. * test: Added two new tests for combination of -ul/-ub with -i. 2015-08-13 Erwin Waterlander * man/man1/dos2unix.pod: Small update on option -D. 2015-08-10 Erwin Waterlander * common.c: Default method for printing Unicode can be changed with environment variable DOS2UNIX_DISPLAY_ENC. * man/man1/dos2unix.pod: Small update on option -D. * test/testu16.c: Added a small test that demonstrates that redirecting UTF-16 stdout to a file creates a corrupt UTF-16 file. 2015-08-08 Erwin Waterlander * man/man1/dos2unix.pod: Small update on option -D. Added tip for recursive conversion in a Windows Command Prompt. 2015-08-06 Erwin Waterlander * man/man1/dos2unix.pod: Updated section "Unicode file names on Windows" and described new option -D, --display-enc. 2015-08-05 Erwin Waterlander * common.c: New option -D, --display-encoding, to set the encoding used for the text messages displayed in the Windows console. Possible values are: ansi, unicode, utf8. 2015-08-01 Erwin Waterlander * common.c: Renamed d2u_printf() to d2u_fprintf(). * common.c: Fix d2u_fprintf() to work correctly when Native Language Support is enabled. * common.c: New function d2u_ansi_fprintf() to redirect also non-Unicode messages to d2u_fprintf(), to have consistent output. * *.c: Replace all fprintf() with d2u_fprintf() or d2u_ansi_fprintf(). * man/man1/dos2unix.pod: Added a new section "Unicode file names on Windows". 2015-07-29 Erwin Waterlander * INSTALL.txt: Updated with information about Unicode file name support on Windows. * po/*.po: Included several translation updates. See README.txt. * test/test.bat: Renamed to test/testcmd.bat. * test/testps8.ps1: PowerShell script in UTF-8 format using Unicode file names. * test/testps16.ps1: PowerShell script in UTF-16 format using Unicode file names. 2015-07-23 Erwin Waterlander * common.c: glob_warg(): Check for malloc/realloc errors. * dos2unix.c, unix2dos.c: Check for malloc errors. 2015-07-20 Erwin Waterlander * common.c: print_bom(). Fix split message for translators. 2015-07-18 Erwin Waterlander * common.c: d2u_printf(). Use wprintf to print UTF-8. MinGW-w64 g++ (4.9.2) had some problems printing UTF-8. After first UTF-8 file name was printed the rest of UTF-8 was printed blank. This problem was in Windows Console. The problem was not there in ConEmu. MSVC (2013) does not have this problem. Using gcc and wprintf is OK in Windows Console and ConEmu. * mingw*.mak: Switch back to use gcc always. * common.c: Fix messages ending with space, for translators. 2015-07-12 Erwin Waterlander * vc.mak: Enable Unicode file names. * common.c: Check output of WideCharToMultiByte and MultiByteToWideChar. * common.c: Fixed a problem in glob_warg(). * mingw*.mak: Use g++ only when UNIFILE==1. * test/test.bat: Windows batch script that demonstrates how to use Unicode file names in a script. 2015-07-11 Erwin Waterlander * mingw32.mak, mingw64.mak: Add extra required DLLs for binary package with Unicode file name support. 2015-07-10 Erwin Waterlander * common.c: Finished glob_warg(). * dos2unix.c, unix2dos.c: Use glob_warg() to expand arguments in the Windows Command Prompt. * mingw32.mak, mingw.mak: Unicode file name support is enabled by setting UNIFILE=1. 2015-07-09 Erwin Waterlander * *.c: Renamed D2U_WINWIDE to D2U_UNIFILE * mingw64.mak, Makefile: Unicode file name support is enabled by setting UNIFILE=1. * common.c: Initial version of glob_warg() for wild card expansion of the wide command line arguments. Expands wide Unicode arguments, and returns them in UTF-8. 2015-07-08 Erwin Waterlander * dos2unix.c, unix2dos.c, common.c: Unicode file name support requires D2U_WINWIDE to be defined. There is still a problem with globbing Unicode file names. 2015-07-07 Erwin Waterlander * common.c: Fix d2u_printf() to print Unicode properly in the Windows Console. This required C++. * mingw*.mak: Use g++ instead of gcc. * vc.mk: Added library shell32.lib for wide arguments. 2015-07-06 Erwin Waterlander * dos2unix.c, unix2dos.c, common.c: Support Unicode file names on Windows. 2015-07-01 Erwin Waterlander * Version 7.2.3 2015-06-27 Erwin Waterlander * Makefile: Enable UTF-16 by default for MSYS, because MSYS2 supports it. For compilation on MSYS1 you have to disable it. * common.c: Don't print "converting file ... to ..." when there was an error. * common.c: Fixed false warning while reading BOM from zero byte file. Was introduced on 2015-06-24. 2014-06-27 Joe Hansen * po/da.po: Updated Danish translation. 2015-06-24 Erwin Waterlander * common.c: Bug fix. Check for file I/O errors with every file access. 2015-06-23 Erwin Waterlander * dos2unix.c, unix2dos.c: Bug fix. Check for file I/O errors with every file access. Thanks to report of Philip Rowlands. http://sourceforge.net/p/dos2unix/bugs/12/ * common.c: New functions d2u_getc_error, d2u_putc_error, and d2u_putwc_error for printing error messages. 2015-05-27 Erwin Waterlander * common.c: Fix compilation for msys. 2015-05-22 Erwin Waterlander * Version 7.2.2 * djgpp.mak: Fixed target strip. 2015-05-11 Erwin Waterlander * test/utf16.t: Added 2 tests with invalid surrogate pair. * dos2unix.c, unix2dos.c: Print line number when UTF-16 conversion error occurs. * dos2unix.c, unix2dos.c: Don't print number of converted lines in verbose mode when error occurs. 2015-05-10 Erwin Waterlander * common.c: Print system error when conversion from UTF-16 fails. * common.c: Check for invalid surrogate pairs in UTF-16 input. 2015-05-07 Erwin Waterlander * test/wcstombs_test.c: New test that shows that wcstombs() is broken on FreeBSD for CJK characters in a zh_CN.GB18030 locale. * test/Makefile: New target 'wcstombs' that runs wcstombs_test. * test/README.txt: New file. * test/misc.t, test/utf16.t: new tests for unix2dos to check conversion of binary files with null characters. 2015-05-03 Erwin Waterlander * test/Makefile: Disable GB18030 tests for FreeBSD. Tests which convert UTF-16 with surrogate pairs to GB18030 fail. Seen on FreeBSD 10.1. Issue in wcstombs()? * common.h: Removed define of _XOPEN_SOURCE. When _XOPEN_SOURCE is defined, the function lstat() is not found on FreeBSD 10.1. * common.c: Bug fix. When conversion of an UTF-16 file with binary symbols was forced, null characters were not written in the output. * test: Added new test for UTF-16 file with null characters. 2015-04-01 Erwin Waterlander * Version 7.2.1 2015-02-15 Erwin Waterlander * test/misc.t: Fix test for -f option. * test/chk_loc.sh: New script to test if locale is supported. * test/Makefile: Skip gb18030 test if zh_CN.gb18030 locale is not supported. * man/man1/dos2unix.pod: Update section GB18030 and option -m. 2015-02-11 Erwin Waterlander * Version 7.2 2015-01-15 Armin Müller * common.c,dos2unix.c,unix2dos.c: Use %u in format strings for unsigned ints. * common.c: Fixed typo in if condition in write_bom(). 2015-01-15 Erwin Waterlander * test/gb18030.t: Added more tests. 2015-01-03 Erwin Waterlander * Makefile: Fixed wrong encoded titles in HTML manuals when Perl 5.18 pod2html was used. Thanks to Tom Christiansen. 2015-01-02 Erwin Waterlander * Makefile, man/man1/Makefile: add option --no-wrap to xgettext and msgmerge. Translation Project standard is not to wrap. 2015-01-02 Erwin Waterlander * man/man1/dos2unix.pod: Point to gettext manual html nodes instead of the full gettext manual. 2014-12-31 Erwin Waterlander * man/man1/dos2unix.pod: Cleanup man page. Thanks to Benno Schulenberg. 2014-12-30 Erwin Waterlander * common.c: Changed some messages for better translations. 2014-12-26 Erwin Waterlander * common.c: Fix. On Windows when option -gb is used, option -m must add GB18030 BOM i.s.o. UTF-8 BOM. * test/gb18030.t: Make tests working for Windows version. 2014-12-24 Erwin Waterlander * common.c: Fix. In a GB18030 locale, option -m must add GB18030 BOM i.s.o. UTF-8 BOM. * test/gb18030.t: New tests for GB18030. 2014-12-23 Erwin Waterlander * man/man1/dos2unix.pod: Update section GB18030. 2014-12-08 Erwin Waterlander * common.c: When the input file is UTF-16, the input and output formats are printed. 2014-12-06 Erwin Waterlander * common.c: On Unix/Linux convert UTF-16 to the locale encoding. It is no longer required that the locale encoding is UTF-8. When conversion is not possible an error will occur and conversion will be skipped. 2014-12-06 Erwin Waterlander * common.c, common.h: Support conversion of UTF-16 to GB18030. * man/man1/dos2unix.pod: Update with info about GB18030. 2014-11-09 Yasuaki Taniguchi * po/ja.po: New Japanese translation of the UI messages. 2014-10-06 Erwin Waterlander * Version 7.1 2014-09-29 Erwin Waterlander * common.c: Fixed possible uninitialized use of variable bomtype_orig. * djgpp.mak: Fix time stamps mac2unix/unix2mac after make strip. 2014-09-22 Erwin Waterlander * mingw32.mak, mingw64.mak: Fixed setting path to CRT_glob.o. Works now independent of MSYS2 install path. 2014-09-22 Helmut Karlowski * Makefile: Added settings for freeMiNT, and cleanup setting OS specific settings. * common.c: PrintVersion() updated for freeMiNT. 2014-09-18 Erwin Waterlander * test/misc.t: Added a test for option -i, --info. * *.po: Included several translation updates. 2014-09-17 Erwin Waterlander * common.c: Program terminates when wrong flag is given for option -i or --info. * common.c: Option -i, flag c: don't print binary files when conversion of binaries is not forced. 2014-09-16 Erwin Waterlander * common.c: Options -i, --info can have extra flags to change the output. For instance to print only the number of Unix line breaks, or print only the files that have DOS line breaks. * man/man1/dos2unix.pod: Updated. 2014-09-11 Erwin Waterlander * common.c: New option -i, --info, display file information. This new option prints number of line breaks, the byte order mark, and if the file is text or binary. * man/man1/dos2unix.pod: Added option -i. * test/*.t: Use Test::Simple iso Test::More. 2014-09-09 Erwin Waterlander * Version 7.0 2014-09-08 Erwin Waterlander * common.c: Option -V prints home page. 2014-09-03 Erwin Waterlander * dos2unix.c, unix2dos.c: Return an error number in stdio mode when the input is binary. In stdio mode an input stream with a binary symbol produces broken output. In file mode the binary file is skipped. * test/misc.t: Added tests for above. * dos2unix.c, unix2dos.c, common.c: Bug fix. System error number was not always returned. When disk is full and output can't be written, or when resolving a symlink fails. 2014-09-01 Erwin Waterlander * common.c: Bug fix. Option -u disabled -m for ASCII or UTF-8 input files without BOM. Bug was introduced on 2014-08-05. * dos2unix.c, unix2dos.c, common.c: Bug fix. An Unicode input file disabled 7bit and iso mode also for next input files. Bug was introduced in version 6.0.1 on 2012-03-23. * common.c: Cleanup. Don't write BOM when conversion will be cancelled. * test/misc.t: Added tests for the two bug fixes. 2014-08-28 Erwin Waterlander * dos2unix.c, unix2dos.c, common.c: Code cleanup. Moved more code to common.c. * common.c: Bug fix mac2unix help text, options -b and -r. Bug was introduced in 6.0.6. * *.po: Included updated pt_BR translations. 2014-08-26 Erwin Waterlander * dos2unix.c, unix2dos.c, common.c: stdio mode does not automatically set quiet mode. stdio mode prints errors and returns error code. * dos2unix.c, unix2dos.c: stdio mode does not automatically force conversion of binaries. 2014-08-25 Erwin Waterlander * test/symlink.t: New tests for options -F, -R, -S * *.po: Included updated nl,nb ,vi translations. 2014-08-22 Erwin Waterlander * *.po: Included updated nl,pl,ru translations. 2014-08-18 Erwin Waterlander * unix2dos.c: Fix: Unix2dos did not count UTF-16 line break conversions. * INSTALL.txt: Update for running self-tests. * *.po: Included updated fr,de,uk translations. * test: Added more tests. 2014-08-17 Erwin Waterlander * test: Use TAP (Test Anything Protocol) to run tests. Requires perl module perl-Test-Simple. 2014-08-11 Erwin Waterlander * test: Added automated tests. 2014-08-10 Erwin Waterlander * dos2unix.c: Bug fix: dos2unix -l created DOS line breaks from Mac line breaks. This bug was introduced in version 3.2, by safeconv patch. * INSTALL.txt: Update for DJGPP. Use gcc <= 4.5.3. 2014-08-08 Erwin Waterlander * man/man1/dos2unix.pod: Update manual wrt Unicode. * common.c: Update help message for option -m. 2014-08-06 Erwin Waterlander * New option -v, --verbose: Print extra information about number of converted line breaks and BOMs. 2014-08-05 Erwin Waterlander * New option -u, --keep_utf16: Keep UTF-16 encoding of the input file. This prevents transformation to UTF-8. 2014-08-03 Erwin Waterlander * Version 6.0.6 2014-08-03 Enrique Lazcorreta Puigmartí * po/es.po : Updated Spanish translation of messages. * man/es/man1/dos2unix.po : Updated Spanish translation of manual. 2014-07-12 Various authors * po/*.po, man/*/man1/*.po: Update translations. See README.txt for details. 2014-07-12 Yuri Kozlov * po/ru.po: Update Russian translation of messages. 2014-07-09 Erwin Waterlander * dos2unix.c, unix2dos.c: Option -r also disables option -m (add BOM). 2014-07-07 Erwin Waterlander * dos2unix.c, unix2dos.c, common.c: New options -b (keep BOM) and -r (remove BOM). 2014-07-06 Erwin Waterlander * dos2unix.c: Bug fix mac2unix conversion of UTF-16 files. Mac to Unix conversion produced corrupted output. Thanks to report of Alan S. Jones. This bug was introduced in version 6.0. 2014-05-24 Åka Sikrom * po/nb.po: New Norwegian Bokmaal translation. 2014-05-17 Mario Blättermann * po/de.po: Update German messages. 2014-05-12 Erwin Waterlander * INSTALL.txt: Updated for building 64-bit applications with Microsoft Visual C++ Express. 2014-05-12 Frédéric Marchal * man/fr/man1/dos2unix.po: Fixed minor translation error. 2014-04-23 Erwin Waterlander * man/man1/Makefile: Removed dependency on GNU sed. Thanks to Daniel Macks. * BUGS.txt: Update URL to bug tracker. 2014-04-17 Erwin Waterlander * Version 6.0.5 2014-04-09 Erwin Waterlander * common.c: Fix symbolic_link(), don't print error when file does not exist (problem was introduced on 2014-03-21). 2014-04-08 Erwin Waterlander * Makefile: Fix for GNU make < 3.82. For rules with multiple patterns, put rule with shortest stem first. 2014-04-04 Erwin Waterlander * vc.mak, wcc.mif: Only generate English manuals. Target clean does not delete the manuals, new target maintainer-clean does. 2014-03-23 Jakub Bogusz * man/pl/dos2unix.po: New Polish translation of the manual. 2014-03-23 Benno Schulenberg * man/nl/dos2unix.po: Update Dutch manual. 2014-03-22 Balázs Úr * po/hu.po: New Hungarian translation of UI messages. 2014-03-21 Erwin Waterlander * common.c: Windows version of function symbolic_link(). Now Windows version also skips symbolic links by default. * man/man1/dos2unix.pod: Update wrt Windows symbolic links, and some minor updates. * Makefile: Fix some dependencies for man page creation. 2014-03-18 Rafael Ferreira * man/pt_BR/man1/dos2unix.po: New Brazilian Portuguese translation of the manual. 2014-03-18 Frédéric Marchal * man/fr/man1/dos2unix.po: New French translation of the manual. 2014-03-16 Yuri Chornoivan * man/uk/man1/dos2unix.po: New Ukrainian translation of the manual. 2014-03-16 Erwin Waterlander * Makefile: New target 'getpoman' to get .po files for the manuals from the Translation Project. 2014-03-15 Mario Blättermann * man/de/man1/dos2unix.po: New German translation of the manual. 2014-03-14 Erwin Waterlander * man/man1/Makefile: Generate pod files from gettext po files with po4a, for easier translation. Thanks to Mario Blätterman. See also http://po4a.alioth.debian.org/ * man/nl/man1/dos2unix.po, man/es/man/dos2unix.po: New po files, created from original pod. Thanks to Mario Blätterman. * man/nl/man1/dos2unix.pod, man/es/man/dos2unix.pod: Deleted. These are generated now. * Makefile: Update for manual generation from .po files. * Makefile, man/man1/Makefile: All man pages are now in UTF-8 format. * Makefile: Esperanto x notation no longer supported. Conversion from UTF-8 is troublesome and gettext will automatically translate to caret (^) notation when UTF-8 is not supported by the system. * po/eo-x.po: Deleted. 2014-03-14 mail6543210 * po/zh_TW.po: New Chinese (traditional) translation. 2014-03-06 Thomas Pryds * po/da.po: New Danish translation. 2014-03-06 Мирослав Николић * po/sr.po: New Serbian translation. 2014-02-24 Frédéric Marchal * po/fr.po: New French translation. 2014-02-05 Erwin Waterlander * README.txt: List all the new translators. * Makefile: New target 'getpo' to get .po file from the Translation Project. New target po/eo-x.po to generate eo-x.po from eo.po. 2014-02-05 Enrico Nicoletto * po/pt_BR.po: New Brazilian Portuguese translation 2014-02-05 Jakub Bogusz * po/pl.po: New Polish translation 2014-02-05 Yuri Chornoivan * po/uk.po: New Ukrainian translation 2014-02-05 Trần Ngọc Quân * po/vi.po: New Vietnamese translation 2014-02-05 Benno Schulenberg * po/nl.po: Updated Dutch translation * po/eo.po: Updated Esperanto translation 2014-02-02 Erwin Waterlander * *.c: Print help and version info to stdout iso stderr. Thanks to Benno Schulenberg. 2014-01-31 Erwin Waterlander * *.c,po/*.po: cleanup messages. Thanks to Benno Schulenberg. 2014-01-29 Erwin Waterlander * common.c, po/*.po: Split large help text in smaller pieces. This is easier for the translators. Thanks to Benno Schulenberg. 2014-01-18 Erwin Waterlander * Makefile, *.mak: Removed MAN_NONLATIN variable. * INSTALL.txt: Update section INTERNATIONAL MAN PAGES. 2014-01-10 Erwin Waterlander * mingw32.mak, mingw64.mak: Update for easier use in MSYS2. Added extra include path to find libintl.h. 2014-01-04 Erwin Waterlander * Makefile: Also include English manuals in source the package. Adding man files to the source package, which have been generated with a high version of perl/pod2man, is a favour to users, because newer perl/pod2man versions produce better output (also for old systems). Tip from pod2man maintainer Russ Allbery. When you want to generate man pages yourself just run first 'make maintainer-clean'. 2014-01-03 Erwin Waterlander * man/nl/man1/dos2unix.pod, man/es/man1/dos2unix.pod: Add =encoding latin1 command. Perl 5.18 requires =encoding for all non-ASCII pod files. See also https://rt.cpan.org/Public/Bug/Display.html?id=91805 Minimal perl version is now 5.10.1. * Makefile: Target clean keeps generated non-English manual files to avoid problems with old perl version. Target maintainer-clean will erase the generated non-English manual files. * INSTALL.txt: Update for new required perl version. 2013-12-30 Erwin Waterlander * Version 6.0.4 * man/nonlatin/man1/ru/dos2unix.pod: Removed. Russian translation of manual moved to later release. 2013-11-26 Erwin Waterlander * Makefile, common.c: When MinGW-w64 is used for 32 bit, option -V prints (MinGW-w64) for used compiler name. 2013-11-24 Erwin Waterlander * mingw32.mak: New makefile for MinGW-w64 targeting win32. MinGW-w64 supports Large File Support (LFS) with -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 while mingw.org doesn't. Dos2unix failed when concurrent dos2unix processes processed huge files on Windows network share drives. Using MinGW-w64 with LFS support fixed the problem. Thanks to report by F.J. Brandelik. 2013-10-07 Erwin Waterlander * Makefile: Set MAN_NONLATIN back to 1. Include non-Latin manuals in source package to prevent compilation troubles. Target 'clean' keeps non-Latin manuals. Use 'maintainer-clean' to erase them. 2013-10-05 Erwin Waterlander * Makefile: By default don't build non-Latin1 manuals. There are still too many old perl/pod2man versions around (perl < 5.10.1). Add MAN_NONLATIN=1 to enable non-Latin1 manuals. 2013-10-01 Erwin Waterlander * man/man1/Makefile: Support non-Latin1 man pages. * Makefile: Support non-Latin1 man pages. * man/nonlatin/man1/ru/dos2unix.pod: Placeholder for Russian manual. 2013-09-13 Андрей Углик (Andrei Uhlik) * po/ru.po: New Russian translation of the messages. 2013-08-05 Erwin Waterlander * po/de.po: Update German translations. Thanks to Lars Wendler. 2013-06-14 Erwin Waterlander * dos2unix.c/unix2dos.c: New options -ul and -ub to convert UTF-16 files without BOM. 2013-06-11 Erwin Waterlander * dos2unix.c/unix2dos.c: Print value of binary symbol when found. 2013-03-12 Erwin Waterlander * Makefile: Set CC to gcc for MSYS target. Otherwise /mingw/bin/cc is used. 2013-01-27 Erwin Waterlander * Makefile: - CC and CPP can be overridden by environment. - CFLAGS optimization flags can be overridden by environment. - Separate LIBS from LDFLAGS. Thanks to Justin Lecher 2013-01-25 Erwin Waterlander * Version 6.0.3 2013-01-18 Erwin Waterlander * dos2unix.c/unix2dos.c: Print system error when writing to temporary output file fails. 2013-01-16 Erwin Waterlander * dos2unix.c/unix2dos.c: Print system error when closing of temporary output file fails. E.g. "No space left on device". 2012-12-25 Erwin Waterlander * querycp.c/h: Added public domain phrase for Debian license check. 2012-12-12 Erwin Waterlander * test: New directory with some test files. 2012-09-20 Erwin Waterlander * man/man1/Makefile: Removed dependency on 'sed' program. 2012-09-19 Erwin Waterlander * vc.mak: Visual C++ version supports wildcard expansion. Added targets 'install', 'uninstall', 'doc', 'dist', 'txt', 'html', and 'mostlyclean'. * INSTALL.txt: Update for Visual C++. 2012-09-16 Erwin Waterlander * *.c/*.h: Dos2unix compiles with Microsoft Visual C++. * vc.mak: New makefile for Microsoft Visual C++. * INSTALL.txt: Update for Visual C++. 2012-09-15 Erwin Waterlander * Makefile: Better check for DJGPP. DJGPP 2.04 uname returns "FreeDOS" on Freedos, 2.03 uname returns always "MS-DOS". Thanks to Rugxulo. * man/man1/dos2unix.pod: Fixed a typo. Thanks to Jari Aalto. 2012-09-06 Erwin Waterlander * Version 6.0.2 2012-08-29 Erwin Waterlander * wcc*: Fix target 'dist' in Watcom makefiles. * djgpp.mak: Use 8.3 filename for dos32 binary package. 2012-08-26 Erwin Waterlander * os2.mak: Renamed to emx.mak. * wccos2.mak: New Watcom C makefile for OS/2 target. * wcc.mif: Watcom C makefile with generic parts. This new makefile containts new targets 'install', 'uninstall', 'doc', 'dist', and 'mostlyclean'. * djgpp.mak: Default prefix is now c:\dos32 * dos16_gnu.mak: Removed. Installation of dos16 version is now done with Watcom makefiles. 2012-08-13 Erwin Waterlander * po/de.po: Update German translations. Thanks to Philipp. * po/es.po: Update Spanish translations. Thanks to Julio. 2012-08-12 Erwin Waterlander * Makefile: Don't use pod2text option --utf8. There are too many old pod2text versions around that don't support this option. * Makefile: Install PDF and PostScript files of all languages when they have been created. * po/eo*.po: Update Esperanto translations. Thanks to Rugxulo. * dos2unix/unix2dos: Don't use __MSDOS__ macro for Windows. 2012-08-10 Erwin Waterlander * Makefile: Change variable OS to D2U_OS. OS is used by Windows. * Makefile: By default install only English text and html manuals. This saves a dependency on iconv. Non-English text and html manuals will be installed when they have been explicitly generated with targets 'txt' and 'html'. 2012-08-09 Erwin Waterlander * dos2unix/unix2dos: Use only C99 compliant predefined macros. 2012-08-07 Erwin Waterlander * dos2unix/unix2dos: Print line number when a binary symbol is found. Thanks to Somsak Pattanaprateep. * Makefile: By default install text and html manuals of all languages. 2012-08-06 Erwin Waterlander * dos2unix/unix2dos: Fix. Locale encoding was not detected when NLS was disabled. * common.c: Update comments. Surrogate halves in UTF-8 are invalid. 2012-07-25 Erwin Waterlander * Version 6.0.1 2012-07-20 Erwin Waterlander * Makefile: Target 'html' makes also Dutch and Spanish HTML manuals. 2012-07-18 Erwin Waterlander * manual: Update for options -n and -o. Describe the new permissions of the output file in new-file and old-file mode. * README.txt: Added references for the findutils package for Windows and DOS to enable recursive conversions on those platforms. 2012-05-20 Erwin Waterlander * common.h: Fix compiler warnings "implicit declaration of function 'strcasecmp'". Thanks to Michael Schindler . 2012-05-11 Julio A. Freyre-Gonzalez * Update Spanish messages and manual. 2012-05-06 Erwin Waterlander * Version 6.0 * man/*/man1/*.pod: Removed =encoding. It is not supported by perl 5.8.8, which is shipped with MinGW and DJGPP. 2012-04-20 Erwin Waterlander * man/*/man1/*.pod: Set encoding explicitly to Latin-1. * Makefile: Target 'doc' makes all man pages. 2012-04-12 Erwin Waterlander * po/de.po: Update German translations. Thanks to Philipp Thomas. 2012-04-09 Erwin Waterlander * INSTALL.txt: List the prerequisites. * Makefile: Friendlier for DJGPP/MinGW/MSYS. 2012-04-04 Erwin Waterlander * po/eo.po: Update Esperanto translations. Thanks to Rugxulo. 2012-03-30 Erwin Waterlander * Skip UTF-16 file when conversion to UTF-8 goes wrong. * Update English and Dutch manual. 2012-03-28 Erwin Waterlander * common.c: Support UTF-16 surrogate pairs. * dos2unix.c, unix2dos.c: Check wchar_t size. 2012-03-26 Erwin Waterlander * *.c: Use fgetc/fputc instead of getc/putc. 2012-03-25 Erwin Waterlander * po, man: Update Dutch translations. 2012-03-24 Erwin Waterlander * On Unix, convert UTF-16 files only when the locale encoding is UTF-8 to prevent accidental loss of text. 2012-03-23 Erwin Waterlander * Turn off ISO and 7-bit mode if an Unicode text file is detected, to prevent corruption of UTF-8 files. * Update English manual. * Fix compilation for WatcomC, DJGPP, MSYS, OS/2. * Makefile: Support CFLAGS_USER, LDFLAGS_USER, and DEFS_USER for Debian Linux. Thanks to Jari Aalto. 2012-03-21 Erwin Waterlander * Support conversion of Unicode UTF-16 from stdin. * Update English manual. 2012-03-20 Erwin Waterlander * Support conversion of Unicode UTF-16 encoded files. 2012-03-16 Erwin Waterlander * common.c: Make it compile on Cygwin 1.5. 2012-03-10 Erwin Waterlander * Version 5.3.3 * Makefile: Binary packages with native language support get "-nls" suffix. 2012-03-08 Erwin Waterlander * common.c: Option -V prints target OS on DOS/Windows/OS2. 2012-03-07 Erwin Waterlander * dos2unix.c, unix2dos.c, mingw64.mak: Enabled wildcard expansion for Win64 (MinGW-w64). Thanks to Steve Hay. * wccdos16.mak: Enabled wildcard expansion. * wccdos32.mak: Enabled wildcard expansion. * wccwin32.mak: Enabled wildcard expansion. * bcc.mak: Enabled wildcard expansion. 2012-03-02 Erwin Waterlander * Makefile: New target 'mostlyclean' that preserves the manual files. Target 'clean' removes all built files, it restores the Unix source package to its original state. * Makefile: New variable HTMLEXT to override the default 'htm' extension for the manual in HTML format. 2012-02-01 Erwin Waterlander * Makefile, version.mk: Fix a compile error when debug is enabled. Thanks to Maurizio Camisaschi and Lars Wendler. See https://bugs.gentoo.org/400769 * Makefile: Enable debugging info for gdb when DEBUG=1 * man page: Small update in section RETURN VALUE. 2012-01-27 Erwin Waterlander * Version 5.3.2 2012-01-02 Erwin Waterlander * os2.mak: Enable support for wild cards (-Zargs-wild). Thanks to Steven H. Levine and Elbert Pol. 2011-12-20 Erwin Waterlander * querycp.c: Extra comment from Rugxulo. * querycp.c: Undid change of 2011-11-12. MSYS version behaves as Cygwin version. 2011-12-15 Erwin Waterlander * wccdos32.mak: New makefile for Open Watcom for DOS32. 2011-12-06 Erwin Waterlander * Makefile: Undo previous change for Darwin. Not restoring group and owner may be destructive or a security risk. * Makefile, common.[ch]: Dos2unix builds on MSYS now. 2011-12-02 Erwin Waterlander * Makefile: For MacOS the option -DNO_CHOWN has been be added to the compile time flags. This is necessary because Darwin will create files with the file-owner-group set to the file-owner-group of the directory - EVEN if the caller is not a member of the group! Chowning *from* the group is ok, chowning *to* the group is not - and this will make unix2dos fail when it tries to restore the permissions. Thanks to Wolf Geldmacher. See bug report 3444337, https://sourceforge.net/tracker/?func=detail&atid=1234808&aid=3444337&group_id=292083 2011-11-16 Erwin Waterlander * README.txt, man/man1/dos2unix.pod: Freshmeat changed name to Freecode. 2011-11-12 Erwin Waterlander * querycp.c: Fix for MSYS. 2011-10-20 Erwin Waterlander * querycp.c: Support OS/2, and Watcom C for Win32. * wccwin32.mak: New makefile for Open Watcom for Win32. 2011-08-22 Erwin Waterlander * Makefile: Added RPM_OPT_FLAGS to LDFLAGS. Required for cross-platform RPM package building. 2011-08-20 Erwin Waterlander * Home page URL: change to http://waterlan.home.xs4all.nl/dos2unix.html 2011-08-09 Erwin Waterlander * Version 5.3.1 2011-08-08 Julio A. Freyre-Gonzalez * Spanish translation of messages and manual. 2011-06-26 Erwin Waterlander * bugfix: dos2unix changes ownership and permissions on file. When an other user (e.g. root) than the owner has write permission on the input file, dos2unix changes owner, group and umask in old file mode to the other user's owner, group and umask who runs dos2unix. Fixed only for Unix. Thanks to Christopher Williams. See http://sourceforge.net/tracker/?func=detail&aid=3327171&group_id=292083&atid=1234808 * Keep permissions also on Windows. Use chmod() i.s.o. fchmod(). 2011-06-16 Erwin Waterlander * Identical functions from dos2unix.c and unix2dos.c are moved to common.c. 2011-06-15 Erwin Waterlander * Dos2unix and Unix2dos share the same language files. 2011-05-04 Erwin Waterlander * dos2unix.c: Removed redundant ConvertDosToUnixOldFile(). * unix2dos.c: Removed redundant ConvertUnixToDosOldFile(). 2011-04-26 Erwin Waterlander * Version 5.3 2011-04-23 Erwin Waterlander * Don't report an error when unlink() fails because a file doesn't exist. 2011-04-13 Erwin Waterlander * Print system error when input file can't be openened. For instance "Permission denied" * Update manuals. * Update translations. 2011-04-04 Erwin Waterlander * Always print and return an error when wrong command-line options are used. Also in quiet mode. * New option '--': Treat all following options as file names. 2011-04-03 Erwin Waterlander * Improved error reporting. Return system error when an error occurs. * Don't quit after first error (like rm, ls, grep, tar). * In quiet mode the return value is always zero. 2011-03-27 Erwin Waterlander * dos2unix.c/unix2dos.c: Check if symbolic links point to regular files. * dos2unix.c/unix2dos.c: Added short options -F, -R, -S. * po: update translations. 2011-03-24 Erwin Waterlander * dos2unix.c/unix2dos.c: Changed options --follow, --no-follow, to --follow-symlink, --replace-symlink, --skip-symlink. * dos2unix.c/unix2dos.c: Options --force and --safe are only to covert binary files or skip them. * dos2unix.c/unix2dos.c: Non-regular files that are not symbolic links are never converted. 2011-03-23 Charles Wilson * dos2unix.c/unix2dos.c: New options --follow and --no-follow. In follow mode dos2unix writes to the symlink target, instead of replacing the symbolic link with an output file. 2011-03-22 Charles Wilson * querycp.c: Behave on Cygwin same as on Linux. Default code page in ISO mode is CP437. 2011-03-21 Charles Wilson * dos2unix.c/unix2dos.c: - Cygwin may define WIN32 (via include files). - bugfix: Cygwin: set mode to binary in stdio mode conversion. Needed in case non-Cygwin program launches dos2unix. - bugfix: set failure mode if rename fails in quiet mode. - New option: -s, --safe. Opposite of -f, --force. * Makefile: Cleanup for Cygwin. 2011-03-19 Erwin Waterlander * Makefile: Install links instead of binary/manpage copies on Cygwin. 2011-03-05 Erwin Waterlander * man/man1/dos2unix.pod: Replace GPL with FreeBSD license. * man/nl/man1/dos2unix.pod: Replace GPL with FreeBSD license. 2011-03-04 Erwin Waterlander * Version 5.2.1 2011-03-03 Erwin Waterlander * Don't print used code page in quiet mode. 2011-03-02 Erwin Waterlander * Esperanto x-notation format is optional. Default is Unicode. There is no installation of an 'eo-x' locale any more. Add EO_XNOTATION=1 to make command-line to select x-notation. It will change the format of the normal 'eo' locale from Unicode to ASCII x-notation. 2011-02-28 Erwin Waterlander * Makefile: Make LFS optional with variable LFS (default on). * dos2unix.c/unix2dos.c: Print file name with stat() system error. 2011-02-26 Erwin Waterlander * dos2unix.c/unix2dos.c: Report system error when stat() fails. * Makefile: Enable 64 bit file system interface (_FILE_OFFSET_BITS=64). This enables opening files larger than 2GB on 32 bit systems, provided the system has Large File Support (LFS). See also section 1.3.4 "Feature Test Macros" of The GNU C Library manual. http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html 2011-02-22 Erwin Waterlander * In debug mode file mode is printed (compile with DEBUG=1). 2011-02-19 Erwin Waterlander * Makefile: Generation of PostScript and PDF is optional. This removes dependency on Groff and GhostScript (thanks to Philipp Thomas). 2011-02-04 Erwin Waterlander * Makefile: Replace GPL (accidently patched in) with FreeBSD license. * man/man1/Makefile: Fix perl command for for DOS alike file systems (Can't do inplace edit without backup.). (thanks to Elbert Pol) 2011-01-31 Erwin Waterlander * Version 5.2 2011-01-19 Erwin Waterlander * Update manual. 2011-01-13 Rugxulo * querycp.c: Active code page detection. DOS 16 bit, OpenWatcom. 2011-01-12 Erwin Waterlander * querycp.c: Detect active code page for ISO mode on Windows. 2011-01-12 Rugxulo * querycp.c: Detect active code page for ISO mode. DOS 32 bit, DJGPP. 2011-01-11 Erwin Waterlander * New ISO conversion modes DOS CP860 (Portuguese) and CP863 (French Canadian). 2011-01-10 Erwin Waterlander * New ISO conversion mode DOS CP865 (Nordic). 2011-01-07 Erwin Waterlander * ISO mode CP437: fix conversion of non-breaking space (NBSP) * New ISO conversion modes: DOS CP850 (Western European) and Windows CP1252 (Western European). * SunOS compatible command-line options -ascii, -iso, -7, -437, -850. 2011-01-04 Erwin Waterlander * 7bit and iso mode can be used in Mac mode. 2010-11-22 Jari Aalto * Small updates man page and Makefile. 2010-11-21 Ben Pfaff * Don't indicate text files with ASCII Form Feed control characters (^L) as binary. Form feed characters are fairly common in GNU software text files, because the GNU coding standards advice to use form feeds to divide text into pages. 2010-11-15 Erwin Waterlander * Put full copyright text in *.h source files (FSF's recommendation). Thanks to Jari Aalto . * Don't include generated documentation files in Unix source package. * Create a source package in DOS text format. 2010-08-18 Erwin Waterlander * version 5.1.1 2010-07-23 Erwin Waterlander * Added Dutch translation of the manual. 2010-07-19 Erwin Waterlander * MinGW-w64 Makefile added for Windows 64 bit port. 2010-06-20 Erwin Waterlander * Don't ship po/*.mo files in source package. * Win32 binary package uses patched MinGW's libintl, with builtin relocation support. See http://www.xs4all.nl/~waterlan/libintl.html 2010-04-22 Erwin Waterlander * Support compilation in DOSBox (8.3 file names where needed). 2010-04-14 Erwin Waterlander * Fixed compilation on Darwin OS. Thanks to Marc Gianzero. 2010-04-03 Erwin Waterlander * version 5.1 2010-03-22 Erwin Waterlander * Man page generation from Perl POD file. Thanks to Jari Aalto * Merge dos2unix and unix2dos man pages. 2010-03-17 Erwin Waterlander * Add localization information to manual. 2010-03-16 Rugxulo * Added Esperanto translation. 2010-03-13 Erwin Waterlander * DJGPP, dos32bit: Create 'stubs' for mac2unix and unix2mac. See also http://www.delorie.com/djgpp/v2faq/faq22_5.html Thanks to Rugxulo 2010-03-11 Erwin Waterlander * Allow to set options in stdio mode. * dos2unix: bugfix MAC mode: Don't change DOS line endings. * Display help if a wrong option was used. 2010-03-04 Erwin Waterlander * Port to 16 bit DOS, using OpenWatcom. 2010-03-03 Erwin Waterlander * Port to 16 bit DOS, using Borland C. 2010-02-16 Erwin Waterlander * version 5.0 2010-02-15 Erwin Waterlander * unix2dos: Fix problem of reading Mac files. * unix2dos: Added command 'unix2mac'. * unix2dos: Can use DOS2UNIX_LOCALEDIR i.s.o. UNIX2DOS_LOCALEDIR. * dos2unix: 'mac2unix' command can have a prefix. * Makefile: mac2unix and unix2mac are installed as soft links. 2010-02-13 Erwin Waterlander * Bundled dos2unix and unix2dos in one package. * dos2unix/unix2dos : Cleanup messages and manual. * dos2unix: Option -l --newline also works in MAC mode. * unix2dos: Added option -l, --newline. * unix2dos: Added MAC mode. Convert Unix line endings to Mac line endings. 2010-02-10 Erwin Waterlander * unix2dos: Makefile : - Use GNU standard directory variables everywhere. - New target 'dist-tbz' creates bzip2 compressed archive. 2010-02-10 Philipp Thomas * unix2dos: po/de.po : Added German translation. * unix2dos: Makefile : - Added $(RPM_OPT_FLAGS) to CFLAGS. - Use DESTDIR only in install and uninstall targets (not in variables, this is more common practice). 2010-02-03 Erwin Waterlander * dos2unix: Makefile : - Use GNU standard directory variables everywhere. 2010-02-03 Philipp Thomas * dos2unix: po/de.po : Added German translation. * dos2unix: Makefile : - Use GNU standard directory variable 'datadir' i.s.o. 'sharedir'. - Added $(RPM_OPT_FLAGS) to CFLAGS. - New target 'dist-tbz' creates bzip2 compressed archive. - Use DESTDIR only in install and uninstall targets (not in variables, this is more common practice). 2010-02-02 Erwin Waterlander * dos2unix/unix2dos: Update Dutch translation. 2010-01-24 Erwin Waterlander * dos2unix/unix2dos: version 4.1.2 2010-01-22 Tim Waugh * dos2unix/unix2dos: Preserve file mode in 'new file mode'. * dos2unix/unix2dos: Makefile: Allow CFLAGS to be set externally. 2010-01-21 Erwin Waterlander * dos2unix/unix2dos: version 4.1.1 * dos2unix/unix2dos: Fix compilation on FreeBSD. * dos2unix/unix2dos: Changed home page URL to http://www.xs4all.nl/~waterlan/dos2unix.html 2009-12-28 Erwin Waterlander * dos2unix/unix2dos: version 4.1 * dos2unix/unix2dos: Automatically skip binary files. * dos2unix/unix2dos: Automatically skip non-regular files. * dos2unix/unix2dos: New option: -f --force: Force conversion of all files. * dos2unix/unix2dos: Option -h: Print options in alphabetical order. * dos2unix/unix2dos: Update manual. * dos2unix/unix2dos: ISO mode: - Non-convertable characters are converted to a dot. Old conversion risked conversion to unwanted ISO C1 control characters from ISO 6429. - Fixed wrong conversion of Interpunct. - Don't convert ASCII control characters DC4 (Pilcrow, 0x14) and NAK (Section-sign, 0x15). 2009-12-21 Erwin Waterlander * dos2unix/unix2dos: version 4.0.1 * dos2unix/unix2dos: man page improvements: Thanks to Jari Aalto . - Replace hyphens with minus signs (look like dashes) where needed. - Options in alphabetical order. * dos2unix/unix2dos: man page: Update ISO mode information. * dos2unix/unix2dos: Option -V prints localedir used. * dos2unix: Localedir can be overruled with environment variable DOS2UNIX_LOCALEDIR. * unix2dos: Localedir can be overruled with environment variable UNIX2DOS_LOCALEDIR. * dos2unix/unix2dos: Fixed two wrong conversions in ISO mode: - Greek mu. - Closing guillemet (angle quotation mark, >>). * dos2unix/unix2dos: Port to OS/2 Warp: Thanks to Elbert Pol . * dos2unix/unix2dos: Makefiles: Added target 'strip'. 2009-12-15 Erwin Waterlander * dos2unix/unix2dos: version 4.0 * dos2unix/unix2dos: Added internationalisation using gettext. * dos2unix/unix2dos: Added Dutch translation. * dos2unix/unix2dos: Ported to Win32 using Mingw32 * dos2unix/unix2dos: Ported to DOS using DJGPP * dos2unix/unix2dos: Fixed problem in DOS/Windows stdio mode. * dos2unix/unix2dos: New option -L/--license that prints software license. * dos2unix/unix2dos: Code cleanup * dos2unix/unix2dos: Update manual 2009-12-04 Erwin Waterlander * dos2unix: version 3.2 * unix2dos: version 2.3 * dos2unix/unix2dos: version.mk: New file. * dos2unix/unix2dos: README: New file. * dos2unix/unix2dos: ChangeLog : New file. * dos2unix: INSTALL: Updated. * dos2unix/unix2dos: Makefile: Makefile according GNU standards. * unix2dos: INSTALL: New file. * dos2unix: Applied all patches from RedHat: - use mkstemp i.s.o. mktemp: Nov 17 2000 Tim Powers - segfault: Jan 17 2002 Bernhard Rosenkraenzer - safeconv: Oct 20 2004 Miloslav Trmac - manpage-update: Oct 6 2004 Mike A. Harris - preserve-file-modes: Feb 6 2007 Tim Waugh - tmppath: Apr 13 2005 Tim Waugh - c-missing-arg: Jan 18 2008 Tim Waugh - Remove trailing white space. * unix2dos: Applied all patches from RedHat: - use mkstemp i.s.o. mktemp: Nov 17 2000 Tim Powers - segfault: Jan 17 2002 Bernhard Rosenkraenzer - manpage-update: Oct 6 2004 Mike A. Harris - preserve-file-modes: Oct 11 2004 Tim Waugh - tmppath: Apr 13 2005 Tim Waugh - Remove trailing white space. 1998-11-19 Christian Wurll * dos2unix: version 3.1 * dos2unix: Added extra newline if ^M occurs 1998-02-04 Bernd Johannes Wuebben * dos2unix: version 3.0 * dos2unix: Added Mac text file translation, i.e. \r to \n conversion 1995-03-30 Benjamin Lin * dos2unix/unix2dos: version 2.2 * dos2unix: Fixed a bug in 2.1 where in new file mode, if outfile already exists * dos2unix: conversion can not be completed properly. * unix2dos: Conversion from SunOS charset implemented. 1995-03-29 Benjamin Lin * dos2unix: version 2.1 * dos2unix: Conversion to SunOS charset implemented. 1995-03-19 Benjamin Lin * dos2unix/unix2dos: version 2.0 * dos2unix/unix2dos: Rewritten from scratch. 1995-03-16 Benjamin Lin * dos2unix: version 1.2 * unix2dos: version 1.3 * dos2unix/unix2dos: Modified to more conform to UNIX style. 1995-03-09 Benjamin Lin * unix2dos: version 1.2 * unix2dos: Fixed minor typo error 1994-12-20 Benjamin Lin * dos2unix/unix2dos: version 1.1 * dos2unix/unix2dos: Cleaned up for Borland C/C++ 4.02 1989-10-04 John Birchfield * dos2unix/unix2dos: version 1.0 dos2unix-7.3.4/common.c0000644000175500010010000027112612721132543014214 0ustar waterlanGeen/* * Copyright (C) 2009-2016 Erwin Waterlander * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice in the documentation and/or other materials provided with * the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "common.h" #include "dos2unix.h" #include "querycp.h" #include #if defined(D2U_UNIFILE) || (defined(D2U_UNICODE) && defined(_WIN32)) #include #endif #if defined(D2U_UNICODE) && !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__) /* Unix, Cygwin */ # include #endif #if defined(__GLIBC__) /* on glibc, canonicalize_file_name() broken prior to 2.4 (06-Mar-2006) */ # if __GNUC_PREREQ (2,4) # define USE_CANONICALIZE_FILE_NAME 1 # endif #elif defined(__CYGWIN__) /* on cygwin, canonicalize_file_name() available since api 0/213 */ /* (1.7.0beta61, 25-Sep-09) */ # include # if (CYGWIN_VERSION_DLL_COMBINED >= 213) && (CYGWIN_VERSION_DLL_MAJOR >= 1007) # define USE_CANONICALIZE_FILE_NAME 1 # endif #endif /* global variables */ #ifdef D2U_UNIFILE int d2u_display_encoding = D2U_DISPLAY_ANSI ; #endif int header_done = 0; /* * Print last system error on Windows. * */ #if (defined(_WIN32) && !defined(__CYGWIN__)) void d2u_PrintLastError(const char *progname) { /* Retrieve the system error message for the last-error code */ LPVOID lpMsgBuf; DWORD dw; dw = GetLastError(); FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); /* Display the error message */ /* MessageBox(NULL, (LPCTSTR)lpMsgBuf, TEXT("Error"), MB_OK); */ D2U_UTF8_FPRINTF(stderr, "%s: ",progname); #ifdef _UNICODE fwprintf(stderr, L"%ls\n",(LPCTSTR)lpMsgBuf); #else fprintf(stderr, "%s\n",(LPCTSTR)lpMsgBuf); #endif LocalFree(lpMsgBuf); } int d2u_WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar) { int i; if ( (i = WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar)) == 0) d2u_PrintLastError("dos2unix"); return i; } int d2u_MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar) { int i; if ( (i = MultiByteToWideChar(CodePage, dwFlags, lpMultiByteStr, cbMultiByte, lpWideCharStr, cchWideChar)) == 0) d2u_PrintLastError("dos2unix"); return i; } #endif #ifdef D2U_UNIFILE /* * d2u_utf8_fprintf() : printf wrapper, print in Windows Command Prompt in Unicode * mode, to have consistent output. Regardless of active code page. * * On Windows the file system uses always Unicode UTF-16 encoding, regardless * of the system default code page. This means that files and directories can * have names that can't be encoded in the default system Windows ANSI code * page. * * Dos2unix for Windows with Unicode file name support translates all directory * names to UTF-8, to be able to work with char type strings. This is also * done to keep the code portable. * * Dos2unix's messages are encoded in the default Windows ANSI code page, which * can be translated with gettext. Gettext/libintl recodes messages (format) to * the system default ANSI code page. * * d2u_utf8_fprintf() on Windows assumes that: * - The format string is encoded in the system default ANSI code page. * - The arguments are encoded in UTF-8. * * There are several methods for printing Unicode in the Windows Console, but * none of them is perfect. There are so many issues that I decided to go back * to ANSI by default. * * The use of setlocale() has influence on this function when ANSI or UTF-8 is * printed. See also dos2unix.c and unix2dos.c and test/setlocale.c and * test/setlocale.png. */ void d2u_utf8_fprintf( FILE *stream, const char* format, ... ) { va_list args; char buf[D2U_MAX_PATH]; char formatmbs[D2U_MAX_PATH]; wchar_t formatwcs[D2U_MAX_PATH]; UINT outputCP; wchar_t wstr[D2U_MAX_PATH]; int prevmode; static int BOM_printed = 0; va_start(args, format); /* The format string is encoded in the system default * Windows ANSI code page. May have been translated * by gettext. Convert it to wide characters. */ d2u_MultiByteToWideChar(CP_ACP,0, format, -1, formatwcs, D2U_MAX_PATH); /* then convert the format string to UTF-8 */ d2u_WideCharToMultiByte(CP_UTF8, 0, formatwcs, -1, formatmbs, D2U_MAX_PATH, NULL, NULL); /* The arguments (file names) are in UTF-8 encoding, because * in dos2unix for Windows all file names are in UTF-8 format. * Print to buffer (UTF-8) */ vsnprintf(buf, sizeof(buf), formatmbs, args); if ((d2u_display_encoding == D2U_DISPLAY_UTF8) || (d2u_display_encoding == D2U_DISPLAY_UTF8BOM)) { /* A disadvantage of this method is that all non-ASCII characters are printed wrongly when the console uses raster font (which is the default). When I switch the system ANSI code page to 936 (Simplified Chinese) or 932 (Japanese) I see lot of flickering in the console when I print UTF-8. The cause could be that I have a Dutch Windows installation, and when the console is switched to UTF-8 mode (CP65001) the font is switched back to Western font (Lucida Console, Consolas). These are the only fonts which I can select when I set the code page in the console to 65001 with chcp, while the system ANSI code is 936 or 932. */ /* print UTF-8 buffer to console in UTF-8 mode */ outputCP = GetConsoleOutputCP(); SetConsoleOutputCP(CP_UTF8); if (! BOM_printed) { if (d2u_display_encoding == D2U_DISPLAY_UTF8BOM) fwprintf(stream, L"%S","\xEF\xBB\xBF"); BOM_printed = 1; } fwprintf(stream,L"%S",buf); SetConsoleOutputCP(outputCP); /* The following UTF-8 method does not give correct output. I don't know why. */ /*prevmode = _setmode(_fileno(stream), _O_U8TEXT); fwprintf(stream,L"%S",buf); _setmode(_fileno(stream), prevmode); */ } else if ((d2u_display_encoding == D2U_DISPLAY_UNICODE) || (d2u_display_encoding == D2U_DISPLAY_UNICODEBOM)) { /* Printing UTF-16 works correctly. Works also good with raster fonts. No need to change the OEM code page to the system ANSI code page. */ d2u_MultiByteToWideChar(CP_UTF8,0, buf, -1, wstr, D2U_MAX_PATH); prevmode = _setmode(_fileno(stream), _O_U16TEXT); if (! BOM_printed) { /* For correct redirection in PowerShell we need to print a BOM */ if (d2u_display_encoding == D2U_DISPLAY_UNICODEBOM) fwprintf(stream, L"\xfeff"); BOM_printed = 1; } fwprintf(stream,L"%ls",wstr); fflush(stream); /* Flushing is required to get correct UTF-16 when stdout is redirected. */ _setmode(_fileno(stream), prevmode); } else { /* ANSI */ d2u_MultiByteToWideChar(CP_UTF8,0, buf, -1, wstr, D2U_MAX_PATH); /* Convert the whole message to ANSI, some Unicode characters may fail to translate to ANSI. They will be displayed as a question mark. */ d2u_WideCharToMultiByte(CP_ACP, 0, wstr, -1, buf, D2U_MAX_PATH, NULL, NULL); fprintf(stream,"%s",buf); } va_end( args ); } /* d2u_ansi_fprintf() fprintf wrapper for Windows console. Format and arguments are in ANSI format. Redirect the printing to d2u_utf8_fprintf such that the output format is consistent. To prevent a mix of ANSI/UTF-8/UTF-16 encodings in the print output. Mixed format printing may get the whole console mixed up. */ void d2u_ansi_fprintf( FILE *stream, const char* format, ... ) { va_list args; char buf[D2U_MAX_PATH]; /* ANSI encoded string */ char bufmbs[D2U_MAX_PATH]; /* UTF-8 encoded string */ wchar_t bufwcs[D2U_MAX_PATH]; /* Wide encoded string */ va_start(args, format); vsnprintf(buf, sizeof(buf), format, args); /* The format string and arguments are encoded in the system default * Windows ANSI code page. May have been translated * by gettext. Convert it to wide characters. */ d2u_MultiByteToWideChar(CP_ACP,0, buf, -1, bufwcs, D2U_MAX_PATH); /* then convert the format string to UTF-8 */ d2u_WideCharToMultiByte(CP_UTF8, 0, bufwcs, -1, bufmbs, D2U_MAX_PATH, NULL, NULL); d2u_utf8_fprintf(stream, "%s",bufmbs); va_end( args ); } #endif /* d2u_rename * wrapper for rename(). * On Windows file names are encoded in UTF-8. */ int d2u_rename(const char *oldname, const char *newname) { #ifdef D2U_UNIFILE wchar_t oldnamew[D2U_MAX_PATH]; wchar_t newnamew[D2U_MAX_PATH]; d2u_MultiByteToWideChar(CP_UTF8, 0, oldname, -1, oldnamew, D2U_MAX_PATH); d2u_MultiByteToWideChar(CP_UTF8, 0, newname, -1, newnamew, D2U_MAX_PATH); return _wrename(oldnamew, newnamew); #else return rename(oldname, newname); #endif } /* d2u_unlink * wrapper for unlink(). * On Windows file names are encoded in UTF-8. */ int d2u_unlink(const char *filename) { #ifdef D2U_UNIFILE wchar_t filenamew[D2U_MAX_PATH]; d2u_MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenamew, D2U_MAX_PATH); return _wunlink(filenamew); #else return unlink(filename); #endif } /****************************************************************** * * int symbolic_link(char *path) * * test if *path points to a file that exists and is a symbolic link * * returns 1 on success, 0 when it fails. * ******************************************************************/ #ifdef D2U_UNIFILE int symbolic_link(const char *path) { DWORD attrs; wchar_t pathw[D2U_MAX_PATH]; d2u_MultiByteToWideChar(CP_UTF8, 0, path, -1, pathw, D2U_MAX_PATH); attrs = GetFileAttributesW(pathw); if (attrs == INVALID_FILE_ATTRIBUTES) return(0); return ((attrs & FILE_ATTRIBUTE_REPARSE_POINT) != 0); } #elif(defined(_WIN32) && !defined(__CYGWIN__)) int symbolic_link(const char *path) { DWORD attrs; attrs = GetFileAttributes(path); if (attrs == INVALID_FILE_ATTRIBUTES) return(0); return ((attrs & FILE_ATTRIBUTE_REPARSE_POINT) != 0); } #else int symbolic_link(const char *path) { #ifdef S_ISLNK struct stat buf; if (STAT(path, &buf) == 0) { if (S_ISLNK(buf.st_mode)) return(1); } #endif return(0); } #endif /****************************************************************** * * int regfile(char *path, int allowSymlinks) * * test if *path points to a regular file (or is a symbolic link, * if allowSymlinks != 0). * * returns 0 on success, -1 when it fails. * ******************************************************************/ int regfile(char *path, int allowSymlinks, CFlag *ipFlag, const char *progname) { #ifdef D2U_UNIFILE struct _stat buf; wchar_t pathw[D2U_MAX_PATH]; #else struct stat buf; #endif #ifdef D2U_UNIFILE d2u_MultiByteToWideChar(CP_UTF8, 0, path, -1, pathw, D2U_MAX_PATH); if (_wstat(pathw, &buf) == 0) { #else if (STAT(path, &buf) == 0) { #endif #if DEBUG D2U_UTF8_FPRINTF(stderr, "%s: %s", progname, path); D2U_UTF8_FPRINTF(stderr, " MODE 0%o ", buf.st_mode); #ifdef S_ISSOCK if (S_ISSOCK(buf.st_mode)) D2U_UTF8_FPRINTF(stderr, " (socket)"); #endif #ifdef S_ISLNK if (S_ISLNK(buf.st_mode)) D2U_UTF8_FPRINTF(stderr, " (symbolic link)"); #endif if (S_ISREG(buf.st_mode)) D2U_UTF8_FPRINTF(stderr, " (regular file)"); #ifdef S_ISBLK if (S_ISBLK(buf.st_mode)) D2U_UTF8_FPRINTF(stderr, " (block device)"); #endif if (S_ISDIR(buf.st_mode)) D2U_UTF8_FPRINTF(stderr, " (directory)"); if (S_ISCHR(buf.st_mode)) D2U_UTF8_FPRINTF(stderr, " (character device)"); if (S_ISFIFO(buf.st_mode)) D2U_UTF8_FPRINTF(stderr, " (FIFO)"); D2U_UTF8_FPRINTF(stderr, "\n"); #endif if ((S_ISREG(buf.st_mode)) #ifdef S_ISLNK || (S_ISLNK(buf.st_mode) && allowSymlinks) #endif ) return(0); else return(-1); } else { if (ipFlag->verbose) { char *errstr = strerror(errno); ipFlag->error = errno; D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, path); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } return(-1); } } /****************************************************************** * * int regfile_target(char *path) * * test if *path points to a regular file (follow symbolic link) * * returns 0 on success, -1 when it fails. * ******************************************************************/ int regfile_target(char *path, CFlag *ipFlag, const char *progname) { #ifdef D2U_UNIFILE struct _stat buf; wchar_t pathw[D2U_MAX_PATH]; #else struct stat buf; #endif #ifdef D2U_UNIFILE d2u_MultiByteToWideChar(CP_UTF8, 0, path, -1, pathw, D2U_MAX_PATH); if (_wstat(pathw, &buf) == 0) { #else if (stat(path, &buf) == 0) { #endif if (S_ISREG(buf.st_mode)) return(0); else return(-1); } else { if (ipFlag->verbose) { char *errstr = strerror(errno); ipFlag->error = errno; D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, path); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } return(-1); } } /* * glob_warg() expands the wide command line arguments. * Input : wide Unicode arguments. * Output : argv : expanded arguments in UTF-8 format. * Returns: new argc value. * -1 when an error occurred. * */ #ifdef D2U_UNIFILE int glob_warg(int argc, wchar_t *wargv[], char ***argv, CFlag *ipFlag, const char *progname) { int i; int argc_glob = 0; wchar_t *warg; wchar_t *path; wchar_t *path_and_filename; wchar_t *ptr; char *arg; char **argv_new; char *errstr; size_t len; int found, add_path; WIN32_FIND_DATA FindFileData; HANDLE hFind; argv_new = (char **)malloc(sizeof(char**)); if (argv_new == NULL) goto glob_failed; len = (size_t)d2u_WideCharToMultiByte(CP_UTF8, 0, wargv[0], -1, NULL, 0, NULL, NULL); arg = (char *)malloc(len); if (arg == NULL) goto glob_failed; d2u_WideCharToMultiByte(CP_UTF8, 0, wargv[argc_glob], -1, arg, (int)len, NULL, NULL); argv_new[argc_glob] = arg; for (i=1; iverbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s:", progname); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } return -1; } #endif void PrintBSDLicense(void) { D2U_ANSI_FPRINTF(stdout,"%s", _("\ Redistribution and use in source and binary forms, with or without\n\ modification, are permitted provided that the following conditions\n\ are met:\n\ 1. Redistributions of source code must retain the above copyright\n\ notice, this list of conditions and the following disclaimer.\n\ 2. Redistributions in binary form must reproduce the above copyright\n\ notice in the documentation and/or other materials provided with\n\ the distribution.\n\n\ ")); D2U_ANSI_FPRINTF(stdout,"%s", _("\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n\ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n\ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n\ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n\ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n\ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n\ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n\ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n\ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\ ")); } int is_dos2unix(const char *progname) { if ((strncmp(progname, "dos2unix", sizeof("dos2unix")) == 0) || (strncmp(progname, "mac2unix", sizeof("mac2unix")) == 0)) return 1; else return 0; } void PrintUsage(const char *progname) { D2U_ANSI_FPRINTF(stdout,_("Usage: %s [options] [file ...] [-n infile outfile ...]\n"), progname); D2U_ANSI_FPRINTF(stdout,_(" -ascii convert only line breaks (default)\n")); D2U_ANSI_FPRINTF(stdout,_(" -iso conversion between DOS and ISO-8859-1 character set\n")); D2U_ANSI_FPRINTF(stdout,_(" -1252 use Windows code page 1252 (Western European)\n")); D2U_ANSI_FPRINTF(stdout,_(" -437 use DOS code page 437 (US) (default)\n")); D2U_ANSI_FPRINTF(stdout,_(" -850 use DOS code page 850 (Western European)\n")); D2U_ANSI_FPRINTF(stdout,_(" -860 use DOS code page 860 (Portuguese)\n")); D2U_ANSI_FPRINTF(stdout,_(" -863 use DOS code page 863 (French Canadian)\n")); D2U_ANSI_FPRINTF(stdout,_(" -865 use DOS code page 865 (Nordic)\n")); D2U_ANSI_FPRINTF(stdout,_(" -7 convert 8 bit characters to 7 bit space\n")); if (is_dos2unix(progname)) D2U_ANSI_FPRINTF(stdout,_(" -b, --keep-bom keep Byte Order Mark\n")); else D2U_ANSI_FPRINTF(stdout,_(" -b, --keep-bom keep Byte Order Mark (default)\n")); D2U_ANSI_FPRINTF(stdout,_(" -c, --convmode conversion mode\n\ convmode ascii, 7bit, iso, mac, default to ascii\n")); #ifdef D2U_UNIFILE D2U_ANSI_FPRINTF(stdout,_(" -D, --display-enc set encoding of displayed text messages\n\ encoding ansi, unicode, utf8, default to ansi\n")); #endif D2U_ANSI_FPRINTF(stdout,_(" -f, --force force conversion of binary files\n")); #ifdef D2U_UNICODE #if (defined(_WIN32) && !defined(__CYGWIN__)) D2U_ANSI_FPRINTF(stdout,_(" -gb, --gb18030 convert UTF-16 to GB18030\n")); #endif #endif D2U_ANSI_FPRINTF(stdout,_(" -h, --help display this help text\n")); D2U_ANSI_FPRINTF(stdout,_(" -i, --info[=FLAGS] display file information\n\ file ... files to analyze\n")); D2U_ANSI_FPRINTF(stdout,_(" -k, --keepdate keep output file date\n")); D2U_ANSI_FPRINTF(stdout,_(" -L, --license display software license\n")); D2U_ANSI_FPRINTF(stdout,_(" -l, --newline add additional newline\n")); D2U_ANSI_FPRINTF(stdout,_(" -m, --add-bom add Byte Order Mark (default UTF-8)\n")); D2U_ANSI_FPRINTF(stdout,_(" -n, --newfile write to new file\n\ infile original file in new-file mode\n\ outfile output file in new-file mode\n")); D2U_ANSI_FPRINTF(stdout,_(" -o, --oldfile write to old file (default)\n\ file ... files to convert in old-file mode\n")); D2U_ANSI_FPRINTF(stdout,_(" -q, --quiet quiet mode, suppress all warnings\n")); if (is_dos2unix(progname)) D2U_ANSI_FPRINTF(stdout,_(" -r, --remove-bom remove Byte Order Mark (default)\n")); else D2U_ANSI_FPRINTF(stdout,_(" -r, --remove-bom remove Byte Order Mark\n")); D2U_ANSI_FPRINTF(stdout,_(" -s, --safe skip binary files (default)\n")); #ifdef D2U_UNICODE D2U_ANSI_FPRINTF(stdout,_(" -u, --keep-utf16 keep UTF-16 encoding\n")); D2U_ANSI_FPRINTF(stdout,_(" -ul, --assume-utf16le assume that the input format is UTF-16LE\n")); D2U_ANSI_FPRINTF(stdout,_(" -ub, --assume-utf16be assume that the input format is UTF-16BE\n")); #endif D2U_ANSI_FPRINTF(stdout,_(" -v, --verbose verbose operation\n")); #ifdef S_ISLNK D2U_ANSI_FPRINTF(stdout,_(" -F, --follow-symlink follow symbolic links and convert the targets\n")); #endif #if defined(S_ISLNK) || (defined(_WIN32) && !defined(__CYGWIN__)) D2U_ANSI_FPRINTF(stdout,_(" -R, --replace-symlink replace symbolic links with converted files\n\ (original target files remain unchanged)\n")); D2U_ANSI_FPRINTF(stdout,_(" -S, --skip-symlink keep symbolic links and targets unchanged (default)\n")); #endif D2U_ANSI_FPRINTF(stdout,_(" -V, --version display version number\n")); } #define MINGW32_W64 1 void PrintVersion(const char *progname, const char *localedir) { D2U_ANSI_FPRINTF(stdout,"%s %s (%s)\n", progname, VER_REVISION, VER_DATE); #if DEBUG D2U_ANSI_FPRINTF(stdout,"VER_AUTHOR: %s\n", VER_AUTHOR); #endif #if defined(__WATCOMC__) && defined(__I86__) D2U_ANSI_FPRINTF(stdout,"%s", _("DOS 16 bit version (WATCOMC).\n")); #elif defined(__TURBOC__) && defined(__MSDOS__) D2U_ANSI_FPRINTF(stdout,"%s", _("DOS 16 bit version (TURBOC).\n")); #elif defined(__WATCOMC__) && defined(__DOS__) D2U_ANSI_FPRINTF(stdout,"%s", _("DOS 32 bit version (WATCOMC).\n")); #elif defined(__DJGPP__) D2U_ANSI_FPRINTF(stdout,"%s", _("DOS 32 bit version (DJGPP).\n")); #elif defined(__MSYS__) D2U_ANSI_FPRINTF(stdout,"%s", _("MSYS version.\n")); #elif defined(__CYGWIN__) D2U_ANSI_FPRINTF(stdout,"%s", _("Cygwin version.\n")); #elif defined(__WIN64__) && defined(__MINGW64__) D2U_ANSI_FPRINTF(stdout,"%s", _("Windows 64 bit version (MinGW-w64).\n")); #elif defined(__WATCOMC__) && defined(__NT__) D2U_ANSI_FPRINTF(stdout,"%s", _("Windows 32 bit version (WATCOMC).\n")); #elif defined(_WIN32) && defined(__MINGW32__) && (D2U_COMPILER == MINGW32_W64) D2U_ANSI_FPRINTF(stdout,"%s", _("Windows 32 bit version (MinGW-w64).\n")); #elif defined(_WIN32) && defined(__MINGW32__) D2U_ANSI_FPRINTF(stdout,"%s", _("Windows 32 bit version (MinGW).\n")); #elif defined(_WIN64) && defined(_MSC_VER) D2U_ANSI_FPRINTF(stdout,_("Windows 64 bit version (MSVC %d).\n"),_MSC_VER); #elif defined(_WIN32) && defined(_MSC_VER) D2U_ANSI_FPRINTF(stdout,_("Windows 32 bit version (MSVC %d).\n"),_MSC_VER); #elif defined (__OS2__) && defined(__WATCOMC__) /* OS/2 Warp */ D2U_ANSI_FPRINTF(stdout,"%s", _("OS/2 version (WATCOMC).\n")); #elif defined (__OS2__) && defined(__EMX__) /* OS/2 Warp */ D2U_ANSI_FPRINTF(stdout,"%s", _("OS/2 version (EMX).\n")); #elif defined(__OS) D2U_ANSI_FPRINTF(stdout,_("%s version.\n"), __OS); #endif #if defined(_WIN32) && defined(WINVER) D2U_ANSI_FPRINTF(stdout,"WINVER 0x%X\n",WINVER); #endif #ifdef D2U_UNICODE D2U_ANSI_FPRINTF(stdout,"%s", _("With Unicode UTF-16 support.\n")); #else D2U_ANSI_FPRINTF(stdout,"%s", _("Without Unicode UTF-16 support.\n")); #endif #ifdef _WIN32 #ifdef D2U_UNIFILE D2U_ANSI_FPRINTF(stdout,"%s", _("With Unicode file name support.\n")); #else D2U_ANSI_FPRINTF(stdout,"%s", _("Without Unicode file name support.\n")); #endif #endif #ifdef ENABLE_NLS D2U_ANSI_FPRINTF(stdout,"%s", _("With native language support.\n")); #else D2U_ANSI_FPRINTF(stdout,"%s", "Without native language support.\n"); #endif #ifdef ENABLE_NLS D2U_ANSI_FPRINTF(stdout,"LOCALEDIR: %s\n", localedir); #endif D2U_ANSI_FPRINTF(stdout,"http://waterlan.home.xs4all.nl/dos2unix.html\n"); } /* opens file of name ipFN in read only mode * RetVal: NULL if failure * file stream otherwise */ FILE* OpenInFile(char *ipFN) { #ifdef D2U_UNIFILE wchar_t pathw[D2U_MAX_PATH]; d2u_MultiByteToWideChar(CP_UTF8, 0, ipFN, -1, pathw, D2U_MAX_PATH); return _wfopen(pathw, R_CNTRLW); #else return (fopen(ipFN, R_CNTRL)); #endif } /* opens file of name opFN in write only mode * RetVal: NULL if failure * file stream otherwise */ FILE* OpenOutFile(char *opFN) { #ifdef D2U_UNIFILE wchar_t pathw[D2U_MAX_PATH]; d2u_MultiByteToWideChar(CP_UTF8, 0, opFN, -1, pathw, D2U_MAX_PATH); return _wfopen(pathw, W_CNTRLW); #else return (fopen(opFN, W_CNTRL)); #endif } /* opens file descriptor in write only mode * RetVal: NULL if failure * file stream otherwise */ FILE* OpenOutFiled(int fd) { return (fdopen(fd, W_CNTRL)); } #if defined(__TURBOC__) || defined(__MSYS__) || defined(_MSC_VER) /* Both dirname() and basename() may modify the contents of path. * It may be desirable to pass a copy. */ char *dirname(char *path) { char *ptr; /* replace all back slashes with slashes */ while ( (ptr = strchr(path,'\\')) != NULL) *ptr = '/'; /* Code checkers may report that the condition (path == NULL) is redundant. E.g. Cppcheck 1.72. The condition (path == NULL) is needed, because the behaviour of strrchr is not specified when it get's a NULL string. The behaviour may be undefined, dependent on the implementation. */ if ((path == NULL) || ((ptr=strrchr(path,'/')) == NULL)) return "."; if (strcmp(path,"/") == 0) return "/"; *ptr = '\0'; return path; } char *basename(char *path) { char *ptr; /* replace all back slashes with slashes */ while ( (ptr = strchr(path,'\\')) != NULL) *ptr = '/'; /* Code checkers may report that the condition (path == NULL) is redundant. E.g. Cppcheck 1.72. The condition (path == NULL) is needed, because the behaviour of strrchr is not specified when it get's a NULL string. The behaviour may be undefined, dependent on the implementation. */ if ((path == NULL) || ((ptr=strrchr(path,'/')) == NULL)) return path ; if (strcmp(path,"/") == 0) return "/"; ptr++; return ptr ; } #endif /* Standard mktemp() is not safe to use (See mktemp(3)). * On Windows it is recommended to use GetTempFileName() (See MSDN). * This mktemp() wrapper redirects to GetTempFileName() on Windows. * On Windows template is not modified, the returned pointer has to * be used. */ #ifdef NO_MKSTEMP char *d2u_mktemp(char *template) { #if defined(_WIN32) && !defined(__CYGWIN__) unsigned int uRetVal; char *cpy1, *cpy2, *dn, *bn; char *ptr; size_t len; #ifdef D2U_UNIFILE /* template is UTF-8 formatted. */ wchar_t dnw[MAX_PATH]; wchar_t bnw[MAX_PATH]; wchar_t szTempFileNamew[MAX_PATH]; char *fname_str; int error = 0; #else char szTempFileName[MAX_PATH]; char *fname_str; #endif if ((cpy1 = strdup(template)) == NULL) return NULL; if ((cpy2 = strdup(template)) == NULL) { free(cpy1); return NULL; } dn = dirname(cpy1); bn = basename(cpy2); #ifdef D2U_UNIFILE /* template is UTF-8 formatted. */ if (d2u_MultiByteToWideChar(CP_UTF8, 0, dn, -1, NULL, 0) > (MAX_PATH - 15)) { D2U_UTF8_FPRINTF(stderr, "%s: ", "dos2unix"); D2U_ANSI_FPRINTF(stderr, _("Path for temporary output file is too long:")); D2U_UTF8_FPRINTF(stderr, " %s\n", dn); error=1; } if ((!error) && (d2u_MultiByteToWideChar(CP_UTF8, 0, dn, -1, dnw, MAX_PATH) == 0)) error=1; if ((!error) && (d2u_MultiByteToWideChar(CP_UTF8, 0, bn, -1, bnw, MAX_PATH) == 0)) error=1; free(cpy1); free(cpy2); if (error) return NULL; uRetVal = GetTempFileNameW(dnw, bnw, 0, szTempFileNamew); if (! uRetVal) { d2u_PrintLastError("dos2unix"); return NULL; } len =(size_t) d2u_WideCharToMultiByte(CP_UTF8, 0, szTempFileNamew, -1, NULL, 0, NULL, NULL); fname_str = (char *)malloc(len); if (! fname_str) return NULL; if (d2u_WideCharToMultiByte(CP_UTF8, 0, szTempFileNamew, -1, fname_str, MAX_PATH, NULL, NULL) == 0) return NULL; #else uRetVal = GetTempFileNameA(dn, bn, 0, szTempFileName); free(cpy1); free(cpy2); if (! uRetVal) { d2u_PrintLastError("dos2unix"); return NULL; } len = strlen(szTempFileName) +1; fname_str = (char *)malloc(len); if (! fname_str) return NULL; strcpy(fname_str, szTempFileName); #endif /* replace all back slashes with slashes */ while ( (ptr = strchr(fname_str,'\\')) != NULL) *ptr = '/'; return fname_str; #else return mktemp(template); #endif } #endif FILE* MakeTempFileFrom(const char *OutFN, char **fname_ret) { char *cpy = strdup(OutFN); char *dir = NULL; size_t fname_len = 0; char *fname_str = NULL; FILE *fp = NULL; /* file pointer */ #ifdef NO_MKSTEMP char *name; #else int fd = -1; /* file descriptor */ #endif *fname_ret = NULL; if (!cpy) goto make_failed; dir = dirname(cpy); fname_len = strlen(dir) + strlen("/d2utmpXXXXXX") + sizeof (char); if (!(fname_str = (char *)malloc(fname_len))) goto make_failed; sprintf(fname_str, "%s%s", dir, "/d2utmpXXXXXX"); *fname_ret = fname_str; free(cpy); #ifdef NO_MKSTEMP if ((name = d2u_mktemp(fname_str)) == NULL) goto make_failed; *fname_ret = name; if ((fp = OpenOutFile(name)) == NULL) goto make_failed; #else if ((fd = mkstemp(fname_str)) == -1) goto make_failed; if ((fp=OpenOutFiled(fd)) == NULL) goto make_failed; #endif return (fp); make_failed: free(*fname_ret); *fname_ret = NULL; return NULL; } /* Test if *lFN is the name of a symbolic link. If not, set *rFN equal * to lFN, and return 0. If so, then use canonicalize_file_name or * realpath to determine the pointed-to file; the resulting name is * stored in newly allocated memory, *rFN is set to point to that value, * and 1 is returned. On error, -1 is returned and errno is set as * appropriate. * * Note that if symbolic links are not supported, then 0 is always returned * and *rFN = lFN. * * RetVal: 0 if success, and *lFN is not a symlink * 1 if success, and *lFN is a symlink * -1 otherwise */ int ResolveSymbolicLink(char *lFN, char **rFN, CFlag *ipFlag, const char *progname) { int RetVal = 0; #ifdef S_ISLNK struct stat StatBuf; char *errstr; char *targetFN = NULL; if (STAT(lFN, &StatBuf)) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, lFN); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } RetVal = -1; } else if (S_ISLNK(StatBuf.st_mode)) { #if USE_CANONICALIZE_FILE_NAME targetFN = canonicalize_file_name(lFN); if (!targetFN) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, lFN); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } RetVal = -1; } else { *rFN = targetFN; RetVal = 1; } #else /* Sigh. Use realpath, but realize that it has a fatal * flaw: PATH_MAX isn't necessarily the maximum path * length -- so realpath() might fail. */ targetFN = (char *) malloc(PATH_MAX * sizeof(char)); if (!targetFN) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, lFN); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } RetVal = -1; } else { /* is there any platform with S_ISLNK that does not have realpath? */ char *rVal = realpath(lFN, targetFN); if (!rVal) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, lFN); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } free(targetFN); RetVal = -1; } else { *rFN = rVal; RetVal = 1; } } #endif /* !USE_CANONICALIZE_FILE_NAME */ } else *rFN = lFN; #else /* !S_ISLNK */ *rFN = lFN; #endif /* !S_ISLNK */ return RetVal; } /* Read the Byte Order Mark. Returns file pointer or NULL in case of a read error */ FILE *read_bom (FILE *f, int *bomtype) { /* BOMs * UTF16-LE ff fe * UTF16-BE fe ff * UTF-8 ef bb bf * GB18030 84 31 95 33 */ *bomtype = FILE_MBS; /* Check for BOM */ if (f != NULL) { int bom[4]; if ((bom[0] = fgetc(f)) == EOF) { if (ferror(f)) { return NULL; } *bomtype = FILE_MBS; return(f); } if ((bom[0] != 0xff) && (bom[0] != 0xfe) && (bom[0] != 0xef) && (bom[0] != 0x84)) { if (ungetc(bom[0], f) == EOF) return NULL; *bomtype = FILE_MBS; return(f); } if ((bom[1] = fgetc(f)) == EOF) { if (ferror(f)) { return NULL; } if (ungetc(bom[1], f) == EOF) return NULL; if (ungetc(bom[0], f) == EOF) return NULL; *bomtype = FILE_MBS; return(f); } if ((bom[0] == 0xff) && (bom[1] == 0xfe)) { /* UTF16-LE */ *bomtype = FILE_UTF16LE; return(f); } if ((bom[0] == 0xfe) && (bom[1] == 0xff)) { /* UTF16-BE */ *bomtype = FILE_UTF16BE; return(f); } if ((bom[2] = fgetc(f)) == EOF) { if (ferror(f)) { return NULL; } if (ungetc(bom[2], f) == EOF) return NULL; if (ungetc(bom[1], f) == EOF) return NULL; if (ungetc(bom[0], f) == EOF) return NULL; *bomtype = FILE_MBS; return(f); } if ((bom[0] == 0xef) && (bom[1] == 0xbb) && (bom[2]== 0xbf)) { /* UTF-8 */ *bomtype = FILE_UTF8; return(f); } if ((bom[0] == 0x84) && (bom[1] == 0x31) && (bom[2]== 0x95)) { bom[3] = fgetc(f); if (ferror(f)) { return NULL; } if (bom[3]== 0x33) { /* GB18030 */ *bomtype = FILE_GB18030; return(f); } if (ungetc(bom[3], f) == EOF) return NULL; } if (ungetc(bom[2], f) == EOF) return NULL; if (ungetc(bom[1], f) == EOF) return NULL; if (ungetc(bom[0], f) == EOF) return NULL; *bomtype = FILE_MBS; return(f); } return(f); } FILE *write_bom (FILE *f, CFlag *ipFlag, const char *progname) { int bomtype = ipFlag->bomtype; if ((bomtype == FILE_MBS)&&(ipFlag->locale_target == TARGET_GB18030)) bomtype = FILE_GB18030; if (ipFlag->keep_utf16) { switch (bomtype) { case FILE_UTF16LE: /* UTF-16 Little Endian */ if (fprintf(f, "%s", "\xFF\xFE") < 0) return NULL; if (ipFlag->verbose > 1) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_ANSI_FPRINTF(stderr, _("Writing %s BOM.\n"), _("UTF-16LE")); } break; case FILE_UTF16BE: /* UTF-16 Big Endian */ if (fprintf(f, "%s", "\xFE\xFF") < 0) return NULL; if (ipFlag->verbose > 1) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_ANSI_FPRINTF(stderr, _("Writing %s BOM.\n"), _("UTF-16BE")); } break; case FILE_GB18030: /* GB18030 */ if (fprintf(f, "%s", "\x84\x31\x95\x33") < 0) return NULL; if (ipFlag->verbose > 1) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_ANSI_FPRINTF(stderr, _("Writing %s BOM.\n"), _("GB18030")); } break; default: /* UTF-8 */ if (fprintf(f, "%s", "\xEF\xBB\xBF") < 0) return NULL; if (ipFlag->verbose > 1) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_ANSI_FPRINTF(stderr, _("Writing %s BOM.\n"), _("UTF-8")); } ; } } else { if ((bomtype == FILE_GB18030) || (((bomtype == FILE_UTF16LE)||(bomtype == FILE_UTF16BE))&&(ipFlag->locale_target == TARGET_GB18030)) ) { if (fprintf(f, "%s", "\x84\x31\x95\x33") < 0) return NULL; /* GB18030 */ if (ipFlag->verbose > 1) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_ANSI_FPRINTF(stderr, _("Writing %s BOM.\n"), _("GB18030")); } } else { if (fprintf(f, "%s", "\xEF\xBB\xBF") < 0) return NULL; /* UTF-8 */ if (ipFlag->verbose > 1) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_ANSI_FPRINTF(stderr, _("Writing %s BOM.\n"), _("UTF-8")); } } } return(f); } void print_bom (const int bomtype, const char *filename, const char *progname) { char informat[64]; switch (bomtype) { case FILE_UTF16LE: /* UTF-16 Little Endian */ strncpy(informat,_("UTF-16LE"),sizeof(informat)); break; case FILE_UTF16BE: /* UTF-16 Big Endian */ strncpy(informat,_("UTF-16BE"),sizeof(informat)); break; case FILE_UTF8: /* UTF-8 */ strncpy(informat,_("UTF-8"),sizeof(informat)); break; case FILE_GB18030: /* GB18030 */ strncpy(informat,_("GB18030"),sizeof(informat)); break; default: ; } if (bomtype > 0) { #ifdef D2U_UNIFILE wchar_t informatw[64]; #endif informat[sizeof(informat)-1] = '\0'; /* Change informat to UTF-8 for d2u_utf8_fprintf. */ #ifdef D2U_UNIFILE /* The format string is encoded in the system default * Windows ANSI code page. May have been translated * by gettext. Convert it to wide characters. */ d2u_MultiByteToWideChar(CP_ACP,0, informat, -1, informatw, sizeof(informat)); /* then convert the format string to UTF-8 */ d2u_WideCharToMultiByte(CP_UTF8, 0, informatw, -1, informat, sizeof(informat), NULL, NULL); #endif D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Input file %s has %s BOM.\n"), filename, informat); } } void print_bom_info (const int bomtype) { /* The BOM info must not be translated to other languages, otherwise scripts that process the output may not work in other than English locales. */ switch (bomtype) { case FILE_UTF16LE: /* UTF-16 Little Endian */ D2U_UTF8_FPRINTF(stdout, " UTF-16LE"); break; case FILE_UTF16BE: /* UTF-16 Big Endian */ D2U_UTF8_FPRINTF(stdout, " UTF-16BE"); break; case FILE_UTF8: /* UTF-8 */ D2U_UTF8_FPRINTF(stdout, " UTF-8 "); break; case FILE_GB18030: /* GB18030 */ D2U_UTF8_FPRINTF(stdout, " GB18030 "); break; default: D2U_UTF8_FPRINTF(stdout, " no_bom "); ; } } int check_unicode_info(FILE *InF, CFlag *ipFlag, const char *progname, int *bomtype_orig) { int RetVal = 0; #ifdef D2U_UNICODE if (ipFlag->verbose > 1) { if (ipFlag->ConvMode == CONVMODE_UTF16LE) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Assuming UTF-16LE encoding.\n") ); } if (ipFlag->ConvMode == CONVMODE_UTF16BE) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Assuming UTF-16BE encoding.\n") ); } } #endif if ((InF = read_bom(InF, &ipFlag->bomtype)) == NULL) { d2u_getc_error(ipFlag,progname); return -1; } *bomtype_orig = ipFlag->bomtype; #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16LE)) ipFlag->bomtype = FILE_UTF16LE; if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16BE)) ipFlag->bomtype = FILE_UTF16BE; #if !defined(_WIN32) && !defined(__CYGWIN__) /* Not Windows or Cygwin */ if (!ipFlag->keep_utf16 && ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE))) { if (sizeof(wchar_t) < 4) { /* A decoded UTF-16 surrogate pair must fit in a wchar_t */ ipFlag->status |= WCHAR_T_TOO_SMALL ; if (!ipFlag->error) ipFlag->error = 1; RetVal = -1; } } #endif #endif return RetVal; } int check_unicode(FILE *InF, FILE *TempF, CFlag *ipFlag, const char *ipInFN, const char *progname) { int RetVal = 0; #ifdef D2U_UNICODE if (ipFlag->verbose > 1) { if (ipFlag->ConvMode == CONVMODE_UTF16LE) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Assuming UTF-16LE encoding.\n") ); } if (ipFlag->ConvMode == CONVMODE_UTF16BE) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Assuming UTF-16BE encoding.\n") ); } } #endif if ((InF = read_bom(InF, &ipFlag->bomtype)) == NULL) { d2u_getc_error(ipFlag,progname); return -1; } if (ipFlag->verbose > 1) print_bom(ipFlag->bomtype, ipInFN, progname); #ifndef D2U_UNICODE /* It is possible that an UTF-16 has no 8-bit binary symbols. We must stop * processing an UTF-16 file when UTF-16 is not supported. Don't trust on * finding a binary symbol. */ if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { ipFlag->status |= UNICODE_NOT_SUPPORTED ; return -1; } #endif #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16LE)) ipFlag->bomtype = FILE_UTF16LE; if ((ipFlag->bomtype == FILE_MBS) && (ipFlag->ConvMode == CONVMODE_UTF16BE)) ipFlag->bomtype = FILE_UTF16BE; #if !defined(_WIN32) && !defined(__CYGWIN__) /* Not Windows or Cygwin */ if (!ipFlag->keep_utf16 && ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE))) { if (sizeof(wchar_t) < 4) { /* A decoded UTF-16 surrogate pair must fit in a wchar_t */ ipFlag->status |= WCHAR_T_TOO_SMALL ; if (!ipFlag->error) ipFlag->error = 1; RetVal = -1; } } #endif #if !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__) /* Unix, Cygwin */ if (strcmp(nl_langinfo(CODESET), "GB18030") == 0) ipFlag->locale_target = TARGET_GB18030; #endif #endif if ((!RetVal) && ((ipFlag->add_bom) || ((ipFlag->keep_bom) && (ipFlag->bomtype > 0)))) if (write_bom(TempF, ipFlag, progname) == NULL) return -1; return RetVal; } /* convert file ipInFN and write to file ipOutFN * RetVal: 0 if success * -1 otherwise */ int ConvertNewFile(char *ipInFN, char *ipOutFN, CFlag *ipFlag, const char *progname, int (*Convert)(FILE*, FILE*, CFlag *, const char *) #ifdef D2U_UNICODE , int (*ConvertW)(FILE*, FILE*, CFlag *, const char *) #endif ) { int RetVal = 0; FILE *InF = NULL; FILE *TempF = NULL; char *TempPath; char *errstr; #ifdef D2U_UNIFILE struct _stat StatBuf; wchar_t pathw[D2U_MAX_PATH]; #else struct stat StatBuf; #endif struct utimbuf UTimeBuf; #ifndef NO_CHMOD mode_t mask; #endif char *TargetFN = NULL; int ResolveSymlinkResult = 0; ipFlag->status = 0 ; /* Test if output file is a symbolic link */ if (symbolic_link(ipOutFN) && !ipFlag->Follow) { ipFlag->status |= OUTPUTFILE_SYMLINK ; /* Not a failure, skipping input file according spec. (keep symbolic link unchanged) */ return -1; } /* Test if input file is a regular file or symbolic link */ if (regfile(ipInFN, 1, ipFlag, progname)) { ipFlag->status |= NO_REGFILE ; /* Not a failure, skipping non-regular input file according spec. */ return -1; } /* Test if input file target is a regular file */ if (symbolic_link(ipInFN) && regfile_target(ipInFN, ipFlag,progname)) { ipFlag->status |= INPUT_TARGET_NO_REGFILE ; /* Not a failure, skipping non-regular input file according spec. */ return -1; } /* Test if output file target is a regular file */ if (symbolic_link(ipOutFN) && (ipFlag->Follow == SYMLINK_FOLLOW) && regfile_target(ipOutFN, ipFlag,progname)) { ipFlag->status |= OUTPUT_TARGET_NO_REGFILE ; /* Failure, input is regular, cannot produce output. */ if (!ipFlag->error) ipFlag->error = 1; return -1; } /* retrieve ipInFN file date stamp */ #ifdef D2U_UNIFILE d2u_MultiByteToWideChar(CP_UTF8, 0, ipInFN, -1, pathw, D2U_MAX_PATH); if (_wstat(pathw, &StatBuf)) { #else if (stat(ipInFN, &StatBuf)) { #endif if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, ipInFN); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } return -1; } /* can open in file? */ InF=OpenInFile(ipInFN); if (InF == NULL) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, ipInFN); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } return -1; } /* can open temp output file? */ if((TempF = MakeTempFileFrom(ipOutFN, &TempPath))==NULL) { if (ipFlag->verbose) { if (errno) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_ANSI_FPRINTF(stderr, _("Failed to open temporary output file: %s\n"), errstr); } else { /* In case temp path was too long on Windows, errno is 0. */ if (!ipFlag->error) ipFlag->error = 1; } } RetVal = -1; } #if DEBUG if (TempPath != NULL) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("using %s as temporary file\n"), TempPath); } #endif if (!RetVal) if (check_unicode(InF, TempF, ipFlag, ipInFN, progname)) RetVal = -1; /* conversion sucessful? */ #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { if ((!RetVal) && (ConvertW(InF, TempF, ipFlag, progname))) RetVal = -1; if (ipFlag->status & UNICODE_CONVERSION_ERROR) { if (!ipFlag->error) ipFlag->error = 1; RetVal = -1; } } else { if ((!RetVal) && (Convert(InF, TempF, ipFlag, progname))) RetVal = -1; } #else if ((!RetVal) && (Convert(InF, TempF, ipFlag, progname))) RetVal = -1; #endif /* can close in file? */ if (fclose(InF) == EOF) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Failed to close input file %s:"), ipInFN); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } RetVal = -1; } /* can close output file? */ if (TempF) { if (fclose(TempF) == EOF) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Failed to write to temporary output file %s:"), TempPath); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } RetVal = -1; } } #ifndef NO_CHMOD if (!RetVal) { if (ipFlag->NewFile == 0) { /* old-file mode */ RetVal = chmod (TempPath, StatBuf.st_mode); /* set original permissions */ } else { mask = umask(0); /* get process's umask */ umask(mask); /* set umask back to original */ RetVal = chmod(TempPath, StatBuf.st_mode & ~mask); /* set original permissions, minus umask */ } if (RetVal) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Failed to change the permissions of temporary output file %s:"), TempPath); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } } } #endif #ifndef NO_CHOWN if (!RetVal && (ipFlag->NewFile == 0)) { /* old-file mode */ /* Change owner and group of the temporary output file to the original file's uid and gid. */ /* Required when a different user (e.g. root) has write permission on the original file. */ /* Make sure that the original owner can still access the file. */ if (chown(TempPath, StatBuf.st_uid, StatBuf.st_gid)) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Failed to change the owner and group of temporary output file %s:"), TempPath); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } RetVal = -1; } } #endif if ((!RetVal) && (ipFlag->KeepDate)) { UTimeBuf.actime = StatBuf.st_atime; UTimeBuf.modtime = StatBuf.st_mtime; /* can change output file time to in file time? */ if (utime(TempPath, &UTimeBuf) == -1) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, TempPath); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } RetVal = -1; } } /* any error? cleanup the temp file */ if (RetVal && (TempPath != NULL)) { if (d2u_unlink(TempPath) && (errno != ENOENT)) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, TempPath); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } RetVal = -1; } } /* If output file is a symbolic link, optional resolve the link and modify */ /* the target, instead of removing the link and creating a new regular file */ TargetFN = ipOutFN; if (symbolic_link(ipOutFN) && !RetVal) { ResolveSymlinkResult = 0; /* indicates that TargetFN need not be freed */ if (ipFlag->Follow == SYMLINK_FOLLOW) { ResolveSymlinkResult = ResolveSymbolicLink(ipOutFN, &TargetFN, ipFlag, progname); if (ResolveSymlinkResult < 0) { if (ipFlag->verbose) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("problems resolving symbolic link '%s'\n"), ipOutFN); D2U_UTF8_FPRINTF(stderr, _(" output file remains in '%s'\n"), TempPath); } RetVal = -1; } } } /* can rename temporary file to output file? */ if (!RetVal) { #ifdef NEED_REMOVE if (d2u_unlink(TargetFN) && (errno != ENOENT)) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: %s:", progname, TargetFN); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } RetVal = -1; } #endif if (d2u_rename(TempPath, TargetFN) != 0) { if (ipFlag->verbose) { ipFlag->error = errno; errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("problems renaming '%s' to '%s':"), TempPath, TargetFN); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); #ifdef S_ISLNK if (ResolveSymlinkResult > 0) D2U_UTF8_FPRINTF(stderr, _(" which is the target of symbolic link '%s'\n"), ipOutFN); #endif D2U_UTF8_FPRINTF(stderr, _(" output file remains in '%s'\n"), TempPath); } RetVal = -1; } if (ResolveSymlinkResult > 0) free(TargetFN); } free(TempPath); return RetVal; } /* convert stdin and write to stdout * RetVal: 0 if success * -1 otherwise */ int ConvertStdio(CFlag *ipFlag, const char *progname, int (*Convert)(FILE*, FILE*, CFlag *, const char *) #ifdef D2U_UNICODE , int (*ConvertW)(FILE*, FILE*, CFlag *, const char *) #endif ) { ipFlag->NewFile = 1; ipFlag->KeepDate = 0; #if defined(_WIN32) && !defined(__CYGWIN__) /* stdin and stdout are by default text streams. We need * to set them to binary mode. Otherwise an LF will * automatically be converted to CR-LF on DOS/Windows. * Erwin */ /* POSIX 'setmode' was deprecated by MicroSoft since * Visual C++ 2005. Use ISO C++ conformant '_setmode' instead. */ _setmode(_fileno(stdout), _O_BINARY); _setmode(_fileno(stdin), _O_BINARY); #elif defined(__MSDOS__) || defined(__CYGWIN__) || defined(__OS2__) setmode(fileno(stdout), O_BINARY); setmode(fileno(stdin), O_BINARY); #endif if (check_unicode(stdin, stdout, ipFlag, "stdin", progname)) return -1; #ifdef D2U_UNICODE if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { return ConvertW(stdin, stdout, ipFlag, progname); } else { return Convert(stdin, stdout, ipFlag, progname); } #else return Convert(stdin, stdout, ipFlag, progname); #endif } void print_messages_stdio(const CFlag *pFlag, const char *progname) { if (pFlag->status & BINARY_FILE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping binary file %s\n"), "stdin"); } else if (pFlag->status & WRONG_CODEPAGE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode); #ifdef D2U_UNICODE } else if (pFlag->status & WCHAR_T_TOO_SMALL) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), "stdin", (int)sizeof(wchar_t)); } else if (pFlag->status & UNICODE_CONVERSION_ERROR) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), "stdin", pFlag->line_nr); #else } else if (pFlag->status & UNICODE_NOT_SUPPORTED) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n"), "stdin", progname); #endif } } void print_format(const CFlag *pFlag, char *informat, char *outformat, size_t lin, size_t lout) { informat[0]='\0'; outformat[0]='\0'; if (pFlag->bomtype == FILE_UTF16LE) strncpy(informat,_("UTF-16LE"),lin); if (pFlag->bomtype == FILE_UTF16BE) strncpy(informat,_("UTF-16BE"),lin); informat[lin-1]='\0'; #ifdef D2U_UNICODE if ((pFlag->bomtype == FILE_UTF16LE)||(pFlag->bomtype == FILE_UTF16BE)) { #if !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__) /* Unix, Cygwin */ strncpy(outformat,nl_langinfo(CODESET),lout); #endif #if defined(_WIN32) && !defined(__CYGWIN__) /* Windows, not Cygwin */ if (pFlag->locale_target == TARGET_GB18030) strncpy(outformat, _("GB18030"),lout); else strncpy(outformat, _("UTF-8"),lout); #endif if (pFlag->keep_utf16) { if (pFlag->bomtype == FILE_UTF16LE) strncpy(outformat,_("UTF-16LE"),lout); if (pFlag->bomtype == FILE_UTF16BE) strncpy(outformat,_("UTF-16BE"),lout); } outformat[lout-1]='\0'; } #endif } void print_messages_newfile(const CFlag *pFlag, const char *infile, const char *outfile, const char *progname, const int RetVal) { char informat[32]; char outformat[64]; # ifdef D2U_UNIFILE wchar_t informatw[32]; wchar_t outformatw[64]; #endif print_format(pFlag, informat, outformat, sizeof(informat), sizeof(outformat)); /* Change informat and outformat to UTF-8 for d2u_utf8_fprintf. */ # ifdef D2U_UNIFILE /* The format string is encoded in the system default * Windows ANSI code page. May have been translated * by gettext. Convert it to wide characters. */ d2u_MultiByteToWideChar(CP_ACP,0, informat, -1, informatw, sizeof(informat)); d2u_MultiByteToWideChar(CP_ACP,0, outformat, -1, outformatw, sizeof(outformat)); /* then convert the format string to UTF-8 */ d2u_WideCharToMultiByte(CP_UTF8, 0, informatw, -1, informat, sizeof(informat), NULL, NULL); d2u_WideCharToMultiByte(CP_UTF8, 0, outformatw, -1, outformat, sizeof(outformat), NULL, NULL); #endif if (pFlag->status & NO_REGFILE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping %s, not a regular file.\n"), infile); } else if (pFlag->status & OUTPUTFILE_SYMLINK) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping %s, output file %s is a symbolic link.\n"), infile, outfile); } else if (pFlag->status & INPUT_TARGET_NO_REGFILE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), infile); } else if (pFlag->status & OUTPUT_TARGET_NO_REGFILE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping %s, target of symbolic link %s is not a regular file.\n"), infile, outfile); } else if (pFlag->status & BINARY_FILE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping binary file %s\n"), infile); } else if (pFlag->status & WRONG_CODEPAGE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode); #ifdef D2U_UNICODE } else if (pFlag->status & WCHAR_T_TOO_SMALL) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t)); } else if (pFlag->status & UNICODE_CONVERSION_ERROR) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), infile, pFlag->line_nr); #else } else if (pFlag->status & UNICODE_NOT_SUPPORTED) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n"), infile, progname); #endif } else { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); if (informat[0] == '\0') { if (is_dos2unix(progname)) { if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting file %s to file %s in Unix format...\n"), infile, outfile); } else { if (pFlag->FromToMode == FROMTO_UNIX2MAC) { if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting file %s to file %s in Mac format...\n"), infile, outfile); } else { if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting file %s to file %s in DOS format...\n"), infile, outfile); } } } else { if (is_dos2unix(progname)) { /* TRANSLATORS: 1st %s is encoding of input file. 2nd %s is name of input file. 3rd %s is encoding of output file. 4th %s is name of output file. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... */ if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting %s file %s to %s file %s in Unix format...\n"), informat, infile, outformat, outfile); } else { if (pFlag->FromToMode == FROMTO_UNIX2MAC) { if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting %s file %s to %s file %s in Mac format...\n"), informat, infile, outformat, outfile); } else { if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting %s file %s to %s file %s in DOS format...\n"), informat, infile, outformat, outfile); } } } if (RetVal) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("problems converting file %s to file %s\n"), infile, outfile); } } } void print_messages_oldfile(const CFlag *pFlag, const char *infile, const char *progname, const int RetVal) { char informat[10]; char outformat[32]; # ifdef D2U_UNIFILE wchar_t informatw[32]; wchar_t outformatw[64]; #endif print_format(pFlag, informat, outformat, sizeof(informat), sizeof(outformat)); /* Change informat and outformat to UTF-8 for d2u_utf8_fprintf. */ # ifdef D2U_UNIFILE /* The format string is encoded in the system default * Windows ANSI code page. May have been translated * by gettext. Convert it to wide characters. */ d2u_MultiByteToWideChar(CP_ACP,0, informat, -1, informatw, sizeof(informat)); d2u_MultiByteToWideChar(CP_ACP,0, outformat, -1, outformatw, sizeof(outformat)); /* then convert the format string to UTF-8 */ d2u_WideCharToMultiByte(CP_UTF8, 0, informatw, -1, informat, sizeof(informat), NULL, NULL); d2u_WideCharToMultiByte(CP_UTF8, 0, outformatw, -1, outformat, sizeof(outformat), NULL, NULL); #endif if (pFlag->status & NO_REGFILE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping %s, not a regular file.\n"), infile); } else if (pFlag->status & OUTPUTFILE_SYMLINK) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping symbolic link %s.\n"), infile); } else if (pFlag->status & INPUT_TARGET_NO_REGFILE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), infile); } else if (pFlag->status & BINARY_FILE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping binary file %s\n"), infile); } else if (pFlag->status & WRONG_CODEPAGE) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("code page %d is not supported.\n"), pFlag->ConvMode); #ifdef D2U_UNICODE } else if (pFlag->status & WCHAR_T_TOO_SMALL) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t)); } else if (pFlag->status & UNICODE_CONVERSION_ERROR) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n"), infile, pFlag->line_nr); #else } else if (pFlag->status & UNICODE_NOT_SUPPORTED) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n"), infile, progname); #endif } else { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); if (informat[0] == '\0') { if (is_dos2unix(progname)) { if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting file %s to Unix format...\n"), infile); } else { if (pFlag->FromToMode == FROMTO_UNIX2MAC) { if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting file %s to Mac format...\n"), infile); } else { if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting file %s to DOS format...\n"), infile); } } } else { if (is_dos2unix(progname)) { /* TRANSLATORS: 1st %s is encoding of input file. 2nd %s is name of input file. 3rd %s is encoding of output (input file is overwritten). E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... */ if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting %s file %s to %s Unix format...\n"), informat, infile, outformat); } else { if (pFlag->FromToMode == FROMTO_UNIX2MAC) { if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting %s file %s to %s Mac format...\n"), informat, infile, outformat); } else { if (!RetVal) D2U_UTF8_FPRINTF(stderr, _("converting %s file %s to %s DOS format...\n"), informat, infile, outformat); } } } if (RetVal) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("problems converting file %s\n"), infile); } } } void print_messages_info(const CFlag *pFlag, const char *infile, const char *progname) { if (pFlag->status & NO_REGFILE) { if (pFlag->verbose) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping %s, not a regular file.\n"), infile); } } else if (pFlag->status & INPUT_TARGET_NO_REGFILE) { if (pFlag->verbose) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping symbolic link %s, target is not a regular file.\n"), infile); } #ifdef D2U_UNICODE } else if (pFlag->status & WCHAR_T_TOO_SMALL) { if (pFlag->verbose) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n"), infile, (int)sizeof(wchar_t)); } #endif } } void printInfo(CFlag *ipFlag, const char *filename, int bomtype, unsigned int lb_dos, unsigned int lb_unix, unsigned int lb_mac) { if (ipFlag->file_info & INFO_CONVERT) { if ((ipFlag->FromToMode == FROMTO_DOS2UNIX) && (lb_dos == 0)) return; if (((ipFlag->FromToMode == FROMTO_UNIX2DOS)||(ipFlag->FromToMode == FROMTO_UNIX2MAC)) && (lb_unix == 0)) return; if ((ipFlag->FromToMode == FROMTO_MAC2UNIX) && (lb_mac == 0)) return; if ((ipFlag->Force == 0) && (ipFlag->status & BINARY_FILE)) return; } if ((ipFlag->file_info & INFO_HEADER) && (! header_done)) { if (ipFlag->file_info & INFO_DOS) D2U_UTF8_FPRINTF(stdout, " DOS"); if (ipFlag->file_info & INFO_UNIX) D2U_UTF8_FPRINTF(stdout, " UNIX"); if (ipFlag->file_info & INFO_MAC) D2U_UTF8_FPRINTF(stdout, " MAC"); if (ipFlag->file_info & INFO_BOM) D2U_UTF8_FPRINTF(stdout, " BOM "); if (ipFlag->file_info & INFO_TEXT) D2U_UTF8_FPRINTF(stdout, " TXTBIN"); if (*filename != '\0') D2U_UTF8_FPRINTF(stdout, " FILE"); D2U_UTF8_FPRINTF(stdout, "\n"); header_done = 1; } if (ipFlag->file_info & INFO_DOS) D2U_UTF8_FPRINTF(stdout, " %6u", lb_dos); if (ipFlag->file_info & INFO_UNIX) D2U_UTF8_FPRINTF(stdout, " %6u", lb_unix); if (ipFlag->file_info & INFO_MAC) D2U_UTF8_FPRINTF(stdout, " %6u", lb_mac); if (ipFlag->file_info & INFO_BOM) print_bom_info(bomtype); if (ipFlag->file_info & INFO_TEXT) { if (ipFlag->status & BINARY_FILE) D2U_UTF8_FPRINTF(stdout, " binary"); else D2U_UTF8_FPRINTF(stdout, " text "); } if (*filename != '\0') { const char *ptr; if ((ipFlag->file_info & INFO_NOPATH) && (((ptr=strrchr(filename,'/')) != NULL) || ((ptr=strrchr(filename,'\\')) != NULL)) ) ptr++; else ptr = filename; D2U_UTF8_FPRINTF(stdout, " %s",ptr); } D2U_UTF8_FPRINTF(stdout, "\n"); } #ifdef D2U_UNICODE void FileInfoW(FILE* ipInF, CFlag *ipFlag, const char *filename, int bomtype, const char *progname) { wint_t TempChar; wint_t PreviousChar = 0; unsigned int lb_dos = 0; unsigned int lb_unix = 0; unsigned int lb_mac = 0; ipFlag->status = 0; while ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { if ( (TempChar < 32) && (TempChar != 0x0a) && /* Not an LF */ (TempChar != 0x0d) && /* Not a CR */ (TempChar != 0x09) && /* Not a TAB */ (TempChar != 0x0c)) { /* Not a form feed */ ipFlag->status |= BINARY_FILE ; } if (TempChar != 0x0a) { /* Not an LF */ PreviousChar = TempChar; if (TempChar == 0x0d) /* CR */ lb_mac++; } else{ /* TempChar is an LF */ if ( PreviousChar == 0x0d ) { /* CR,LF pair. */ lb_dos++; lb_mac--; PreviousChar = TempChar; continue; } PreviousChar = TempChar; lb_unix++; /* Unix line end (LF). */ } } if ((TempChar == WEOF) && ferror(ipInF)) { ipFlag->error = errno; if (ipFlag->verbose) { char *errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("can not read from input file %s:"), filename); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } return; } printInfo(ipFlag, filename, bomtype, lb_dos, lb_unix, lb_mac); } #endif void FileInfo(FILE* ipInF, CFlag *ipFlag, const char *filename, int bomtype, const char *progname) { int TempChar; int PreviousChar = 0; unsigned int lb_dos = 0; unsigned int lb_unix = 0; unsigned int lb_mac = 0; ipFlag->status = 0; while ((TempChar = fgetc(ipInF)) != EOF) { if ( (TempChar < 32) && (TempChar != '\x0a') && /* Not an LF */ (TempChar != '\x0d') && /* Not a CR */ (TempChar != '\x09') && /* Not a TAB */ (TempChar != '\x0c')) { /* Not a form feed */ ipFlag->status |= BINARY_FILE ; } if (TempChar != '\x0a') { /* Not an LF */ PreviousChar = TempChar; if (TempChar == '\x0d') /* CR */ lb_mac++; } else { /* TempChar is an LF */ if ( PreviousChar == '\x0d' ) { /* CR,LF pair. */ lb_dos++; lb_mac--; PreviousChar = TempChar; continue; } PreviousChar = TempChar; lb_unix++; /* Unix line end (LF). */ } } if ((TempChar == EOF) && ferror(ipInF)) { ipFlag->error = errno; if (ipFlag->verbose) { char *errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("can not read from input file %s:"), filename); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } return; } printInfo(ipFlag, filename, bomtype, lb_dos, lb_unix, lb_mac); } int GetFileInfo(char *ipInFN, CFlag *ipFlag, const char *progname) { int RetVal = 0; FILE *InF = NULL; int bomtype_orig = FILE_MBS; /* messages must print the real bomtype, not the assumed bomtype */ ipFlag->status = 0 ; /* Test if input file is a regular file or symbolic link */ if (regfile(ipInFN, 1, ipFlag, progname)) { ipFlag->status |= NO_REGFILE ; /* Not a failure, skipping non-regular input file according spec. */ return -1; } /* Test if input file target is a regular file */ if (symbolic_link(ipInFN) && regfile_target(ipInFN, ipFlag,progname)) { ipFlag->status |= INPUT_TARGET_NO_REGFILE ; /* Not a failure, skipping non-regular input file according spec. */ return -1; } /* can open in file? */ InF=OpenInFile(ipInFN); if (InF == NULL) { if (ipFlag->verbose) { char *errstr = strerror(errno); ipFlag->error = errno; D2U_UTF8_FPRINTF(stderr, "%s: %s: ", progname, ipInFN); D2U_ANSI_FPRINTF(stderr, "%s\n", errstr); } RetVal = -1; } if (!RetVal) if (check_unicode_info(InF, ipFlag, progname, &bomtype_orig)) RetVal = -1; /* info sucessful? */ #ifdef D2U_UNICODE if (!RetVal) { if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { FileInfoW(InF, ipFlag, ipInFN, bomtype_orig, progname); } else { FileInfo(InF, ipFlag, ipInFN, bomtype_orig, progname); } } #else if (!RetVal) FileInfo(InF, ipFlag, ipInFN, bomtype_orig, progname); #endif /* can close in file? */ if (fclose(InF) == EOF) { if (ipFlag->verbose) { char *errstr = strerror(errno); ipFlag->error = errno; D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Failed to close input file %s:"), ipInFN); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); } RetVal = -1; } return RetVal; } int GetFileInfoStdio(CFlag *ipFlag, const char *progname) { int RetVal = 0; int bomtype_orig = FILE_MBS; /* messages must print the real bomtype, not the assumed bomtype */ ipFlag->status = 0 ; #if defined(_WIN32) && !defined(__CYGWIN__) /* stdin and stdout are by default text streams. We need * to set them to binary mode. Otherwise an LF will * automatically be converted to CR-LF on DOS/Windows. * Erwin */ /* POSIX 'setmode' was deprecated by MicroSoft since * Visual C++ 2005. Use ISO C++ conformant '_setmode' instead. */ _setmode(_fileno(stdin), _O_BINARY); #elif defined(__MSDOS__) || defined(__CYGWIN__) || defined(__OS2__) setmode(fileno(stdin), O_BINARY); #endif if (check_unicode_info(stdin, ipFlag, progname, &bomtype_orig)) RetVal = -1; /* info sucessful? */ #ifdef D2U_UNICODE if (!RetVal) { if ((ipFlag->bomtype == FILE_UTF16LE) || (ipFlag->bomtype == FILE_UTF16BE)) { FileInfoW(stdin, ipFlag, "", bomtype_orig, progname); } else { FileInfo(stdin, ipFlag, "", bomtype_orig, progname); } } #else if (!RetVal) FileInfo(stdin, ipFlag, "", bomtype_orig, progname); #endif return RetVal; } void get_info_options(char *option, CFlag *pFlag, const char *progname) { char *ptr; int default_info = 1; ptr = option; if (*ptr == '\0') { /* no flags */ pFlag->file_info |= INFO_DEFAULT; return; } while (*ptr != '\0') { switch (*ptr) { case 'd': /* Print nr of DOS line breaks. */ pFlag->file_info |= INFO_DOS; default_info = 0; break; case 'u': /* Print nr of Unix line breaks. */ pFlag->file_info |= INFO_UNIX; default_info = 0; break; case 'm': /* Print nr of Mac line breaks. */ pFlag->file_info |= INFO_MAC; default_info = 0; break; case 'b': /* Print BOM. */ pFlag->file_info |= INFO_BOM; default_info = 0; break; case 't': /* Text or binary. */ pFlag->file_info |= INFO_TEXT; default_info = 0; break; case 'c': /* Print only files that would be converted. */ pFlag->file_info |= INFO_CONVERT; default_info = 0; break; case 'h': /* Print a header. */ pFlag->file_info |= INFO_HEADER; break; case 'p': /* Remove path from file names. */ pFlag->file_info |= INFO_NOPATH; break; default: /* Terminate the program on a wrong option. If pFlag->file_info is zero and the program goes on, it may do unwanted conversions. */ D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr,_("wrong flag '%c' for option -i or --info\n"), *ptr); exit(1); ; } ptr++; } if (default_info) pFlag->file_info |= INFO_DEFAULT; } int parse_options(int argc, char *argv[], CFlag *pFlag, const char *localedir, const char *progname, void (*PrintLicense)(void), int (*Convert)(FILE*, FILE*, CFlag *, const char *) #ifdef D2U_UNICODE , int (*ConvertW)(FILE*, FILE*, CFlag *, const char *) #endif ) { int ArgIdx = 0; int ShouldExit = 0; int CanSwitchFileMode = 1; int process_options = 1; int RetVal = 0; #ifdef D2U_UNIFILE char *ptr; #endif /* variable initialisations */ pFlag->NewFile = 0; pFlag->verbose = 1; pFlag->KeepDate = 0; pFlag->ConvMode = CONVMODE_ASCII; /* default ascii */ pFlag->NewLine = 0; pFlag->Force = 0; pFlag->Follow = SYMLINK_SKIP; pFlag->status = 0; pFlag->stdio_mode = 1; pFlag->error = 0; pFlag->bomtype = FILE_MBS; pFlag->add_bom = 0; pFlag->keep_utf16 = 0; pFlag->file_info = 0; pFlag->locale_target = TARGET_UTF8; #ifdef D2U_UNIFILE ptr = getenv("DOS2UNIX_DISPLAY_ENC"); if (ptr != NULL) { if (strncmp(ptr, "ansi", sizeof("ansi")) == 0) d2u_display_encoding = D2U_DISPLAY_ANSI; else if (strncmp(ptr, "unicode", sizeof("unicode")) == 0) d2u_display_encoding = D2U_DISPLAY_UNICODE; else if (strncmp(ptr, "unicodebom", sizeof("unicodebom")) == 0) d2u_display_encoding = D2U_DISPLAY_UNICODEBOM; else if (strncmp(ptr, "utf8", sizeof("utf8")) == 0) d2u_display_encoding = D2U_DISPLAY_UTF8; else if (strncmp(ptr, "utf8bom", sizeof("utf8bom")) == 0) d2u_display_encoding = D2U_DISPLAY_UTF8BOM; } #endif while ((++ArgIdx < argc) && (!ShouldExit)) { /* is it an option? */ if ((argv[ArgIdx][0] == '-') && process_options) { /* an option */ if (strcmp(argv[ArgIdx],"--") == 0) process_options = 0; else if ((strcmp(argv[ArgIdx],"-h") == 0) || (strcmp(argv[ArgIdx],"--help") == 0)) { PrintUsage(progname); return(pFlag->error); } else if ((strcmp(argv[ArgIdx],"-b") == 0) || (strcmp(argv[ArgIdx],"--keep-bom") == 0)) pFlag->keep_bom = 1; else if ((strcmp(argv[ArgIdx],"-k") == 0) || (strcmp(argv[ArgIdx],"--keepdate") == 0)) pFlag->KeepDate = 1; else if ((strcmp(argv[ArgIdx],"-f") == 0) || (strcmp(argv[ArgIdx],"--force") == 0)) pFlag->Force = 1; #ifdef D2U_UNICODE #if (defined(_WIN32) && !defined(__CYGWIN__)) else if ((strcmp(argv[ArgIdx],"-gb") == 0) || (strcmp(argv[ArgIdx],"--gb18030") == 0)) pFlag->locale_target = TARGET_GB18030; #endif #endif else if ((strcmp(argv[ArgIdx],"-s") == 0) || (strcmp(argv[ArgIdx],"--safe") == 0)) pFlag->Force = 0; else if ((strcmp(argv[ArgIdx],"-q") == 0) || (strcmp(argv[ArgIdx],"--quiet") == 0)) pFlag->verbose = 0; else if ((strcmp(argv[ArgIdx],"-v") == 0) || (strcmp(argv[ArgIdx],"--verbose") == 0)) pFlag->verbose = 2; else if ((strcmp(argv[ArgIdx],"-l") == 0) || (strcmp(argv[ArgIdx],"--newline") == 0)) pFlag->NewLine = 1; else if ((strcmp(argv[ArgIdx],"-m") == 0) || (strcmp(argv[ArgIdx],"--add-bom") == 0)) pFlag->add_bom = 1; else if ((strcmp(argv[ArgIdx],"-r") == 0) || (strcmp(argv[ArgIdx],"--remove-bom") == 0)) { pFlag->keep_bom = 0; pFlag->add_bom = 0; } else if ((strcmp(argv[ArgIdx],"-S") == 0) || (strcmp(argv[ArgIdx],"--skip-symlink") == 0)) pFlag->Follow = SYMLINK_SKIP; else if ((strcmp(argv[ArgIdx],"-F") == 0) || (strcmp(argv[ArgIdx],"--follow-symlink") == 0)) pFlag->Follow = SYMLINK_FOLLOW; else if ((strcmp(argv[ArgIdx],"-R") == 0) || (strcmp(argv[ArgIdx],"--replace-symlink") == 0)) pFlag->Follow = SYMLINK_REPLACE; else if ((strcmp(argv[ArgIdx],"-V") == 0) || (strcmp(argv[ArgIdx],"--version") == 0)) { PrintVersion(progname, localedir); return(pFlag->error); } else if ((strcmp(argv[ArgIdx],"-L") == 0) || (strcmp(argv[ArgIdx],"--license") == 0)) { PrintLicense(); return(pFlag->error); } else if (strcmp(argv[ArgIdx],"-ascii") == 0) { /* SunOS compatible options */ pFlag->ConvMode = CONVMODE_ASCII; pFlag->keep_utf16 = 0; pFlag->locale_target = TARGET_UTF8; } else if (strcmp(argv[ArgIdx],"-7") == 0) pFlag->ConvMode = CONVMODE_7BIT; else if (strcmp(argv[ArgIdx],"-iso") == 0) { pFlag->ConvMode = (int)query_con_codepage(); if (pFlag->verbose) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr,_("active code page: %d\n"), pFlag->ConvMode); } if (pFlag->ConvMode < 2) pFlag->ConvMode = CONVMODE_437; } else if (strcmp(argv[ArgIdx],"-437") == 0) pFlag->ConvMode = CONVMODE_437; else if (strcmp(argv[ArgIdx],"-850") == 0) pFlag->ConvMode = CONVMODE_850; else if (strcmp(argv[ArgIdx],"-860") == 0) pFlag->ConvMode = CONVMODE_860; else if (strcmp(argv[ArgIdx],"-863") == 0) pFlag->ConvMode = CONVMODE_863; else if (strcmp(argv[ArgIdx],"-865") == 0) pFlag->ConvMode = CONVMODE_865; else if (strcmp(argv[ArgIdx],"-1252") == 0) pFlag->ConvMode = CONVMODE_1252; #ifdef D2U_UNICODE else if ((strcmp(argv[ArgIdx],"-u") == 0) || (strcmp(argv[ArgIdx],"--keep-utf16") == 0)) pFlag->keep_utf16 = 1; else if ((strcmp(argv[ArgIdx],"-ul") == 0) || (strcmp(argv[ArgIdx],"--assume-utf16le") == 0)) pFlag->ConvMode = CONVMODE_UTF16LE; else if ((strcmp(argv[ArgIdx],"-ub") == 0) || (strcmp(argv[ArgIdx],"--assume-utf16be") == 0)) pFlag->ConvMode = CONVMODE_UTF16BE; #endif else if (strcmp(argv[ArgIdx],"--info") == 0) pFlag->file_info |= INFO_DEFAULT; else if (strncmp(argv[ArgIdx],"--info=", (size_t)7) == 0) { get_info_options(argv[ArgIdx]+7, pFlag, progname); } else if (strncmp(argv[ArgIdx],"-i", (size_t)2) == 0) { get_info_options(argv[ArgIdx]+2, pFlag, progname); } else if ((strcmp(argv[ArgIdx],"-c") == 0) || (strcmp(argv[ArgIdx],"--convmode") == 0)) { if (++ArgIdx < argc) { if (strcmpi(argv[ArgIdx],"ascii") == 0) { /* Benjamin Lin's legacy options */ pFlag->ConvMode = CONVMODE_ASCII; pFlag->keep_utf16 = 0; } else if (strcmpi(argv[ArgIdx], "7bit") == 0) pFlag->ConvMode = CONVMODE_7BIT; else if (strcmpi(argv[ArgIdx], "iso") == 0) { pFlag->ConvMode = (int)query_con_codepage(); if (pFlag->verbose) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr,_("active code page: %d\n"), pFlag->ConvMode); } if (pFlag->ConvMode < 2) pFlag->ConvMode = CONVMODE_437; } else if (strcmpi(argv[ArgIdx], "mac") == 0) { if (is_dos2unix(progname)) pFlag->FromToMode = FROMTO_MAC2UNIX; else pFlag->FromToMode = FROMTO_UNIX2MAC; } else { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("invalid %s conversion mode specified\n"),argv[ArgIdx]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } } else { ArgIdx--; D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr,_("option '%s' requires an argument\n"),argv[ArgIdx]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } } #ifdef D2U_UNIFILE else if ((strcmp(argv[ArgIdx],"-D") == 0) || (strcmp(argv[ArgIdx],"--display-enc") == 0)) { if (++ArgIdx < argc) { if (strcmpi(argv[ArgIdx],"ansi") == 0) d2u_display_encoding = D2U_DISPLAY_ANSI; else if (strcmpi(argv[ArgIdx], "unicode") == 0) d2u_display_encoding = D2U_DISPLAY_UNICODE; else if (strcmpi(argv[ArgIdx], "unicodebom") == 0) d2u_display_encoding = D2U_DISPLAY_UNICODEBOM; else if (strcmpi(argv[ArgIdx], "utf8") == 0) d2u_display_encoding = D2U_DISPLAY_UTF8; else if (strcmpi(argv[ArgIdx], "utf8bom") == 0) { d2u_display_encoding = D2U_DISPLAY_UTF8BOM; } else { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("invalid %s display encoding specified\n"),argv[ArgIdx]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } } else { ArgIdx--; D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr,_("option '%s' requires an argument\n"),argv[ArgIdx]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } } #endif else if ((strcmp(argv[ArgIdx],"-o") == 0) || (strcmp(argv[ArgIdx],"--oldfile") == 0)) { /* last convert not paired */ if (!CanSwitchFileMode) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("target of file %s not specified in new-file mode\n"), argv[ArgIdx-1]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } pFlag->NewFile = 0; pFlag->file_info = 0; } else if ((strcmp(argv[ArgIdx],"-n") == 0) || (strcmp(argv[ArgIdx],"--newfile") == 0)) { /* last convert not paired */ if (!CanSwitchFileMode) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("target of file %s not specified in new-file mode\n"), argv[ArgIdx-1]); pFlag->error = 1; ShouldExit = 1; pFlag->stdio_mode = 0; } pFlag->NewFile = 1; pFlag->file_info = 0; } else { /* wrong option */ PrintUsage(progname); ShouldExit = 1; pFlag->error = 1; pFlag->stdio_mode = 0; } } else { pFlag->stdio_mode = 0; /* not an option */ if (pFlag->NewFile) { if (CanSwitchFileMode) CanSwitchFileMode = 0; else { #ifdef D2U_UNICODE RetVal = ConvertNewFile(argv[ArgIdx-1], argv[ArgIdx], pFlag, progname, Convert, ConvertW); #else RetVal = ConvertNewFile(argv[ArgIdx-1], argv[ArgIdx], pFlag, progname, Convert); #endif if (pFlag->verbose) print_messages_newfile(pFlag, argv[ArgIdx-1], argv[ArgIdx], progname, RetVal); CanSwitchFileMode = 1; } } else { if (pFlag->file_info) { RetVal = GetFileInfo(argv[ArgIdx], pFlag, progname); print_messages_info(pFlag, argv[ArgIdx], progname); } else { #ifdef D2U_UNICODE RetVal = ConvertNewFile(argv[ArgIdx], argv[ArgIdx], pFlag, progname, Convert, ConvertW); #else RetVal = ConvertNewFile(argv[ArgIdx], argv[ArgIdx], pFlag, progname, Convert); #endif if (pFlag->verbose) print_messages_oldfile(pFlag, argv[ArgIdx], progname, RetVal); } } } } /* no file argument, use stdin and stdout */ if ( (argc > 0) && pFlag->stdio_mode) { if (pFlag->file_info) { GetFileInfoStdio(pFlag, progname); print_messages_info(pFlag, "stdin", progname); } else { #ifdef D2U_UNICODE ConvertStdio(pFlag, progname, Convert, ConvertW); #else ConvertStdio(pFlag, progname, Convert); #endif if (pFlag->verbose) print_messages_stdio(pFlag, progname); } return pFlag->error; } if (!CanSwitchFileMode) { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_UTF8_FPRINTF(stderr, _("target of file %s not specified in new-file mode\n"), argv[ArgIdx-1]); pFlag->error = 1; } return pFlag->error; } void d2u_getc_error(CFlag *ipFlag, const char *progname) { ipFlag->error = errno; if (ipFlag->verbose) { char *errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_ANSI_FPRINTF(stderr, _("can not read from input file: %s\n"), errstr); } } void d2u_putc_error(CFlag *ipFlag, const char *progname) { ipFlag->error = errno; if (ipFlag->verbose) { char *errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_ANSI_FPRINTF(stderr, _("can not write to output file: %s\n"), errstr); } } #ifdef D2U_UNICODE void d2u_putwc_error(CFlag *ipFlag, const char *progname) { if (!(ipFlag->status & UNICODE_CONVERSION_ERROR)) { ipFlag->error = errno; if (ipFlag->verbose) { char *errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_ANSI_FPRINTF(stderr, _("can not write to output file: %s\n"), errstr); } } } wint_t d2u_getwc(FILE *f, int bomtype) { int c_trail, c_lead; wint_t wc; if (((c_lead=fgetc(f)) == EOF) || ((c_trail=fgetc(f)) == EOF)) return(WEOF); if (bomtype == FILE_UTF16LE) { /* UTF16 little endian */ c_trail <<=8; wc = (wint_t)(c_trail + c_lead) ; } else { /* UTF16 big endian */ c_lead <<=8; wc = (wint_t)(c_trail + c_lead) ; } return(wc); } wint_t d2u_ungetwc(wint_t wc, FILE *f, int bomtype) { int c_trail, c_lead; if (bomtype == FILE_UTF16LE) { /* UTF16 little endian */ c_trail = (int)(wc & 0xff00); c_trail >>=8; c_lead = (int)(wc & 0xff); } else { /* UTF16 big endian */ c_lead = (int)(wc & 0xff00); c_lead >>=8; c_trail = (int)(wc & 0xff); } /* push back in reverse order */ if ((ungetc(c_trail,f) == EOF) || (ungetc(c_lead,f) == EOF)) return(WEOF); return(wc); } /* Put wide character */ wint_t d2u_putwc(wint_t wc, FILE *f, CFlag *ipFlag, const char *progname) { static char mbs[8]; static wchar_t lead=0x01; /* lead get's invalid value */ static wchar_t wstr[3]; size_t len; #if (defined(_WIN32) && !defined(__CYGWIN__)) DWORD dwFlags; #endif if (ipFlag->keep_utf16) { int c_trail, c_lead; if (ipFlag->bomtype == FILE_UTF16LE) { /* UTF16 little endian */ c_trail = (int)(wc & 0xff00); c_trail >>=8; c_lead = (int)(wc & 0xff); } else { /* UTF16 big endian */ c_lead = (int)(wc & 0xff00); c_lead >>=8; c_trail = (int)(wc & 0xff); } if ((fputc(c_lead,f) == EOF) || (fputc(c_trail,f) == EOF)) return(WEOF); return wc; } /* Note: In the new Unicode standard lead is named "high", and trail is name "low". */ /* check for lead without a trail */ if ((lead >= 0xd800) && (lead < 0xdc00) && ((wc < 0xdc00) || (wc >= 0xe000))) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("error: Invalid surrogate pair. Missing low surrogate.\n")); ipFlag->status |= UNICODE_CONVERSION_ERROR ; return(WEOF); } if ((wc >= 0xd800) && (wc < 0xdc00)) { /* Surrogate lead */ /* fprintf(stderr, "UTF-16 lead %x\n",wc); */ lead = (wchar_t)wc; /* lead (high) surrogate */ return(wc); } if ((wc >= 0xdc00) && (wc < 0xe000)) { /* Surrogate trail */ static wchar_t trail; /* check for trail without a lead */ if ((lead < 0xd800) || (lead >= 0xdc00)) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("error: Invalid surrogate pair. Missing high surrogate.\n")); ipFlag->status |= UNICODE_CONVERSION_ERROR ; return(WEOF); } /* fprintf(stderr, "UTF-16 trail %x\n",wc); */ trail = (wchar_t)wc; /* trail (low) surrogate */ #if defined(_WIN32) || defined(__CYGWIN__) /* On Windows (including Cygwin) wchar_t is 16 bit */ /* We cannot decode an UTF-16 surrogate pair, because it will not fit in a 16 bit wchar_t. */ wstr[0] = lead; wstr[1] = trail; wstr[2] = L'\0'; lead = 0x01; /* make lead invalid */ #else /* On Unix wchar_t is 32 bit */ /* When we don't decode the UTF-16 surrogate pair, wcstombs() does not * produce the same UTF-8 as WideCharToMultiByte(). The UTF-8 output * produced by wcstombs() is bigger, because it just translates the wide * characters in the range 0xD800..0xDBFF individually to UTF-8 sequences * (although these code points are reserved for use only as surrogate * pairs in UTF-16). * * Some smart viewers can still display this UTF-8 correctly (like Total * Commander lister), however the UTF-8 is not readable by Windows * Notepad (on Windows 7). When we decode the UTF-16 surrogate pairs * ourselves the wcstombs() UTF-8 output is identical to what * WideCharToMultiByte() produces, and is readable by Notepad. * * Surrogate halves in UTF-8 are invalid. See also * http://en.wikipedia.org/wiki/UTF-8#Invalid_code_points * http://tools.ietf.org/html/rfc3629#page-5 * It is a bug in (some implemenatations of) wcstombs(). * On Cygwin 1.7 wcstombs() produces correct UTF-8 from UTF-16 surrogate pairs. */ /* Decode UTF-16 surrogate pair */ wstr[0] = 0x10000; wstr[0] += (lead & 0x03FF) << 10; wstr[0] += (trail & 0x03FF); wstr[1] = L'\0'; lead = 0x01; /* make lead invalid */ /* fprintf(stderr, "UTF-32 %x\n",wstr[0]); */ #endif } else { wstr[0] = (wchar_t)wc; wstr[1] = L'\0'; } if (wc == 0x0000) { if (fputc(0, f) == EOF) return(WEOF); return(wc); } #if (defined(_WIN32) && !defined(__CYGWIN__)) /* The WC_ERR_INVALID_CHARS flag is available since Windows Vista (0x0600). It enables checking for invalid input characters. */ #if WINVER >= 0x0600 dwFlags = WC_ERR_INVALID_CHARS; #else dwFlags = 0; #endif /* On Windows we convert UTF-16 always to UTF-8 or GB18030 */ if (ipFlag->locale_target == TARGET_GB18030) { len = (size_t)(WideCharToMultiByte(54936, dwFlags, wstr, -1, mbs, sizeof(mbs), NULL, NULL) -1); } else { len = (size_t)(WideCharToMultiByte(CP_UTF8, dwFlags, wstr, -1, mbs, sizeof(mbs), NULL, NULL) -1); } #else /* On Unix we convert UTF-16 to the locale encoding */ len = wcstombs(mbs, wstr, sizeof(mbs)); /* fprintf(stderr, "len %d\n",len); */ #endif if ( len == (size_t)(-1) ) { /* Stop when there is a conversion error */ /* On Windows we convert UTF-16 always to UTF-8 or GB18030 */ if (ipFlag->verbose) { #if (defined(_WIN32) && !defined(__CYGWIN__)) d2u_PrintLastError(progname); #else char *errstr = strerror(errno); D2U_UTF8_FPRINTF(stderr, "%s:", progname); D2U_ANSI_FPRINTF(stderr, " %s\n", errstr); #endif } ipFlag->status |= UNICODE_CONVERSION_ERROR ; return(WEOF); } else { size_t i; for (i=0; i #define _(String) gettext (String) #define gettext_noop(String) String #define N_(String) gettext_noop (String) #else #define _(String) (String) #define N_(String) String #define textdomain(Domain) #define bindtextdomain(Package, Directory) #endif #if defined(__DJGPP__) || defined(__TURBOC__) /* DJGPP */ # include #else # if !defined(__MSYS__) && !defined(_MSC_VER) # include # endif #endif #if !defined(__TURBOC__) && !defined(_MSC_VER) #include #endif #include #include #include #ifdef __GNUC__ #ifndef strcmpi # include # define strcmpi(s1, s2) strcasecmp(s1, s2) #endif #endif #ifdef _MSC_VER # include #else # include #endif #include #ifdef __TURBOC__ #define __FLAT__ #endif #include #include #if defined(D2U_UNICODE) || defined(_WIN32) #include #endif #if (defined(__WATCOMC__) && defined(__NT__)) /* Watcom */ # define _WIN32 1 #endif #if defined(__WATCOMC__) && defined(__I86__) /* Watcom C, 16 bit Intel */ #define __MSDOS__ 1 #endif #if defined(__WATCOMC__) && defined(__DOS__) /* Watcom C, 32 bit DOS */ #define __MSDOS__ 1 #endif #if defined(ENABLE_NLS) || (defined(D2U_UNICODE) && !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__)) /* setlocale() is also needed for nl_langinfo() */ #include #endif /* Watcom C has mkstemp, but no mktemp(). * MinGW has mktemp() and mkstemp(). MinGW mkstemp() is not working for me. * MSVC has mktemp(), but no mkstemp(). * Assume that none of the Windows compilers have mkstemp(). * On Windows I need something that can also work with Unicode file names (UTF-16). * On Windows GetTempFileName() will be used, as is adviced on MSDN. */ #if defined(__TURBOC__) || defined(__DJGPP__) || (defined(_WIN32) && !defined(__CYGWIN__)) /* Some compilers have no mkstemp(). * Use mktemp() instead. * BORLANDC, DJGPP, MINGW32, MSVC */ #define NO_MKSTEMP 1 #endif #if defined(__TURBOC__) || defined(__DJGPP__) || defined(__MINGW32__) || defined(__WATCOMC__) || defined(_MSC_VER) /* Some compilers have no chown(). */ #define NO_CHOWN 1 #endif /* Watcom C defines S_ISLNK */ #ifdef __WATCOMC__ #undef S_ISLNK #endif /* Microsoft Visual C++ */ #ifdef _MSC_VER #define S_ISCHR( m ) (((m) & _S_IFMT) == _S_IFCHR) #define S_ISDIR( m ) (((m) & _S_IFMT) == _S_IFDIR) #define S_ISFIFO( m ) (((m) & _S_IFMT) == _S_IFIFO) #define S_ISREG( m ) (((m) & _S_IFMT) == _S_IFREG) #define NO_CHMOD 1 /* no chmod() available */ #endif #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) /* Systems without soft links use 'stat' instead of 'lstat'. */ #define STAT stat #else #define STAT lstat #endif #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) /* On some systems rename() will always fail if target file already exists. */ #define NEED_REMOVE 1 #endif #if defined(__MSDOS__) || defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) /* DJGPP, MINGW32 and OS/2 */ /* required for setmode() and O_BINARY */ #include #include #endif #if defined(__MSDOS__) || defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) #define R_CNTRL "rb" #define W_CNTRL "wb" #else #define R_CNTRL "r" #define W_CNTRL "w" #endif #define R_CNTRLW L"rb" #define W_CNTRLW L"wb" #define BINARY_FILE 0x1 #define NO_REGFILE 0x2 #define WRONG_CODEPAGE 0x4 #define OUTPUTFILE_SYMLINK 0x8 #define INPUT_TARGET_NO_REGFILE 0x10 #define OUTPUT_TARGET_NO_REGFILE 0x20 #define LOCALE_NOT_UTF 0x40 /* Locale not an Unicode Transformation Format */ #define WCHAR_T_TOO_SMALL 0x80 #define UNICODE_CONVERSION_ERROR 0x100 #define UNICODE_NOT_SUPPORTED 0x200 #define CONVMODE_ASCII 0 #define CONVMODE_UTF16LE 1 #define CONVMODE_UTF16BE 2 #define CONVMODE_7BIT 3 #define CONVMODE_437 437 #define CONVMODE_850 850 #define CONVMODE_860 860 #define CONVMODE_863 863 #define CONVMODE_865 865 #define CONVMODE_1252 1252 #define FROMTO_DOS2UNIX 0 #define FROMTO_MAC2UNIX 1 #define FROMTO_UNIX2DOS 2 #define FROMTO_UNIX2MAC 3 #define INFO_DOS 0x1 #define INFO_UNIX 0x2 #define INFO_MAC 0x4 #define INFO_BOM 0x8 #define INFO_TEXT 0x10 #define INFO_DEFAULT 0x1F #define INFO_CONVERT 0x20 #define INFO_HEADER 0x40 #define INFO_NOPATH 0x80 #define SYMLINK_SKIP 0 #define SYMLINK_FOLLOW 1 #define SYMLINK_REPLACE 2 #define FILE_MBS 0 /* Multi-byte string or 8-bit char */ #define FILE_UTF16LE 1 /* UTF-16 Little Endian */ #define FILE_UTF16BE 2 /* UTF-16 Big Endian */ #define FILE_UTF8 3 /* UTF-8 */ #define FILE_GB18030 4 /* GB18030 */ #define D2U_DISPLAY_ANSI 0 #define D2U_DISPLAY_UNICODE 1 #define D2U_DISPLAY_UNICODEBOM 2 #define D2U_DISPLAY_UTF8 3 #define D2U_DISPLAY_UTF8BOM 4 /* locale conversion targets */ #define TARGET_UTF8 0 #define TARGET_GB18030 1 #define D2U_MAX_PATH 2048 typedef struct { int NewFile; /* is in new file mode? */ int verbose; /* 0 = quiet, 1 = normal, 2 = verbose */ int KeepDate; /* should keep date stamp? */ int ConvMode; /* 0: ascii, 1: 7bit, 2: iso */ int FromToMode; /* 0: dos2unix/unix2dos, 1: mac2unix/unix2mac */ int NewLine; /* if TRUE, then additional newline */ int Force; /* if TRUE, force conversion of all files. */ int Follow; /* 0: skip symlink, 1: follow symbolic link, 2: replace symlink. */ int status; int stdio_mode; /* if TRUE, stdio mode */ int error; /* an error occurred */ int bomtype; /* byte order mark */ int add_bom; /* 1: write BOM */ int keep_bom; /* 1: write BOM if input file has BOM. 0: Do not write BOM */ int keep_utf16; /* 1: write UTF-16 format when input file is UTF-16 format */ int file_info; /* 1: print file information */ int locale_target; /* locale conversion target. 0: UTF-8; 1: GB18030 */ unsigned int line_nr; /* line number where UTF-16 error occurs */ } CFlag; int symbolic_link(const char *path); int regfile(char *path, int allowSymlinks, CFlag *ipFlag, const char *progname); int regfile_target(char *path, CFlag *ipFlag, const char *progname); void PrintUsage(const char *progname); void PrintBSDLicense(void); void PrintVersion(const char *progname, const char *localedir); #ifdef ENABLE_NLS void PrintLocaledir(const char *localedir); #endif FILE* OpenInFile(char *ipFN); FILE* OpenOutFile(char *opFN); FILE* OpenOutFiled(int fd); #if defined(__TURBOC__) || defined(__MSYS__) char *dirname(char *path); #endif FILE* MakeTempFileFrom(const char *OutFN, char **fname_ret); int ResolveSymbolicLink(char *lFN, char **rFN, CFlag *ipFlag, const char *progname); FILE *read_bom (FILE *f, int *bomtype); FILE *write_bom (FILE *f, CFlag *ipFlag, const char *progname); void print_bom (const int bomtype, const char *filename, const char *progname); int check_unicode(FILE *InF, FILE *TempF, CFlag *ipFlag, const char *ipInFN, const char *progname); void print_messages_stdio(const CFlag *pFlag, const char *progname); void print_messages_newfile(const CFlag *pFlag, const char *infile, const char *outfile, const char *progname, const int RetVal); void print_messages_oldfile(const CFlag *pFlag, const char *infile, const char *progname, const int RetVal); int ConvertNewFile(char *ipInFN, char *ipOutFN, CFlag *ipFlag, const char *progname, int (*Convert)(FILE*, FILE*, CFlag *, const char *) #ifdef D2U_UNICODE , int (*ConvertW)(FILE*, FILE*, CFlag *, const char *) #endif ); int ConvertStdio(CFlag *ipFlag, const char *progname, int (*Convert)(FILE*, FILE*, CFlag *, const char *) #ifdef D2U_UNICODE , int (*ConvertW)(FILE*, FILE*, CFlag *, const char *) #endif ); int parse_options(int argc, char *argv[], CFlag *pFlag, const char *localedir, const char *progname, void (*PrintLicense)(void), int (*Convert)(FILE*, FILE*, CFlag *, const char *) #ifdef D2U_UNICODE , int (*ConvertW)(FILE*, FILE*, CFlag *, const char *) #endif ); void d2u_getc_error(CFlag *ipFlag, const char *progname); void d2u_putc_error(CFlag *ipFlag, const char *progname); #ifdef D2U_UNICODE void d2u_putwc_error(CFlag *ipFlag, const char *progname); wint_t d2u_getwc(FILE *f, int bomtype); wint_t d2u_ungetwc(wint_t wc, FILE *f, int bomtype); wint_t d2u_putwc(wint_t wc, FILE *f, CFlag *ipFlag, const char *progname); #endif #ifdef D2U_UNIFILE #define UNICODE #define _UNICODE #define D2U_UTF8_FPRINTF d2u_utf8_fprintf #define D2U_ANSI_FPRINTF d2u_ansi_fprintf void d2u_utf8_fprintf( FILE *stream, const char* format, ... ); void d2u_ansi_fprintf( FILE *stream, const char* format, ... ); int glob_warg(int argc, wchar_t *wargv[], char ***argv, CFlag *ipFlag, const char *progname); #else #define D2U_UTF8_FPRINTF fprintf #define D2U_ANSI_FPRINTF fprintf #endif #endif dos2unix-7.3.4/COPYING.txt0000644000175500010010000000266012721132543014424 0ustar waterlanGeenThe dos2unix package is distributed under FreeBSD style license. See also http://www.freebsd.org/copyright/freebsd-license.html -------- Copyright (C) 2009-2016 Erwin Waterlander Copyright (C) 1998 Christian Wurll Copyright (C) 1998 Bernd Johannes Wuebben Copyright (C) 1994-1995 Benjamin Lin. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. dos2unix-7.3.4/DEVEL.txt0000644000175500010010000001221612721132543014151 0ustar waterlanGeenInformation about dos2unix' implementation choices. 1. Smart conversion =================== There are some dos2unix implementations that automatically convert all type of line breaks. For instance converting both DOS and Mac linebreaks to Unix line breaks at once. Or automatically detect the line break type and convert to the other side. Smart conversions could lead to unexpected behaviour. For instance when a dos2unix is run on a file with only Unix line breaks and the line breaks are flipped to the other side. This dos2unix implementation does exactly what you tell it to do. When you run 'dos2unix' only DOS line breaks are converted to Unix line breaks. Unix line breaks stay in the file. Seen from a DOS or Unix perspective, a Mac line break is not a line break, so also Mac line breaks stay untouched. The same applies for mac2unix. Mac2unix leaves Unix and DOS line breaks untouched. 2. Unix filter ============== When a standard Unix filter, e.g. sed or tr, reads input from a file it sends its output by default to standard out. This implementation of dos2unix does by default in-place conversion (overwriting the input file), which seems not in line. Dos2unix is not part of the Unix standard. Most Unixes have their own implementation of dos2unix. There is a lot of variation in command names, options, and behavior. The SunOS version of dos2unix, after which this version was modeled, does by default paired conversion. This implementation of dos2unix has too much legacy to change the current behaviour. Changing it would have more disadvantages than advantages. Most people expect dos2unix to do in-place conversion. The majority of other open source implementations also convert by default in-place. In-place conversion has the advantage that it is very easy to convert multiple files by using wild cards. This implementation of dos2unix does send the output to standard-out when the input comes from standard-in. So you can use it as filter. Note that dos2unix/ unix2dos is also used a lot on non-Unix operating systems where the filter idea is less known. 3. Recursive conversion of files ================================ There are implementations that have builtin functionality to do recursive conversion of all files in a directory tree. This functionality is not needed in dos2unix. By using an external program, like Unix 'find', you can do recursive conversion of directory trees. There is no need to duplicate this. 4. Encoding conversion ====================== Dos2unix can do several encoding conversions. First there are the conversions of several DOS code pages to and from ISO-8859-1. These conversions are also part of the SunOS dos2unix implementation after which this implementation has been modeled. Although these conversions are not much used these days they have been added for the sake completeness. Conversion of CP1252 was added, because it is used a lot in the Western world. It's almost identical to ISO-8859-1. There is no intention to add other conversions to and from ISO-8859-1. Conversion from UTF-16 was added, because the world is moving towards Unicode. Microsoft Windows uses by default UTF-16 format for Unicode. UTF-16 is part of Windows' core design for historical reasons. Microsoft standardized on UCS-2, a predecessor of UTF-16, in a time when UTF-8 did not exist yet. However a lot of Windows software is able to read UTF-8 files. In Windows "Unicode" means usually UTF-16. For instance saving a file with Notepad in "Unicode" encoding means in UTF-16 encoding. When you work in PowerShell and echo some text to a file you get an UTF-16 encoded text file. UTF-16 is there to stay, although many people would like to see otherwise and are dreaming of an UTF-8 only world. The Unix/Linux world is moving towards UTF-8 encoding, because it's backwards compatible with ASCII. Unix programs typically do not support UTF-16. One end of the encoding spectrum is an ASCII only world, where the only differences between DOS and Unix text files are line breaks. In English speaking regions this is a good working environment, because ASCII is in practice sufficient for English language. Diacritics are hardly used and can be omitted. The other end of the spectrum is an Unicode only world. All languages of the world are supported. Dos2unix aims to support these two ends of the spectrum: ASCII and Unicode. The Chinese GB18030 encoding is also seen as an Unicode transformation format. UTF-32 is not supported, because this is practically only used as an internal format. Other encoding transformations are left to specialized programs like iconv and recode. The few conversion modes to and from ISO-8859-1 are only there for legacy reasons. In the ASCII days DOS to Unix text file conversion, and vice versa, was only converting line breaks. In the Unicode era it is not only line break conversion, but also Unicode transformation format conversion (e.g. UTF-16 to UTF-8), and Byte Order Mark (BOM) removal or addition. Conversion towards UTF-16 is not supported and there is no intention to support it in the future. UTF-8 encoded files are well supported on Windows, so conversion to UTF-16 is not needed. And we keep on dreaming of an UTF-8 only world... dos2unix-7.3.4/djgpp.mak0000644000175500010010000000475312721132543014356 0ustar waterlanGeen# Author: Erwin Waterlander # Copyright (C) 2009-2016 Erwin Waterlander # This file is distributed under the same license as the dos2unix package. include version.mk d2u_os=$(shell uname -s) # DJGPP 2.03 LINK = ln -sf # DJGPP 2.05 # In DJGPP 2.05 linking with ln works differently. The links created # with DJGPP 2.05 do not work. #LINK = cp -f # On DOS we need to set SHELL to sh.exe or bash.exe, otherwise targets may fail # (targets install and dist fail certainly). SHELL can't be overridden in this # make level. It sticks to command.com (at least with DJGPP 2.03 make 3.79.1). # SHELL has to be set in a parent process, so we pass it to the sub make instances. D2U_MAKESHELL=$(shell which sh) CROSS_COMP=0 ifeq ($(findstring CYGWIN,$(d2u_os)),CYGWIN) CROSS_COMP=1 endif ifeq ($(CROSS_COMP),1) CROSS_COMPILE=i586-pc-msdosdjgpp- LINK = cp -f endif CC=$(CROSS_COMPILE)gcc STRIP=$(CROSS_COMPILE)strip prefix=c:/dos32 ENABLE_NLS= VERSIONSUFFIX=-dos32 ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv NLS_SUFFIX = -nls endif VERSIONSUFFIX = pm ZIPFILE = d2u$(DOS2UNIX_VERSION_SHORT)$(VERSIONSUFFIX)$(NLS_SUFFIX).zip ZIPOBJ_EXTRA = bin/cwsdpmi.exe docsubdir = dos2unix all: $(MAKE) all EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="$(LINK)" LINK_MAN="cp -f" docsubdir=$(docsubdir) UCS= CC=$(CC) D2U_OS=msdos SHELL=$(D2U_MAKESHELL) test: all cd test; $(MAKE) test UCS= SHELL=$(D2U_MAKESHELL) check: test install: $(MAKE) install EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="$(LINK)" LINK_MAN="cp -f" docsubdir=$(docsubdir) UCS= CC=$(CC) D2U_OS=msdos SHELL=$(D2U_MAKESHELL) uninstall: $(MAKE) uninstall EXE=.exe prefix=$(prefix) docsubdir=$(docsubdir) SHELL=$(D2U_MAKESHELL) clean: $(MAKE) clean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) SHELL=$(D2U_MAKESHELL) mostlyclean: $(MAKE) mostlyclean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) SHELL=$(D2U_MAKESHELL) dist: $(MAKE) dist-zip EXE=.exe prefix=$(prefix) VERSIONSUFFIX="$(VERSIONSUFFIX)" ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" ENABLE_NLS=$(ENABLE_NLS) ZIPFILE=${ZIPFILE} docsubdir=$(docsubdir) SHELL=$(D2U_MAKESHELL) strip: $(MAKE) strip LINK="$(LINK)" LINK_MAN="cp -f" EXE=.exe STRIP=$(STRIP) # Fix time stamps. Otherwise make install may rebuild mac2unix unix2mac. # Now make install can be done in MSYS. In djgpp bash install is problematic. sleep 10 touch mac2unix.exe touch unix2mac.exe dos2unix-7.3.4/dos2unix.c0000644000175500010010000005045512721132543014477 0ustar waterlanGeen/* * Name: dos2unix * Documentation: * Remove cr ('\x0d') characters from a file. * * The dos2unix package is distributed under FreeBSD style license. * See also http://www.freebsd.org/copyright/freebsd-license.html * -------- * * Copyright (C) 2009-2016 Erwin Waterlander * Copyright (C) 1998 Christian Wurll * Copyright (C) 1998 Bernd Johannes Wuebben * Copyright (C) 1994-1995 Benjamin Lin. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice in the documentation and/or other materials provided with * the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * == 1.0 == 1989.10.04 == John Birchfield (jb@koko.csustan.edu) * == 1.1 == 1994.12.20 == Benjamin Lin (blin@socs.uts.edu.au) * Cleaned up for Borland C/C++ 4.02 * == 1.2 == 1995.03.16 == Benjamin Lin (blin@socs.uts.edu.au) * Modified to more conform to UNIX style. * == 2.0 == 1995.03.19 == Benjamin Lin (blin@socs.uts.edu.au) * Rewritten from scratch. * == 2.1 == 1995.03.29 == Benjamin Lin (blin@socs.uts.edu.au) * Conversion to SunOS charset implemented. * == 2.2 == 1995.03.30 == Benjamin Lin (blin@socs.uts.edu.au) * Fixed a bug in 2.1 where in new-file mode, if outfile already exists * conversion can not be completed properly. * * Added Mac text file translation, i.e. \r to \n conversion * Bernd Johannes Wuebben, wuebben@kde.org * Wed Feb 4 19:12:58 EST 1998 * * Added extra newline if ^M occurs * Christian Wurll, wurll@ira.uka.de * Thu Nov 19 1998 * * See ChangeLog.txt for complete version history. * */ /* #define DEBUG 1 */ #define __DOS2UNIX_C #include "common.h" #include "dos2unix.h" # if (defined(_WIN32) && !defined(__CYGWIN__)) #include #endif #ifdef D2U_UNICODE #if !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__) /* Unix, Cygwin */ # include #endif #endif void PrintLicense(void) { D2U_ANSI_FPRINTF(stdout,_("\ Copyright (C) 2009-%d Erwin Waterlander\n\ Copyright (C) 1998 Christian Wurll (Version 3.1)\n\ Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n\ Copyright (C) 1994-1995 Benjamin Lin\n\ All rights reserved.\n\n"),2016); PrintBSDLicense(); } #ifdef D2U_UNICODE wint_t StripDelimiterW(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, wint_t CurChar, unsigned int *converted, const char *progname) { wint_t TempNextChar; /* CurChar is always CR (x0d) */ /* In normal dos2unix mode put nothing (skip CR). */ /* Don't modify Mac files when in dos2unix mode. */ if ( (TempNextChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { if (d2u_ungetwc( TempNextChar, ipInF, ipFlag->bomtype) == WEOF) { /* put back peek char */ d2u_getc_error(ipFlag,progname); return WEOF; } if ( TempNextChar != 0x0a ) { if (d2u_putwc(CurChar, ipOutF, ipFlag, progname) == WEOF) { /* Mac line, put CR */ d2u_putwc_error(ipFlag,progname); return WEOF; } } else { (*converted)++; if (ipFlag->NewLine) { /* add additional LF? */ if (d2u_putwc(0x0a, ipOutF, ipFlag, progname) == WEOF) { d2u_putwc_error(ipFlag,progname); return WEOF; } } } } else { if (ferror(ipInF)) { d2u_getc_error(ipFlag,progname); return WEOF; } if ( CurChar == 0x0d ) { /* EOF: last Mac line delimiter (CR)? */ if (d2u_putwc(CurChar, ipOutF, ipFlag, progname) == WEOF) { d2u_putwc_error(ipFlag,progname); return WEOF; } } } return CurChar; } #endif /* CUR NEXT 0xd(CR) 0xa(LF) => put LF if option -l was used 0xd(CR) ! 0xa(LF) => put CR 0xd(CR) EOF => put CR */ int StripDelimiter(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, int CurChar, unsigned int *converted, const char *progname) { int TempNextChar; /* CurChar is always CR (x0d) */ /* In normal dos2unix mode put nothing (skip CR). */ /* Don't modify Mac files when in dos2unix mode. */ if ( (TempNextChar = fgetc(ipInF)) != EOF) { if (ungetc( TempNextChar, ipInF ) == EOF) { /* put back peek char */ d2u_getc_error(ipFlag,progname); return EOF; } if ( TempNextChar != '\x0a' ) { if (fputc( CurChar, ipOutF ) == EOF) { /* Mac line, put CR */ d2u_putc_error(ipFlag,progname); return EOF; } } else { (*converted)++; if (ipFlag->NewLine) { /* add additional LF? */ if (fputc('\x0a', ipOutF) == EOF) { d2u_putc_error(ipFlag,progname); return EOF; } } } } else { if (ferror(ipInF)) { d2u_getc_error(ipFlag,progname); return EOF; } if ( CurChar == '\x0d' ) { /* EOF: last Mac line delimiter (CR)? */ if (fputc( CurChar, ipOutF ) == EOF) { d2u_putc_error(ipFlag,progname); return EOF; } } } return CurChar; } /* converts stream ipInF to UNIX format text and write to stream ipOutF * RetVal: 0 if success * -1 otherwise */ #ifdef D2U_UNICODE int ConvertDosToUnixW(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, const char *progname) { int RetVal = 0; wint_t TempChar; wint_t TempNextChar; unsigned int line_nr = 1; unsigned int converted = 0; ipFlag->status = 0; /* CR-LF -> LF */ /* LF -> LF, in case the input file is a Unix text file */ /* CR -> CR, in dos2unix mode (don't modify Mac file) */ /* CR -> LF, in Mac mode */ /* \x0a = Newline/Line Feed (LF) */ /* \x0d = Carriage Return (CR) */ switch (ipFlag->FromToMode) { case FROMTO_DOS2UNIX: /* dos2unix */ while ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { /* get character */ if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != 0x0a) && /* Not an LF */ (TempChar != 0x0d) && /* Not a CR */ (TempChar != 0x09) && /* Not a TAB */ (TempChar != 0x0c)) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (ipFlag->verbose) { if ((ipFlag->stdio_mode) && (!ipFlag->error)) ipFlag->error = 1; D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Binary symbol 0x00%02X found at line %u\n"),TempChar, line_nr); } break; } if (TempChar != 0x0d) { if (TempChar == 0x0a) /* Count all DOS and Unix line breaks */ ++line_nr; if (d2u_putwc(TempChar, ipOutF, ipFlag, progname) == WEOF) { RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } } else { if (StripDelimiterW( ipInF, ipOutF, ipFlag, TempChar, &converted, progname) == WEOF) { RetVal = -1; break; } } } if ((TempChar == WEOF) && ferror(ipInF)) { RetVal = -1; d2u_getc_error(ipFlag,progname); } break; case FROMTO_MAC2UNIX: /* mac2unix */ while ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != 0x0a) && /* Not an LF */ (TempChar != 0x0d) && /* Not a CR */ (TempChar != 0x09) && /* Not a TAB */ (TempChar != 0x0c)) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (ipFlag->verbose) { if ((ipFlag->stdio_mode) && (!ipFlag->error)) ipFlag->error = 1; D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Binary symbol 0x00%02X found at line %u\n"), TempChar, line_nr); } break; } if ((TempChar != 0x0d)) { if (TempChar == 0x0a) /* Count all DOS and Unix line breaks */ ++line_nr; if(d2u_putwc(TempChar, ipOutF, ipFlag, progname) == WEOF) { RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } } else{ /* TempChar is a CR */ if ( (TempNextChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { if (d2u_ungetwc( TempNextChar, ipInF, ipFlag->bomtype) == WEOF) { /* put back peek char */ d2u_getc_error(ipFlag,progname); RetVal = -1; break; } /* Don't touch this delimiter if it's a CR,LF pair. */ if ( TempNextChar == 0x0a ) { if (d2u_putwc(0x0d, ipOutF, ipFlag, progname) == WEOF) { /* put CR, part of DOS CR-LF */ d2u_putwc_error(ipFlag,progname); RetVal = -1; break; } continue; } } if (d2u_putwc(0x0a, ipOutF, ipFlag, progname) == WEOF) { /* MAC line end (CR). Put LF */ RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } converted++; line_nr++; /* Count all Mac line breaks */ if (ipFlag->NewLine) { /* add additional LF? */ if (d2u_putwc(0x0a, ipOutF, ipFlag, progname) == WEOF) { RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } } } } if ((TempChar == WEOF) && ferror(ipInF)) { RetVal = -1; d2u_getc_error(ipFlag,progname); } break; default: /* unknown FromToMode */ ; #if DEBUG D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("program error, invalid conversion mode %d\n"),ipFlag->FromToMode); exit(1); #endif } if (ipFlag->status & UNICODE_CONVERSION_ERROR) ipFlag->line_nr = line_nr; if ((RetVal == 0) && (ipFlag->verbose > 1)) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Converted %u out of %u line breaks.\n"), converted, line_nr -1); } return RetVal; } #endif /* converts stream ipInF to UNIX format text and write to stream ipOutF * RetVal: 0 if success * -1 otherwise */ int ConvertDosToUnix(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, const char *progname) { int RetVal = 0; int TempChar; int TempNextChar; int *ConvTable; unsigned int line_nr = 1; unsigned int converted = 0; ipFlag->status = 0; switch (ipFlag->ConvMode) { case CONVMODE_ASCII: /* ascii */ case CONVMODE_UTF16LE: /* Assume UTF-16LE, bomtype = FILE_UTF8 or GB18030 */ case CONVMODE_UTF16BE: /* Assume UTF-16BE, bomtype = FILE_UTF8 or GB18030 */ ConvTable = D2UAsciiTable; break; case CONVMODE_7BIT: /* 7bit */ ConvTable = D2U7BitTable; break; case CONVMODE_437: /* iso */ ConvTable = D2UIso437Table; break; case CONVMODE_850: /* iso */ ConvTable = D2UIso850Table; break; case CONVMODE_860: /* iso */ ConvTable = D2UIso860Table; break; case CONVMODE_863: /* iso */ ConvTable = D2UIso863Table; break; case CONVMODE_865: /* iso */ ConvTable = D2UIso865Table; break; case CONVMODE_1252: /* iso */ ConvTable = D2UIso1252Table; break; default: /* unknown convmode */ ipFlag->status |= WRONG_CODEPAGE ; return(-1); } /* Turn off ISO and 7-bit conversion for Unicode text files */ if (ipFlag->bomtype > 0) ConvTable = D2UAsciiTable; if ((ipFlag->ConvMode > CONVMODE_7BIT) && (ipFlag->verbose)) { /* not ascii or 7bit */ D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("using code page %d.\n"), ipFlag->ConvMode); } /* CR-LF -> LF */ /* LF -> LF, in case the input file is a Unix text file */ /* CR -> CR, in dos2unix mode (don't modify Mac file) */ /* CR -> LF, in Mac mode */ /* \x0a = Newline/Line Feed (LF) */ /* \x0d = Carriage Return (CR) */ switch (ipFlag->FromToMode) { case FROMTO_DOS2UNIX: /* dos2unix */ while ((TempChar = fgetc(ipInF)) != EOF) { /* get character */ if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != '\x0a') && /* Not an LF */ (TempChar != '\x0d') && /* Not a CR */ (TempChar != '\x09') && /* Not a TAB */ (TempChar != '\x0c')) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (ipFlag->verbose) { if ((ipFlag->stdio_mode) && (!ipFlag->error)) ipFlag->error = 1; D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Binary symbol 0x%02X found at line %u\n"),TempChar, line_nr); } break; } if (TempChar != '\x0d') { if (TempChar == '\x0a') /* Count all DOS and Unix line breaks */ ++line_nr; if (fputc(ConvTable[TempChar], ipOutF) == EOF) { RetVal = -1; d2u_putc_error(ipFlag,progname); break; } } else { if (StripDelimiter( ipInF, ipOutF, ipFlag, TempChar, &converted, progname) == EOF) { RetVal = -1; break; } } } if ((TempChar == EOF) && ferror(ipInF)) { RetVal = -1; d2u_getc_error(ipFlag,progname); } break; case FROMTO_MAC2UNIX: /* mac2unix */ while ((TempChar = fgetc(ipInF)) != EOF) { if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != '\x0a') && /* Not an LF */ (TempChar != '\x0d') && /* Not a CR */ (TempChar != '\x09') && /* Not a TAB */ (TempChar != '\x0c')) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (ipFlag->verbose) { if ((ipFlag->stdio_mode) && (!ipFlag->error)) ipFlag->error = 1; D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Binary symbol 0x%02X found at line %u\n"),TempChar, line_nr); } break; } if ((TempChar != '\x0d')) { if (TempChar == '\x0a') /* Count all DOS and Unix line breaks */ ++line_nr; if(fputc(ConvTable[TempChar], ipOutF) == EOF) { RetVal = -1; d2u_putc_error(ipFlag,progname); break; } } else{ /* TempChar is a CR */ if ( (TempNextChar = fgetc(ipInF)) != EOF) { if (ungetc( TempNextChar, ipInF ) == EOF) { /* put back peek char */ d2u_getc_error(ipFlag,progname); RetVal = -1; break; } /* Don't touch this delimiter if it's a CR,LF pair. */ if ( TempNextChar == '\x0a' ) { if (fputc('\x0d', ipOutF) == EOF) { /* put CR, part of DOS CR-LF */ RetVal = -1; d2u_putc_error(ipFlag,progname); break; } continue; } } if (fputc('\x0a', ipOutF) == EOF) { /* MAC line end (CR). Put LF */ RetVal = -1; d2u_putc_error(ipFlag,progname); break; } converted++; line_nr++; /* Count all Mac line breaks */ if (ipFlag->NewLine) { /* add additional LF? */ if (fputc('\x0a', ipOutF) == EOF) { RetVal = -1; d2u_putc_error(ipFlag,progname); break; } } } } if ((TempChar == EOF) && ferror(ipInF)) { RetVal = -1; d2u_getc_error(ipFlag,progname); } break; default: /* unknown FromToMode */ ; #if DEBUG D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("program error, invalid conversion mode %d\n"),ipFlag->FromToMode); exit(1); #endif } if ((RetVal == 0) && (ipFlag->verbose > 1)) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Converted %u out of %u line breaks.\n"),converted, line_nr -1); } return RetVal; } int main (int argc, char *argv[]) { /* variable declarations */ char progname[9]; CFlag *pFlag; char *ptr; char localedir[1024]; # ifdef __MINGW64__ int _dowildcard = -1; /* enable wildcard expansion for Win64 */ # endif int argc_new; char **argv_new; #ifdef D2U_UNIFILE wchar_t **wargv; char ***argv_glob; # endif progname[8] = '\0'; strcpy(progname,"dos2unix"); #ifdef ENABLE_NLS ptr = getenv("DOS2UNIX_LOCALEDIR"); if (ptr == NULL) strcpy(localedir,LOCALEDIR); else { if (strlen(ptr) < sizeof(localedir)) strcpy(localedir,ptr); else { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_ANSI_FPRINTF(stderr, "%s", _("error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n")); strcpy(localedir,LOCALEDIR); } } #endif #if defined(ENABLE_NLS) || (defined(D2U_UNICODE) && !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__)) /* setlocale() is also needed for nl_langinfo() */ #if (defined(_WIN32) && !defined(__CYGWIN__)) /* When the locale is set to "" on Windows all East-Asian multi-byte ANSI encoded text is printed wrongly when you use standard printf(). Also UTF-8 code is printed wrongly. See also test/setlocale.c. When we set the locale to "C" gettext still translates the messages on Windows. On Unix this would disable gettext. */ setlocale (LC_ALL, "C"); #else setlocale (LC_ALL, ""); #endif #endif #ifdef ENABLE_NLS bindtextdomain (PACKAGE, localedir); textdomain (PACKAGE); #endif /* variable initialisations */ pFlag = (CFlag*)malloc(sizeof(CFlag)); if (pFlag == NULL) { D2U_UTF8_FPRINTF(stderr, "dos2unix:"); D2U_ANSI_FPRINTF(stderr, " %s\n", strerror(errno)); return errno; } pFlag->FromToMode = FROMTO_DOS2UNIX; /* default dos2unix */ pFlag->keep_bom = 0; if ( ((ptr=strrchr(argv[0],'/')) == NULL) && ((ptr=strrchr(argv[0],'\\')) == NULL) ) ptr = argv[0]; else ptr++; if ((strcmpi("mac2unix", ptr) == 0) || (strcmpi("mac2unix.exe", ptr) == 0)) { pFlag->FromToMode = FROMTO_MAC2UNIX; strcpy(progname,"mac2unix"); } #ifdef D2U_UNIFILE /* Get arguments in wide Unicode format in the Windows Command Prompt */ /* This does not support wildcard expansion (globbing) */ wargv = CommandLineToArgvW(GetCommandLineW(), &argc); argv_glob = (char ***)malloc(sizeof(char***)); if (argv_glob == NULL) { D2U_UTF8_FPRINTF(stderr, "%s:", progname); D2U_ANSI_FPRINTF(stderr, " %s\n", strerror(errno)); free(pFlag); return errno; } /* Glob the arguments and convert them to UTF-8 */ argc_new = glob_warg(argc, wargv, argv_glob, pFlag, progname); argv_new = *argv_glob; #else argc_new = argc; argv_new = argv; #endif #ifdef D2U_UNICODE return parse_options(argc_new, argv_new, pFlag, localedir, progname, PrintLicense, ConvertDosToUnix, ConvertDosToUnixW); #else return parse_options(argc_new, argv_new, pFlag, localedir, progname, PrintLicense, ConvertDosToUnix); #endif } dos2unix-7.3.4/dos2unix.h0000644000175500010010000004544012721132543014502 0ustar waterlanGeen/* * Copyright (C) 2009-2012 Erwin Waterlander * Copyright (C) 1994-1995 Benjamin Lin. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice in the documentation and/or other materials provided with * the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __DOS2UNIX_H #define __DOS2UNIX_H #ifdef __DOS2UNIX_C /* ASCII mode. No conversion. */ static int D2UAsciiTable[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x80', '\x81', '\x82', '\x83', '\x84', '\x85', '\x86', '\x87', '\x88', '\x89', '\x8a', '\x8b', '\x8c', '\x8d', '\x8e', '\x8f', '\x90', '\x91', '\x92', '\x93', '\x94', '\x95', '\x96', '\x97', '\x98', '\x99', '\x9a', '\x9b', '\x9c', '\x9d', '\x9e', '\x9f', '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf', '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7', '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf', '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7', '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf', '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7', '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde', '\xdf', '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7', '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff', }; /* 7bit mode. */ /* All 8 bit non-ASCII characters are converted to a space (\x20) */ static int D2U7BitTable[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', }; /* CP437 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso437Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\xc7', '\xfc', '\xe9', '\xe2', '\xe4', '\xe0', '\xe5', '\xe7', '\xea', '\xeb', '\xe8', '\xef', '\xee', '\xec', '\xc4', '\xc5', '\xc9', '\xe6', '\xc6', '\xf4', '\xf6', '\xf2', '\xfb', '\xf9', '\xff', '\xd6', '\xdc', '\xa2', '\xa3', '\xa5', '\x2e', '\x2e', '\xe1', '\xed', '\xf3', '\xfa', '\xf1', '\xd1', '\xaa', '\xba', '\xbf', '\x2e', '\xac', '\xbd', '\xbc', '\xa1', '\xab', '\xbb', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xdf', '\x2e', '\x2e', '\x2e', '\x2e', '\xb5', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xb1', '\x2e', '\x2e', '\x2e', '\x2e', '\xf7', '\x2e', '\xb0', '\x2e', '\xb7', '\x2e', '\x2e', '\xb2', '\x2e', '\xa0', }; /* CP850 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso850Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\xc7', '\xfc', '\xe9', '\xe2', '\xe4', '\xe0', '\xe5', '\xe7', '\xea', '\xeb', '\xe8', '\xef', '\xee', '\xec', '\xc4', '\xc5', '\xc9', '\xe6', '\xc6', '\xf4', '\xf6', '\xf2', '\xfb', '\xf9', '\xff', '\xd6', '\xdc', '\xf8', '\xa3', '\xd8', '\xd7', '\x2e', '\xe1', '\xed', '\xf3', '\xfa', '\xf1', '\xd1', '\xaa', '\xba', '\xbf', '\xae', '\xac', '\xbd', '\xbc', '\xa1', '\xab', '\xbb', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xc1', '\xc2', '\xc0', '\xa9', '\x2e', '\x2e', '\x2e', '\x2e', '\xa2', '\xa5', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xe3', '\xc3', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa4', '\xf0', '\xd0', '\xca', '\xcb', '\xc8', '\x2e', '\xcd', '\xce', '\xcf', '\x2e', '\x2e', '\x2e', '\x2e', '\xa6', '\xcc', '\x2e', '\xd3', '\xdf', '\xd4', '\xd2', '\xf5', '\xd5', '\xb5', '\xfe', '\xde', '\xda', '\xdb', '\xd9', '\xfd', '\xdd', '\xaf', '\xb4', '\xad', '\xb1', '\x2e', '\xbe', '\xb6', '\xa7', '\xf7', '\xb8', '\xb0', '\xa8', '\xb7', '\xb9', '\xb3', '\xb2', '\x2e', '\xa0', }; /* CP860 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso860Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\xc7', '\xfc', '\xe9', '\xe2', '\xe3', '\xe0', '\xc1', '\xe7', '\xea', '\xca', '\xe8', '\xcd', '\xd4', '\xec', '\xc3', '\xc2', '\xc9', '\xc0', '\xc8', '\xf4', '\xf5', '\xf2', '\xda', '\xf9', '\xcc', '\xd5', '\xdc', '\xa2', '\xa3', '\xd9', '\x2e', '\xd3', '\xe1', '\xed', '\xf3', '\xfa', '\xf1', '\xd1', '\xaa', '\xba', '\xbf', '\xd2', '\xac', '\xbd', '\xbc', '\xa1', '\xab', '\xbb', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xdf', '\x2e', '\x2e', '\x2e', '\x2e', '\xb5', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xb1', '\x2e', '\x2e', '\x2e', '\x2e', '\xf7', '\x2e', '\xb0', '\x2e', '\xb7', '\x2e', '\x2e', '\xb2', '\x2e', '\xa0', }; /* CP863 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso863Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\xc7', '\xfc', '\xe9', '\xe2', '\xc2', '\xe0', '\xb6', '\xe7', '\xea', '\xeb', '\xe8', '\xef', '\xee', '\x2e', '\xc0', '\xa7', '\xc9', '\xc8', '\xca', '\xf4', '\xcb', '\xcf', '\xfb', '\xf9', '\xa4', '\xd4', '\xdc', '\xa2', '\xa3', '\xd9', '\xdb', '\x2e', '\xa6', '\xb4', '\xf3', '\xfa', '\xa8', '\xb8', '\xb3', '\xaf', '\xce', '\x2e', '\xac', '\xbd', '\xbc', '\xbe', '\xab', '\xbb', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xdf', '\x2e', '\x2e', '\x2e', '\x2e', '\xb5', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xb1', '\x2e', '\x2e', '\x2e', '\x2e', '\xf7', '\x2e', '\xb0', '\x2e', '\xb7', '\x2e', '\x2e', '\xb2', '\x2e', '\xa0', }; /* CP865 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso865Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\xc7', '\xfc', '\xe9', '\xe2', '\xe4', '\xe0', '\xe5', '\xe7', '\xea', '\xeb', '\xe8', '\xef', '\xee', '\xec', '\xc4', '\xc5', '\xc9', '\xe6', '\xc6', '\xf4', '\xf6', '\xf2', '\xfb', '\xf9', '\xff', '\xd6', '\xdc', '\xf8', '\xa3', '\xd8', '\x2e', '\x2e', '\xe1', '\xed', '\xf3', '\xfa', '\xf1', '\xd1', '\xaa', '\xba', '\xbf', '\x2e', '\xac', '\xbd', '\xbc', '\xa1', '\xab', '\xa4', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xdf', '\x2e', '\x2e', '\x2e', '\x2e', '\xb5', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xb1', '\x2e', '\x2e', '\x2e', '\x2e', '\xf7', '\x2e', '\xb0', '\x2e', '\xb7', '\x2e', '\x2e', '\xb2', '\x2e', '\xa0', }; /* CP1252 -> ISO-8859-1 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int D2UIso1252Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf', '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7', '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf', '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7', '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf', '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7', '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde', '\xdf', '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7', '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff', }; #endif #ifdef D2U_UNICODE int ConvertDosToUnixW(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, const char *progname); #endif int ConvertDosToUnix(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, const char *progname); #endif dos2unix-7.3.4/emx.mak0000644000175500010010000000175112721132543014036 0ustar waterlanGeen # Author: Erwin Waterlander # Copyright (C) 2009-2014 Erwin Waterlander # This file is distributed under the same license as the dos2unix package. prefix=c:/usr ENABLE_NLS= LDFLAGS_EXTRA = -Zargs-wild ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif ZIPOBJ_EXTRA = all: $(MAKE) all EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LDFLAGS_EXTRA="$(LDFLAGS_EXTRA)" LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="cp -f" UCS= install: $(MAKE) install EXE=.exe ENABLE_NLS=$(ENABLE_NLS) LDFLAGS_EXTRA="$(LDFLAGS_EXTRA)" LIBS_EXTRA="$(LIBS_EXTRA)" prefix=$(prefix) LINK="cp -f" UCS= uninstall: $(MAKE) uninstall EXE=.exe prefix=$(prefix) clean: $(MAKE) clean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) mostlyclean: $(MAKE) mostlyclean EXE=.exe ENABLE_NLS=$(ENABLE_NLS) prefix=$(prefix) dist: $(MAKE) dist-zip EXE=.exe prefix=$(prefix) VERSIONSUFFIX="-os2" ZIPOBJ_EXTRA="${ZIPOBJ_EXTRA}" ENABLE_NLS=$(ENABLE_NLS) strip: $(MAKE) strip LINK="cp -f" EXE=.exe dos2unix-7.3.4/INSTALL.txt0000644000175500010010000002635012721132543014424 0ustar waterlanGeenPREREQUISITES Using GCC: Required * gcc : GNU C compiler * GNU binutils : A collection of binary tools * GNU make : make * sh : POSIX type shell * GNU coreutils: Core utilities package (chmod, install, mkdir, mv, rm, uname) Optional (depending on build targets): * perl : Practical Extraction and Report Language perl >= 5.10.1 is required for rebuilding the manual pages with pod2man. perl >= 5.18 is required for rebuilding the international manual pages correctly in HTML with pod2html. Self-tests require module perl-Test-Simple. * gettext : Framework to help GNU packages produce multi- lingual messages. * po4a : PO for anything, for rebuilding manuals. * groff : GNU troff text formatting system, for international messages and manuals. * ghostscript : An interpreter for the PostScript language and for PDF (ps2pdf) Using LLVM CLANG: Clang can be used as a drop-in replacement for gcc. Just add CC=clang to the make command line. Using Watcom C: Required * Open Watcom : http://www.openwatcom.org/ * Open Watcom V2 : http://open-watcom.github.io/open-watcom/ (git repo) http://sourceforge.net/projects/openwatcom/ (binaries download) Using Microsoft Visual C++: Required * Visual C++ : You can get a free express version via this web page: http://www.visualstudio.com/products/visual-studio-express-vs Download Visual Studio for Windows Desktop. Visual C++ is part of Visual Studio. Out of the box compilation for 64-bit applications is supported since version 2012. BASIC INSTALLATION To build the program type: make To run the self-tests type: make check To strip the executables: make strip To install: make install Clean: make clean SELF-TESTS To run the self-tests you need a Perl installation including module perl-Test-Simple. To check the native Windows ports you need to run the tests in the MSYS2 shell. To run the tests in a DJGPP environment you need to make sure that the bash shell is available (sh.exe). And you need to be in an environment that supports long file names (LFN), e.g. on 32 bit Windows. INSTALLATION NAMES By default the 'install' target will install the program in /usr/bin, the language files in /usr/share/locale and the man page in /usr/share/man. You can specify an installation prefix other than /usr by modifying the 'prefix' variable. An Example: make prefix=$HOME clean all make prefix=$HOME install DEBUG A debug enabled build can be made by adding DEBUG=1 to the make command. Example: make clean install DEBUG=1 With debug enabled you can debug the source code in gdb. DEBUG MESSAGES Extra debug messages can be enabled by adding DEBUGMSG=1 to the make command. Example: make clean install DEBUGMSG=1 With debug messages enabled dos2unix will print extra information about accessing the file system. NATIVE LANGUAGE SUPPORT Native Language Support (NLS) is by default enabled. To disable NLS add ENABLE_NLS=. Example: make clean install ENABLE_NLS= INTERNATIONAL MAN PAGES Since dos2unix 6.0.5 all man pages are encoded in UTF-8, because even Western-European man pages may contain Unicode characters not supported by the Latin-1 (ISO-8859-1) character set. Originally the Unix man system supported only man pages in Latin1 format. Although the world is moving to Unicode format (UTF-8) there is still a lot of Latin1 legacy around. The English man page is a pure ASCII file and is readable on all platforms. Non-English man pages are encoded in UTF-8. These do not show properly on old systems. Man pages in UTF-8 format are shown properly on Linux. Not all roff implementations support UTF-8. In order to show UTF-8 man pages properly on Cygwin with traditional man you need to do the following: In /etc/man.conf, change the NROFF definition to use 'preconv'. NROFF /usr/bin/preconv | /usr/bin/nroff -c -mandoc 2>/dev/null To view the man page set the correct locale. E.g. for Ukrainian: export LANG=uk_UA.UTF-8 man dos2unix With man-db the manpages show correctly out of the box. Cygwin changed to use man-db in June 2014. Man-db is the default man system on the major Linux distributions. LARGE FILE SUPPORT Large File Support (LFS) is by default enabled. This enables the use of 64 bit file system interface on 32 bit systems. This makes it possible to open files larger than 2GB on 32 bit systems, provided the OS has LFS support builtin. To disable LFS make the LFS variable empty. Example: Disable LFS: make clean install LFS= The gcc compiler from the mingw.org project does not support LFS. It is advised to use the mingw-w64 compiler tool chain for LFS on 32 bit Windows. UNICODE SUPPORT Unicode UTF-16 support is by default enabled for Windows and Unix. To disable make the UCS variable (Universal Character Set) empty. Disable Unicode: make clean install UCS= Unicode UTF-16 is not supported by the DOS and OS/2 versions. UNICODE FILE NAME SUPPORT ON WINDOWS Since version 7.3 dos2unix can read and write on Windows file names with Unicode characters. Prior to version 7.3 dos2unix could only open files with characters in the system ANSI code page. To see if dos2unix on Windows has unicode file name support type dos2unix -V. Unicode file name support on Windows is enabled by setting UNIFILE=1 in the makefile or on the make command line. To disable Unicode file name support, make UNIFILE empty: make UNIFILE= Unicode file name support is by default enabled. Dos2unix built with Watcom C is not able to display foreign characters correctly, even when option -D unicode is used. The correct file names are written though. DOCUMENTATION Manual pages are generated from Perl POD files. To rebuild the man pages from POD type: make maintainer-clean make man Generation of correct man pages in UTF-8 format requires perl >= 5.10.1. The manual pages in text and html format are by default only created in English language. To create text and html manuals for other languages type: make txt make html Generation of correct man pages in HTML format requires perl >= 5.18. Once the manuals in non-English languages have been created, they will also be installed under share/doc/ when you type 'make install' Manuals in PDF format are by default not created. To create manuals in PDF format type: make pdf PDF generation requires GhostScript to be installed. WINDOWS 32 BIT PORT Using Mingw , or MinGW-w64 . I advise to use mingw-w64, because mingw-w64 has support for Large File Support (LFS), and mingw doesn't. LFS is the ability to read/write files larger than 2GB or 4GB on a 32 bit operation system. LFS also makes processing files on network drives more reliable. I have had a problem report that output files were not always written when files on a network drive were concurrently processed. By switching from mingw to mingw-w64 the problem was solved. Earlier I got a problem report of accessing small files on a Windows network drive from Debian Linux. Here also the solution was LFS. Since dos2unix 6.0.4 (2013-12-30) I build the binary win32 packages with mingw-w64. I am using the MSYS2 project which includes the MinGW-w64 compiler. The MSYS(2) environment is required for building dos2unix with MinGW(-w64). Type these commands to build with mingw(-w64): make clean make make strip make install Using Open Watcom: wmake -f wccwin32.mak clean wmake -f wccwin32.mak wmake -f wccwin32.mak install Using Microsoft Visual C++: nmake /f vc.mak clean nmake /f vc.mak nmake /f vc.mak install The win32 binaries built with MinGW32 are packed with a patched version of MinGW's libintl-8.dll that has builtin support for relocation. See also http://waterlan.home.xs4all.nl/libintl.html and http://sourceforge.net/p/mingw/bugs/1808/ The MSYS2 project has the relocation patch already included. WINDOWS 64 BIT PORT To compile a version for 64 bit Windows, get the Mingw-w64 compiler . I am using the MSYS2 project which includes the MinGW-w64 compiler. The MSYS2 environment is required for building dos2unix with MinGW-w64. make clean make make strip make install Or use Microsoft Visual C++. Visual Studio Express supports out of the box C/C++ compilation for 64-bit applications since version 2012. Start an "x64 Cross Tools Command Prompt" and type: nmake /f vc.mak clean nmake /f vc.mak nmake /f vc.mak install DOS PORT, 32 BIT To compile a version for DOS, get the DJGPP compiler , and use makefile djgpp.mak. DJGPP 2.03 gcc >= 4.6 seems to cause problems. Crashes of gcc itself, or crashing dos2unix binaries (seen in DOSBox and DOSEMU). Use DJGPP 2.03 gcc <= 4.5.3. DJGPP 2.05 seems to produce correct binaries (I tried gcc 5.3.0). The problem with 2.05 is that 'ln' works differently. If you use DJGPP 2.05 edit djgpp.mak and change the LINK variable to cp -f. make -f djgpp.mak clean make -f djgpp.mak make -f djgpp.mak strip make -f djgpp.mak install Cross compilation with djgpp.mak works out-of-the-box in Cygwin if you have djgpp-gcc-core installed. On Linux you can add CROSS_COMP=1 to the command line. Or use Open Watcom Cross compiling from Windows 32 bit. This works. wmake -f wccdos32.mak clean wmake -f wccdos32.mak wmake -f wccdos32.mak install DOS PORT, 16 BIT To compile a version for DOS, use the Borland C compiler 3.1 or 4.0, and use makefile bcc.mak: make -f bcc.mak clean make -f bcc.mak Or use Open Watcom wmake -f wccdos16.mak clean wmake -f wccdos16.mak wmake -f wccdos16.mak install OS/2 PORT Using EMX make -f emx.mak clean make -f emx.mak make -f emx.mak strip make -f emx.mak install Open Watcom wmake -f wccos2.mak clean wmake -f wccos2.mak wmake -f wccos2.mak install dos2unix-7.3.4/Makefile0000644000175500010010000005301712721132543014215 0ustar waterlanGeen# Author: Erwin Waterlander # # Copyright (C) 2009-2016 Erwin Waterlander # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice in the documentation and/or other materials provided with # the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Description # # This is a GNU Makefile that uses GNU compilers, linkers and cpp. The # platform specific issues are determined by the various OS teets that # rely on the uname(1) command and directory locations. # # Set additional flags for the build with variables CFLAGS_USER, # DEFS_USER and LDFLAGS_USER. include version.mk .PHONY: man txt html pdf mofiles tags merge test check .PRECIOUS: %.1 %.pod CC ?= gcc CPP ?= cpp CPP_FLAGS_POD = ALL STRIP = strip PACKAGE = dos2unix UNIX2DOS = unix2dos MAC2UNIX = mac2unix UNIX2MAC = unix2mac # Native Language Support (NLS) ENABLE_NLS = 1 # Large File Support (LFS) LFS = 1 # DEBUG=1 adds the -g option to CFLAGS, for adding debug symbols. DEBUG = 0 # DEBUGMSG=1 adds -DDEBUG=1 to CFLAGS, for extra verbose messages. DEBUGMSG = 0 UCS = 1 DIST_TARGET = dist-tgz EXE= BIN = $(PACKAGE)$(EXE) UNIX2DOS_BIN = $(UNIX2DOS)$(EXE) MAC2UNIX_BIN = $(MAC2UNIX)$(EXE) UNIX2MAC_BIN = $(UNIX2MAC)$(EXE) # DJGPP support linking of .EXEs via 'stubify'. # See djgpp.mak and http://www.delorie.com/djgpp/v2faq/faq22_5.html LINK = ln -sf LINK_MAN = $(LINK) prefix = /usr exec_prefix = $(prefix) bindir = $(exec_prefix)/bin datarootdir = $(prefix)/share datadir = $(datarootdir) docsubdir = $(PACKAGE)-$(DOS2UNIX_VERSION) docdir = $(datarootdir)/doc/$(docsubdir) localedir = $(datarootdir)/locale mandir = $(datarootdir)/man man1dir = $(mandir)/man1 manext = .1 man1ext = .1 ifdef ENABLE_NLS POT = po/$(PACKAGE).pot POFILES = $(wildcard po/??.po) $(wildcard po/??_??.po) MOFILES = $(patsubst %.po,%.mo,$(POFILES)) NLSSUFFIX = -nls endif HTMLEXT = htm # By default we generate only English text and html manuals. DOCFILES = man/man1/$(PACKAGE).txt man/man1/$(PACKAGE).$(HTMLEXT) INSTALL_OBJS_DOC = README.txt INSTALL.txt NEWS.txt ChangeLog.txt COPYING.txt TODO.txt BUGS.txt $(DOCFILES) ifdef ENABLE_NLS MANPOTFILE = po-man/dos2unix-man.pot MANPOFILES = $(wildcard po-man/*.po) PODFILES = $(patsubst po-man/%.po,man/%/man1/dos2unix.pod,$(MANPOFILES)) endif PODFILES_ALL = man/man1/dos2unix.pod $(PODFILES) MANFILES = $(patsubst %.pod,%.1,$(PODFILES)) TXTFILES = $(patsubst %.pod,%.txt,$(PODFILES_ALL)) HTMLFILES = $(patsubst %.pod,%.$(HTMLEXT),$(PODFILES_ALL)) PSFILES = $(patsubst %.pod,%.ps,$(PODFILES_ALL)) PDFFILES = $(patsubst %.pod,%.pdf,$(PODFILES_ALL)) # On some systems (e.g. FreeBSD 4.10) GNU install is installed as `ginstall'. INSTALL = install INSTALL_PROGRAM = $(INSTALL) -m 755 INSTALL_DATA = $(INSTALL) -m 644 # On some systems (e.g. GNU Win32) GNU mkdir is installed as `gmkdir'. MKDIR = mkdir ifdef ENABLE_NLS DOS2UNIX_NLSDEFS = -DENABLE_NLS -DLOCALEDIR=\"$(localedir)\" -DPACKAGE=\"$(PACKAGE)\" endif VERSIONSUFFIX = -bin # ......................................................... OS flags ... ifndef D2U_OS d2u_os=$(shell uname -s) ifeq ($(findstring CYGWIN,$(d2u_os)),CYGWIN) D2U_OS = cygwin endif ifndef D2U_OS ifeq ($(findstring MSYS,$(d2u_os)),MSYS) D2U_OS = msys endif endif ifndef D2U_OS ifeq ($(findstring MINGW32,$(d2u_os)),MINGW32) D2U_OS = mingw32 endif endif ifndef D2U_OS ifeq ($(findstring MINGW64,$(d2u_os)),MINGW64) D2U_OS = mingw64 endif endif ifndef D2U_OS ifneq ($(DJGPP),) D2U_OS = msdos endif endif ifndef D2U_OS ifneq (, $(wildcard /opt/csw)) D2U_OS = sun endif endif ifndef D2U_OS D2U_OS=$(shell echo $(d2u_os) | tr [A-Z] [a-z]) endif endif ifeq (cygwin,$(D2U_OS)) ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv endif LDFLAGS_EXTRA = -Wl,--enable-auto-import EXE = .exe # allow non-cygwin clients which do not understand cygwin # symbolic links to launch applications... LINK = ln -f # but use symbolic links for man pages, since man client # IS a cygwin app and DOES understand symlinks. LINK_MAN = ln -fs # Cygwin packaging standard avoids version numbers on # documentation directories. docsubdir = $(PACKAGE) MACHINE := $(subst -pc-cygwin,,$(shell gcc -dumpmachine)) VERSIONSUFFIX = -cygwin-$(MACHINE) endif ifeq (msys,$(D2U_OS)) CC=gcc EXE = .exe MACHINE := $(subst -pc-msys,,$(shell gcc -dumpmachine)) # MSYS 1 does not support locales and no Unicode. ifeq ($(shell ./test/chk_loc.sh en_US.utf8),no) UCS = VERSIONSUFFIX = -msys1-$(MACHINE) else VERSIONSUFFIX = -msys2-$(MACHINE) endif ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv endif endif ifeq (mingw32,$(D2U_OS)) CC=gcc prefix=c:/usr/local EXE = .exe VERSIONSUFFIX = -win32 LINK = cp -f UNIFILE=1 DIST_TARGET = dist-zip ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv ZIPOBJ_EXTRA = bin/libintl-8.dll bin/libiconv-2.dll endif ifeq ($(findstring w64-mingw32,$(shell gcc -dumpmachine)),w64-mingw32) # Mingw-w64 CFLAGS_COMPILER = -DD2U_COMPILER=MINGW32_W64 ifdef ENABLE_NLS ZIPOBJ_EXTRA += bin/libgcc_s_dw2-1.dll bin/libwinpthread-1.dll endif CRT_GLOB_OBJ = /mingw32/i686-w64-mingw32/lib/CRT_glob.o LIBS_EXTRA += $(CRT_GLOB_OBJ) CFLAGS_OS=-I/mingw32/include else CFLAGS_OS=-D_O_U16TEXT=0x20000 endif endif ifeq (mingw64,$(D2U_OS)) CC=gcc prefix=c:/usr/local64 EXE = .exe VERSIONSUFFIX = -win64 LINK = cp -f UNIFILE=1 DIST_TARGET = dist-zip ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv ZIPOBJ_EXTRA = bin/libintl-8.dll bin/libiconv-2.dll endif CRT_GLOB_OBJ = /mingw64/x86_64-w64-mingw32/lib/CRT_glob.o LIBS_EXTRA += $(CRT_GLOB_OBJ) CFLAGS_OS=-I/mingw64/include endif ifeq (msdos,$(D2U_OS)) prefix=c:/dos32 EXE = .exe VERSIONSUFFIX = pm LINK_MAN = cp -f docsubdir = dos2unix UCS = ZIPOBJ_EXTRA = bin/cwsdpmi.exe ifdef ENABLE_NLS LIBS_EXTRA = -lintl -liconv endif endif ifeq (os/2,$(D2U_OS)) prefix=c:/usr EXE = .exe VERSIONSUFFIX = -os2 LINK_MAN = cp -f UCS = LDFLAGS_EXTRA = -Zargs-wild DIST_TARGET = dist-zip ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif endif ifeq (freemint,$(D2U_OS)) prefix=/usr EXE = VERSIONSUFFIX = -freemint UCS= ENABLE_NLS= ifdef ENABLE_NLS LIBS_EXTRA += -lintl -liconv endif EXTRA_DEFS += -Dfreemint -D__OS=\"freemint\" endif ifeq (freebsd,$(D2U_OS)) ifdef ENABLE_NLS CFLAGS_OS = -I/usr/local/include LDFLAGS_EXTRA = -L/usr/local/lib LIBS_EXTRA = -lintl endif endif ifeq (darwin,$(D2U_OS)) ifdef ENABLE_NLS CFLAGS_OS = -I/usr/local/include LDFLAGS_EXTRA = -L/usr/local/lib LIBS_EXTRA = -lintl endif endif ifeq (sun,$(D2U_OS)) # Running under SunOS/Solaris LIBS_EXTRA = -lintl endif ifeq (hp-ux,$(D2U_OS)) # Running under HP-UX EXTRA_DEFS += -Dhpux -D_HPUX_SOURCE endif # ............................................................ flags ... # PostScript and PDF generation from UTF-8 manuals is not working, # or I don't know how to do it. CFLAGS_USER = CFLAGS ?= -O2 CFLAGS += -Wall -Wextra -Wconversion $(RPM_OPT_FLAGS) $(CPPFLAGS) $(CFLAGS_USER) EXTRA_CFLAGS = -DVER_REVISION=\"$(DOS2UNIX_VERSION)\" \ -DVER_DATE=\"$(DOS2UNIX_DATE)\" \ -DVER_AUTHOR=\"$(DOS2UNIX_AUTHOR)\" \ -DDEBUG=$(DEBUGMSG) \ $(CFLAGS_OS) \ $(CFLAGS_COMPILER) ifeq ($(DEBUG), 1) EXTRA_CFLAGS += -g endif ifdef STATIC EXTRA_CFLAGS += -static endif ifdef UCS EXTRA_CFLAGS += -DD2U_UNICODE endif ifdef UNIFILE EXTRA_CFLAGS += -DD2U_UNIFILE endif ifdef LFS EXTRA_CFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 endif LDFLAGS_USER = LDFLAGS = $(RPM_OPT_FLAGS) $(LDFLAGS_EXTRA) $(LDFLAGS_USER) LIBS = $(LIBS_EXTRA) DEFS_USER = DEFS = $(EXTRA_DEFS) $(DEFS_USER) # .......................................................... targets ... all: $(BIN) $(MAC2UNIX_BIN) $(UNIX2DOS_BIN) $(UNIX2MAC_BIN) $(DOCFILES) $(MOFILES) man/man1/dos2unix.1 $(MANFILES) $(MANPOTFILE) status: @echo "D2U_OS = $(D2U_OS)" @echo "UCS = $(UCS)" @echo "CFLAGS = $(CFLAGS)" @echo "EXTRA_CFLAGS = $(EXTRA_CFLAGS)" @echo "LDFLAGS = $(LDFLAGS)" @echo "LIBS = $(LIBS)" common.o : common.c common.h dos2unix.h unix2dos.h version.mk $(CC) $(DEFS) $(EXTRA_CFLAGS) $(DOS2UNIX_NLSDEFS) $(CFLAGS) -c $< -o $@ querycp.o : querycp.c querycp.h $(CC) $(DEFS) $(EXTRA_CFLAGS) $(DOS2UNIX_NLSDEFS) $(CFLAGS) -c $< -o $@ dos2unix.o : dos2unix.c dos2unix.h querycp.h common.h $(CC) $(DEFS) $(EXTRA_CFLAGS) $(DOS2UNIX_NLSDEFS) $(CFLAGS) -c $< -o $@ unix2dos.o : unix2dos.c unix2dos.h querycp.h common.h $(CC) $(DEFS) $(EXTRA_CFLAGS) $(DOS2UNIX_NLSDEFS) $(CFLAGS) -c $< -o $@ $(BIN): dos2unix.o querycp.o common.o $(CC) $+ $(LDFLAGS) $(LIBS) -o $@ $(UNIX2DOS_BIN): unix2dos.o querycp.o common.o $(CC) $+ $(LDFLAGS) $(LIBS) -o $@ $(MAC2UNIX_BIN) : $(BIN) $(LINK) $< $@ $(UNIX2MAC_BIN) : $(UNIX2DOS_BIN) $(LINK) $< $@ $(MANPOTFILE) : man/man1/dos2unix.pod $(MAKE) -C man/man1 ../../po-man/$(notdir $@) # WARNING: Backward-incompatibility since GNU make 3.82. # The pattern-specific variables and pattern rules are now applied in the # shortest stem first order instead of the definition order (variables # and rules with the same stem length are still applied in the definition # order). # In order to stay compatible with GNU make < 3.82 we put the rule with # the shortest stem first. po/%.po : $(POT) msgmerge --no-wrap -U $@ $(POT) --backup=numbered # change timestamp in case .po file was not updated. touch $@ %.po : man/man1/dos2unix.pod $(MAKE) -C man/man1 $(subst po-man/,../../po-man/,$@) man/%/man1/dos2unix.pod : po-man/%.po $(MAKE) -C man/man1 $(subst man/,../,$@) # empty recipe to break circular dependency man/man1/dos2unix.pod : ; %.1 : %.pod $(MAKE) -C man/man1 $(subst man/,../,$@) mofiles: $(MOFILES) html: $(HTMLFILES) txt: $(TXTFILES) ps: $(PSFILES) pdf: $(PDFFILES) man: man/man1/dos2unix.1 $(MANFILES) $(MANPOTFILE) doc: $(DOCFILES) tags: $(POT) merge: $(POFILES) # Get new po files from the Translation Project. getpo: rsync -Lrtvz translationproject.org::tp/latest/dos2unix/ po/incoming/ getpoman: rsync -Lrtvz translationproject.org::tp/latest/dos2unix-man/ po-man/incoming/ %.mo : %.po msgfmt -c $< -o $@ $(POT) : dos2unix.c unix2dos.c common.c xgettext -C -cTRANSLATORS: --no-wrap --keyword=_ $+ -o $(POT) %.txt : %.pod pod2text $< > $@ README.txt INSTALL.txt NEWS.txt ChangeLog.txt COPYING.txt TODO.txt BUGS.txt: ; %.ps : %.1 groff -man $< -T ps > $@ %.pdf: %.ps ps2pdf $< $@ # Since perl 5.18 pod2html generates HTML with all non-ASCII characters encoded # with HTML Ampersand Character Codes. This seems to be better browser compatible # than HTML in UTF-8 format. PERL_UNICODE=SDA is needed to get a correct UTF-8 # encoded title. # With perl < 5.18 you have to remove PERL_UNICODE=SDA, and then you get HTML pages # in UTF-8 format. # Generic rule. %.$(HTMLEXT) : %.pod PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/MAC to UNIX and vice versa text file format converter" $< > $@ man/de/man1/$(PACKAGE).$(HTMLEXT) : man/de/man1/$(PACKAGE).pod PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - Formatumwandlung für Textdateien von DOS/Mac nach Unix und umgekehrt" $< > $@ man/es/man1/$(PACKAGE).$(HTMLEXT) : man/es/man1/$(PACKAGE).pod PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa" $< > $@ man/fr/man1/$(PACKAGE).$(HTMLEXT) : man/fr/man1/$(PACKAGE).pod PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - Convertit les fichiers textes du format DOS/Mac vers Unix et inversement" $< > $@ man/nl/man1/$(PACKAGE).$(HTMLEXT) : man/nl/man1/$(PACKAGE).pod PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/Mac naar Unix en vice versa tekstbestand formaat omzetter" $< > $@ man/pl/man1/$(PACKAGE).$(HTMLEXT) : man/pl/man1/$(PACKAGE).pod PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - konwerter formatu plików tekstowych między systemami DOS/Mac a Uniksem" $< > $@ man/pt_BR/man1/$(PACKAGE).$(HTMLEXT) : man/pt_BR/man1/$(PACKAGE).pod PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - Conversor de formato de arquivo texto de DOS/Mac para Unix e vice-versa" $< > $@ man/uk/man1/$(PACKAGE).$(HTMLEXT) : man/uk/man1/$(PACKAGE).pod PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - програма для перетворення даних у текстовому форматі DOS/Mac у формат Unix, і навпаки" $< > $@ man/zh_CN/man1/$(PACKAGE).$(HTMLEXT) : man/zh_CN/man1/$(PACKAGE).pod PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/Mac - Unix文件格式转换器" $< > $@ man/sv/man1/$(PACKAGE).$(HTMLEXT) : man/sv/man1/$(PACKAGE).pod PERL_UNICODE=SDA pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - textfilsformatskonverterare från DOS/Mac till Unix och vice versa" $< > $@ test: all ifneq ($(DJGPP),) cd test; $(MAKE) test UCS= SHELL=$(shell which sh) else cd test; $(MAKE) test UCS=$(UCS) endif check: test install: all $(MKDIR) -p -m 755 $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) $(BIN) $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) $(UNIX2DOS_BIN) $(DESTDIR)$(bindir) ifeq ($(LINK),cp -f) $(INSTALL_PROGRAM) $(MAC2UNIX_BIN) $(DESTDIR)$(bindir) $(INSTALL_PROGRAM) $(UNIX2MAC_BIN) $(DESTDIR)$(bindir) else cd $(DESTDIR)$(bindir); $(LINK) $(BIN) $(MAC2UNIX_BIN) cd $(DESTDIR)$(bindir); $(LINK) $(UNIX2DOS_BIN) $(UNIX2MAC_BIN) endif $(MKDIR) -p -m 755 $(DESTDIR)$(man1dir) $(INSTALL_DATA) man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir) ifeq ($(LINK_MAN),cp -f) $(INSTALL_DATA) man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir)/$(MAC2UNIX).1 $(INSTALL_DATA) man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir)/$(UNIX2DOS).1 $(INSTALL_DATA) man/man1/$(PACKAGE).1 $(DESTDIR)$(man1dir)/$(UNIX2MAC).1 else cd $(DESTDIR)$(man1dir); $(LINK_MAN) $(PACKAGE).1 $(MAC2UNIX).1 cd $(DESTDIR)$(man1dir); $(LINK_MAN) $(PACKAGE).1 $(UNIX2DOS).1 cd $(DESTDIR)$(man1dir); $(LINK_MAN) $(PACKAGE).1 $(UNIX2MAC).1 endif ifdef ENABLE_NLS $(foreach manfile, $(MANFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ;) $(foreach manfile, $(MANFILES), $(INSTALL_DATA) $(manfile) $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ;) $(foreach manfile, $(MANFILES), cd $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ; $(LINK_MAN) $(PACKAGE).1 $(MAC2UNIX).1 ;) $(foreach manfile, $(MANFILES), cd $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ; $(LINK_MAN) $(PACKAGE).1 $(UNIX2DOS).1 ;) $(foreach manfile, $(MANFILES), cd $(DESTDIR)$(datarootdir)/$(dir $(manfile)) ; $(LINK_MAN) $(PACKAGE).1 $(UNIX2MAC).1 ;) @echo "-- install-mo" $(foreach mofile, $(MOFILES), $(MKDIR) -p -m 755 $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES ;) $(foreach mofile, $(MOFILES), $(INSTALL_DATA) $(mofile) $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;) endif # Run a new instance of 'make' otherwise the $$(wildcard ) function my not have been expanded, # because the files may not have been there when make was started. $(MAKE) install-doc install-doc: $(INSTALL_OBJS_DOC) @echo "-- install-doc" $(MKDIR) -p -m 755 $(DESTDIR)$(docdir) $(INSTALL_DATA) $(INSTALL_OBJS_DOC) $(DESTDIR)$(docdir) $(foreach pdffile, $(wildcard man/man1/*.pdf), $(INSTALL_DATA) $(pdffile) $(DESTDIR)$(docdir) ;) $(foreach psfile, $(wildcard man/man1/*.ps), $(INSTALL_DATA) $(psfile) $(DESTDIR)$(docdir) ;) ifdef ENABLE_NLS # Install translated manuals when they have been generated. $(foreach txtfile, $(wildcard man/*/man1/*.txt), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;) $(foreach txtfile, $(wildcard man/*/man1/*.txt), $(INSTALL_DATA) $(txtfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(txtfile),)) ;) $(foreach htmlfile, $(wildcard man/*/man1/*.$(HTMLEXT)), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;) $(foreach htmlfile, $(wildcard man/*/man1/*.$(HTMLEXT)), $(INSTALL_DATA) $(htmlfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(htmlfile),)) ;) $(foreach pdffile, $(wildcard man/*/man1/*.pdf), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(pdffile),)) ;) $(foreach pdffile, $(wildcard man/*/man1/*.pdf), $(INSTALL_DATA) $(pdffile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(pdffile),)) ;) $(foreach psfile, $(wildcard man/*/man1/*.ps), $(MKDIR) -p -m 755 $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(psfile),)) ;) $(foreach psfile, $(wildcard man/*/man1/*.ps), $(INSTALL_DATA) $(psfile) $(DESTDIR)$(docdir)/$(word 2,$(subst /, ,$(psfile),)) ;) endif uninstall: @echo "-- target: uninstall" -rm -f $(DESTDIR)$(bindir)/$(BIN) -rm -f $(DESTDIR)$(bindir)/$(MAC2UNIX_BIN) -rm -f $(DESTDIR)$(bindir)/$(UNIX2DOS_BIN) -rm -f $(DESTDIR)$(bindir)/$(UNIX2MAC_BIN) -rm -f $(DESTDIR)$(mandir)/man1/$(PACKAGE).1 -rm -f $(DESTDIR)$(mandir)/man1/$(MAC2UNIX).1 -rm -f $(DESTDIR)$(mandir)/man1/$(UNIX2DOS).1 -rm -f $(DESTDIR)$(mandir)/man1/$(UNIX2MAC).1 -rm -rf $(DESTDIR)$(docdir) ifdef ENABLE_NLS $(foreach mofile, $(MOFILES), rm -f $(DESTDIR)$(localedir)/$(basename $(notdir $(mofile)))/LC_MESSAGES/$(PACKAGE).mo ;) $(foreach manfile, $(MANFILES), rm -f $(DESTDIR)$(datarootdir)/$(manfile) ;) $(foreach manfile, $(MANFILES), rm -f $(DESTDIR)$(datarootdir)/$(dir $(manfile))$(MAC2UNIX).1 ;) $(foreach manfile, $(MANFILES), rm -f $(DESTDIR)$(datarootdir)/$(dir $(manfile))$(UNIX2DOS).1 ;) $(foreach manfile, $(MANFILES), rm -f $(DESTDIR)$(datarootdir)/$(dir $(manfile))$(UNIX2MAC).1 ;) endif mostlyclean: rm -f *.o rm -f $(BIN) $(UNIX2DOS_BIN) $(MAC2UNIX_BIN) $(UNIX2MAC_BIN) rm -f *.bak *~ rm -f *.tmp rm -f man/man1/*.bak man/man1/*~ rm -f man/*/man1/*.bak man/*/man1/*~ rm -f po/*.bak po/*~ rm -f po/*.mo po-man/*~ cd test; $(MAKE) clean # Don't distribute PostScript and PDF manuals in the source package. # We don't want binary PDF files in the source package, because # some packagers check in the source files. PostScript is not used # a lot. clean: mostlyclean rm -f man/man1/*.ps rm -f man/man1/*.pdf rm -f man/*/man1/*.ps rm -f man/*/man1/*.pdf distclean: clean # Because there is so much trouble with generating man pages with # pod2man, due to old Perl versions (< 5.10.1) on many systems, I include the # man pages in the source tar file. # Old pod2man versions do not have the --utf8 option. Old pod2man, pod2text, # and pod2html do not support the =encoding command. # Perl 5.18 pod2man demands an =encoding command for Latin-1 encoded POD files. # # Newer perl/pod2man versions produce better output. It is better to include # man pages in the source package, than that people generate them themselves # with old perl versions. maintainer-clean: distclean @echo 'This command is intended for maintainers to use; it' @echo 'deletes files that may need special tools to rebuild.' rm -f man/man1/*.1 rm -f man/man1/*.txt rm -f man/man1/*.$(HTMLEXT) rm -f po-man/dos2unix-man.pot rm -f man/*/man1/*.1 rm -f man/*/man1/*.txt rm -f man/*/man1/*.pod rm -f man/*/man1/*.$(HTMLEXT) realclean: maintainer-clean ZIPOBJ = bin/$(BIN) \ bin/$(MAC2UNIX_BIN) \ bin/$(UNIX2DOS_BIN) \ bin/$(UNIX2MAC_BIN) \ share/man/man1/$(PACKAGE).1 \ share/man/man1/$(MAC2UNIX).1 \ share/man/man1/$(UNIX2DOS).1 \ share/man/man1/$(UNIX2MAC).1 \ share/doc/$(docsubdir)/*.* \ $(ZIPOBJ_EXTRA) ifdef ENABLE_NLS ZIPOBJ += share/locale/*/LC_MESSAGES/$(PACKAGE).mo ZIPOBJ += share/man/*/man1/$(PACKAGE).1 \ share/man/*/man1/$(MAC2UNIX).1 \ share/man/*/man1/$(UNIX2DOS).1 \ share/man/*/man1/$(UNIX2MAC).1 ZIPOBJ += share/doc/$(docsubdir)/*/* endif ZIPFILE = $(PACKAGE)-$(DOS2UNIX_VERSION)$(VERSIONSUFFIX)$(NLSSUFFIX).zip TGZFILE = $(PACKAGE)-$(DOS2UNIX_VERSION)$(VERSIONSUFFIX)$(NLSSUFFIX).tar.gz TBZFILE = $(PACKAGE)-$(DOS2UNIX_VERSION)$(VERSIONSUFFIX)$(NLSSUFFIX).tar.bz2 dist-convert/%: rm -f $(prefix)/$(ZIPFILE) cd $(prefix) ; $* --keepdate share/man/man1/$(PACKAGE).1 share/man/man1/$(MAC2UNIX).1 share/man/man1/$(UNIX2DOS).1 share/man/man1/$(UNIX2MAC).1 cd $(prefix) ; $* --keepdate --add-bom share/doc/$(docsubdir)/*.txt cd $(prefix) ; $* --keepdate share/doc/$(docsubdir)/*.$(HTMLEXT) ifdef ENABLE_NLS cd $(prefix) ; $* --keepdate share/man/*/man1/$(PACKAGE).1 share/man/*/man1/$(MAC2UNIX).1 share/man/*/man1/$(UNIX2DOS).1 share/man/*/man1/$(UNIX2MAC).1 cd $(prefix) ; $* --keepdate --add-bom share/doc/$(docsubdir)/*/*.txt cd $(prefix) ; $* --keepdate share/doc/$(docsubdir)/*/*.$(HTMLEXT) endif dist-zip: dist-convert/unix2dos cd $(prefix) ; zip -r $(ZIPFILE) $(ZIPOBJ) mv -f $(prefix)/$(ZIPFILE) .. dist-tgz: dist-convert/dos2unix cd $(prefix) ; tar cvzf $(TGZFILE) $(ZIPOBJ) mv $(prefix)/$(TGZFILE) .. dist-tbz: dist-convert/dos2unix cd $(prefix) ; tar cvjf $(TBZFILE) $(ZIPOBJ) mv $(prefix)/$(TBZFILE) .. dist: $(DIST_TARGET) strip: $(STRIP) $(BIN) $(STRIP) $(UNIX2DOS_BIN) ifeq ($(LINK),cp -f) $(STRIP) $(MAC2UNIX_BIN) $(STRIP) $(UNIX2MAC_BIN) endif # End of file dos2unix-7.3.4/man/0000755000175500010010000000000012721132565013326 5ustar waterlanGeendos2unix-7.3.4/man/de/0000755000175500010010000000000012721132560013711 5ustar waterlanGeendos2unix-7.3.4/man/de/man1/0000755000175500010010000000000012721132613014544 5ustar waterlanGeendos2unix-7.3.4/man/de/man1/dos2unix.10000644000175500010010000010611512721132561016407 0ustar waterlanGeen.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dos2unix 1" .TH dos2unix 1 "2016-05-24" "dos2unix" "2016-05-24" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "BEZEICHNUNG" .IX Header "BEZEICHNUNG" dos2unix \- Formatumwandlung für Textdateien von DOS/Mac nach Unix und umgekehrt .SH "ÜBERSICHT" .IX Header "ÜBERSICHT" .Vb 2 \& dos2unix [Optionen] [DATEI …] [\-n EINGABEDATEI AUSGABEDATEI …] \& unix2dos [Optionen] [DATEI …] [\-n EINGABEDATEI AUSGABEDATEI …] .Ve .SH "BESCHREIBUNG" .IX Header "BESCHREIBUNG" Das Paket Dos2unix enthält die Werkzeuge \f(CW\*(C`dos2unix\*(C'\fR und \f(CW\*(C`unix2dos\*(C'\fR zum Umwandeln einfacher Textdateien aus dem \s-1DOS\-\s0 oder Mac-Format in das Unix-Format und umgekehrt. .PP In Textdateien unter DOS/Windows sind Zeilenumbrüche, auch als neue Zeile (\s-1NL\s0) bekannt, eine Kombination aus zwei Zeichen: einem Wagenrücklauf (Carriage Return, \s-1CR\s0) gefolgt von einem Zeilenvorschub (Line Feed, \s-1LF\s0). In Unix-Textdateien bestehen Zeilenumbrüche nur aus einem Zeichen, dem Zeilenvorschub (\s-1LF\s0). In Mac-Textdateien aus der Zeit vor MacOSX bestand ein Zeilenumbruch aus einem einzelnen CR-Zeichen. Heute verwendet Mac \s-1OS\s0 Zeilenumbrüche im Unix-Stil (\s-1LF\s0). .PP Neben Zeilenumbrüchen kann Dos2unix auch die Zeichenkodierung von Dateien umwandeln. Einige DOS-Codepages können in Unix Latin\-1 umgewandelt werden, und Windows-Unicode-Dateien (\s-1UTF\-16\s0) können in Unix-Unicode-Dateien (\s-1UTF\-8\s0) umgewandelt werden. .PP Binärdateien werden automatisch übersprungen, sofern die Umwandlung nicht erzwungen wird. .PP Nicht\-reguläre Dateien, wie Verzeichnisse und \s-1FIFOS \s0(Weiterleitungen) werden automatisch übersprungen. .PP Symbolische Links und deren Ziele werden per Vorgabe unverändert belassen. Symbolische Links können optional ersetzt werden, oder die Ausgabe wird in das Ziel des symbolischen Links geschrieben. Unter Windows wird das Schreiben in das Ziel eines symbolischen Links nicht unterstützt. .PP Dos2unix wurde nach dem Vorbild der dos2unix\-Version unter SunOS/Solaris entwickelt, doch es gibt einen wesentlichen Unterschied zum Original: Diese Version ersetzt per Vorgabe Dateien bei der Umwandlung (Alte-Datei-Modus), während unter SunOS/Solaris nur die paarweise Umwandlung (Neue-Datei-Modus) unterstützt wird. Siehe dazu die Optionen \f(CW\*(C`\-o\*(C'\fR und \f(CW\*(C`\-n\*(C'\fR. Ein weiterer Unterschied ist, dass die SunOS/Solaris\-Version in der Voreinstellung die Umwandlung im \fIiso\fR\-Modus vornimmt, während diese Version den \&\fIascii\fR\-Modus verwendet. .SH "OPTIONEN" .IX Header "OPTIONEN" .IP "\fB\-\-\fR" 4 .IX Item "--" nimmt alle folgenden Optionen als Dateinamen an. Verwenden Sie diese Option, wenn Sie Dateien umwandeln wollen, deren Namen mit einem Minuszeichen beginnen. Um beispielsweise eine Datei namens »\-bla« umzuwandeln, können Sie folgenden Befehl verwenden: .Sp .Vb 1 \& dos2unix \-\- \-bla .Ve .Sp oder im Neue-Datei-Modus: .Sp .Vb 1 \& dos2unix \-n \-\- \-bla ausgabe.txt .Ve .IP "\fB\-ascii\fR" 4 .IX Item "-ascii" wandelt nur Zeilenumbrüche um. Dies ist der vorgegebene Umwandlungsmodus. .IP "\fB\-iso\fR" 4 .IX Item "-iso" wandelt aus dem \s-1DOS\-\s0 in den ISO\-8859\-1\-Zeichensatz um. Weitere Informationen hierzu finden Sie im Abschnitt \s-1UMWANDLUNGSMODI.\s0 .IP "\fB\-1252\fR" 4 .IX Item "-1252" verwendet die Windows-Codepage 1252 (Westeuropäisch). .IP "\fB\-437\fR" 4 .IX Item "-437" verwendet die DOS-Codepage 437 (\s-1US\s0). Dies ist die vorgegebene Codepage für die ISO-Umwandlung. .IP "\fB\-850\fR" 4 .IX Item "-850" verwendet die DOS-Codepage 850 (Westeuropäisch). .IP "\fB\-860\fR" 4 .IX Item "-860" verwendet die DOS-Codepage 860 (Portugiesisch). .IP "\fB\-863\fR" 4 .IX Item "-863" verwendet die DOS-Codepage 863 (Kanadisches Französisch). .IP "\fB\-865\fR" 4 .IX Item "-865" verwendet die DOS-Codepage 865 (Skandinavisch). .IP "\fB\-7\fR" 4 .IX Item "-7" wandelt 8bit\-Zeichen in ein 7bit\-Bitmuster um. .IP "\fB\-b, \-\-keep\-bom\fR" 4 .IX Item "-b, --keep-bom" erhält die Markierung der Bytereihenfolge (\s-1BOM\s0). Wenn die Eingabedatei eine \&\s-1BOM\s0 enthält, wird ebenfalls eine \s-1BOM\s0 in die Ausgabedatei geschrieben. Dies ist das Standardverhalten beim Umwandeln von DOS\-Zeilenumbrüchen. Siehe auch die Option \f(CW\*(C`\-r\*(C'\fR. .IP "\fB\-c, \-\-convmode \s-1UMWANDLUNGSMODUS\s0\fR" 4 .IX Item "-c, --convmode UMWANDLUNGSMODUS" legt den Umwandlungsmodus fest. \s-1UMWANDLUNGSMODUS\s0 kann \fIascii\fR, \fI7bit\fR, \&\fIiso\fR oder \fImac\fR sein, wobei \fIascii\fR die Vorgabe ist. .IP "\fB\-D, \-\-display\-enc \s-1KODIERUNG\s0\fR" 4 .IX Item "-D, --display-enc KODIERUNG" legt die Kodierung des angezeigten Texts fest. \s-1KODIERUNG\s0 kann \fIansi\fR, \&\fIunicode\fR, \fIunicodebom\fR, \fIutf8\fR oder sein, wobei \fIansi\fR die Vorgabe ist. .Sp Diese Option ist nur in dos2unix für Windows mit Unterstützung für Unicode-Dateinamen verfügbar. Sie bleibt wirkungslos, wenn die tatsächlichen Dateinamen gelesen und geschrieben werden, lediglich bei der Darstellung wird sie berücksichtigt. .Sp Es gibt verschiedene Möglichkeiten, Text in einer Windows-Konsole basierend auf dessen Kodierung darzustellen. Alle haben verschiedene Vor\- und Nachteile. .RS 4 .IP "\fBansi\fR" 4 .IX Item "ansi" Die Standardmethode von dos2unix ist die Verwendung von ANSI-kodiertem Text, der Vorteil ist deren Abwärtskompatibilität. Dies funktioniert mit Raster\- und TrueType-Schriften. In manchen Gebieten müssen Sie mit dem Befehl \&\f(CW\*(C`chcp\*(C'\fR die aktive DOS-OEM-Codepage in die \-System\-ANSI\-Codepage des Systems ändern, da dos2unix Letztere verwendet. .Sp Der Nachteil von \s-1ANSI\s0 ist, dass internationale Dateinamen nicht korrekt dargestellt werden, wenn darin Zeichen enthalten sind, die nicht in der im System voreingestellten Codepage enthalten sind. Stattdessen wird entweder ein Fragezeichen oder ein falsches Zeichen angezeigt. Sofern Sie nicht mit fremden Dateinamen arbeiten, ist diese Methode in Ordnung. .IP "\fBunicode, unicodebom\fR" 4 .IX Item "unicode, unicodebom" Der Vorteil von Unicode (dem Windows-Namen für \s-1UTF\-16\s0) ist die üblicherweise korrekte Textdarstellung. Eine Änderung der aktiven Codepage ist nicht erforderlich. Sie müssen die Schriftart der Konsole auf eine TrueType-Schrift einstellen, damit internationale Zeichen richtig angezeigt werden können. Sollte ein Zeichen in einer TrueType-Schrift nicht enthalten sein, wird ein kleines Quadrat angezeigt, das gelegentlich noch ein Fragezeichen enthält. .Sp Wenn Sie die ConEmu-Konsole nutzen, wird der gesamte Text korrekt dargestellt, da ConEmu automatisch eine passende Schrift wählt. .Sp Nachteilig für Unicode ist, dass es nicht zu \s-1ASCII\s0 kompatibel ist. Die Ausgabe ist schwer zu verarbeiten, wenn sie in ein anderes Programm oder eine Datei weitergeleitet wird. .Sp Wenn die Methode \f(CW\*(C`unicodebom\*(C'\fR verwendet wird, dann wird dem Unicode-Text eine \s-1BOM \s0(Markierung der Bytereihenfolge) vorangestellt. Eine \s-1BOM\s0 ist ist für korrekte um\- oder Weiterleitung in der PowerShell notwendig. .IP "\fButf8, utf8bom\fR" 4 .IX Item "utf8, utf8bom" Der Vorteil von \s-1UTF\-8\s0 ist die ASCII\-Kompatibilität. Sie müssen die Schriftart der Konsole auf eine TrueType-Schrift setzen. Dadurch wird der Text ähnlich wie in der \f(CW\*(C`unicode\*(C'\fR\-Kodierung dargestellt. .Sp Der Nachteil ist die falsche Darstellung aller Nicht-ASCII-Zeichen, wenn Sie die Standard-Rasterschrift verwenden. Nicht nur Unicode-Dateinamen, sondern auch übersetzte Meldungen werden unlesbar. Auf einem Windows-System, das für eine ostasiatische Region eingerichtet wurde, wird die Konsole bei der Anzeige von Meldungen deutlich flackern. .Sp In einer ConEmu-Konsole funktioniert die UTF\-8\-Kodierung gut. .Sp Wenn die Methode \f(CW\*(C`utf8bom\*(C'\fR verwendet wird, dann wird dem UTF\-8\-Text eine \&\s-1BOM \s0(Markierung der Bytereihenfolge) vorangestellt. Eine \s-1BOM\s0 ist ist für korrekte um\- oder Weiterleitung in der PowerShell notwendig. .RE .RS 4 .Sp Die Standardkodierung kann durch Setzen der Umgebungsvariable \&\s-1DOS2UNIX_DISPLAY_ENC\s0 auf \f(CW\*(C`unicode\*(C'\fR, \f(CW\*(C`unicodebom\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR oder \f(CW\*(C`utf8\*(C'\fR geändert werden. .RE .IP "\fB\-f, \-\-force\fR" 4 .IX Item "-f, --force" erzwingt die Umwandlung von Binärdateien. .IP "\fB\-gb, \-\-gb18030\fR" 4 .IX Item "-gb, --gb18030" wandelt unter Windows UTF\-16\-Dateien standardmäßig in \s-1UTF\-8\s0 um, ungeachtet der Einstellung der Locale. Verwenden Sie diese Option zum umwandeln von Utf\-16\-Dateien in \s-1GB18030.\s0 Diese Option ist nur unter Windows verfügbar. Siehe auch Abschnitt \s-1GB18030.\s0 .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" zeigt eine Hilfe an und beendet das Programm. .IP "\fB\-i[\s-1SCHALTER\s0], \-\-info[=SCHALTER] \s-1DATEI\s0\fR" 4 .IX Item "-i[SCHALTER], --info[=SCHALTER] DATEI" zeigt Dateiinformationen an. Es wird keine Umwandlung vorgenommen. .Sp Die Ausgabe der Informationen geschieht in der folgenden Reihenfolge: Anzahl der DOS\-Zeilenumbrüche, Anzahl der Unix\-Zeilenumbrüche, Anzahl der Mac\-Zeilenumbrüche, Markierung der Bytereihenfolge, Text\- oder Binärformat, Dateiname. .Sp Beispielausgabe: .Sp .Vb 8 \& 6 0 0 no_bom text dos.txt \& 0 6 0 no_bom text unix.txt \& 0 0 6 no_bom text mac.txt \& 6 6 6 no_bom text mixed.txt \& 50 0 0 UTF\-16LE text utf16le.txt \& 0 50 0 no_bom text utf8unix.txt \& 50 0 0 UTF\-8 text utf8dos.txt \& 2 418 219 no_bom binary dos2unix.exe .Ve .Sp Beachten sie, dass manchmal eine Binärdatei fälschlicherweise als Textdatei erkannt wird. Siehe auch Option \f(CW\*(C`\-s\*(C'\fR. .Sp Optionale zusätzliche Schalter können gesetzt werden, um die Ausgabe anzupassen. Einer oder mehrere Schalter können hinzugefügt werden. .RS 4 .IP "\fBd\fR" 4 .IX Item "d" gibt die Anzahl der DOS\-Zeilenumbrüche aus. .IP "\fBu\fR" 4 .IX Item "u" gibt die Anzahl der Unix\-Zeilenumbrüche aus. .IP "\fBm\fR" 4 .IX Item "m" gibt die Anzahl der Mac\-Zeilenumbrüche aus. .IP "\fBb\fR" 4 .IX Item "b" gibt die Markierung der Bytereihenfolge aus. .IP "\fBt\fR" 4 .IX Item "t" zeigt an, ob es sich um eine Text\- oder eine Binärdatei handelt. .IP "\fBc\fR" 4 .IX Item "c" gibt nur die Dateien aus, die umgewandelt werden würden. .Sp Mit dem Schalter \f(CW\*(C`c\*(C'\fR gibt dos2unix nur die Dateien aus, die DOS\-Zeilenumbrüche enthalten, unix2dos nur die Dateien mit Unix\-Zeilenumbrüchen. .IP "\fBh\fR" 4 .IX Item "h" gibt eine Kopfzeile aus. .IP "\fBp\fR" 4 .IX Item "p" zeigt Dateinamen ohne Pfade an. .RE .RS 4 .Sp Beispiele: .Sp Informationen zu allen *.txt\-Dateien anzeigen: .Sp .Vb 1 \& dos2unix \-i *.txt .Ve .Sp Nur die Anzahl der DOS\-Zeilenumbrüche und Unix\-Zeilenumbrüche anzeigen: .Sp .Vb 1 \& dos2unix \-idu *.txt .Ve .Sp Nur die Markierung der Bytereihenfolge anzeigen: .Sp .Vb 1 \& dos2unix \-\-info=b *.txt .Ve .Sp Die Dateien auflisten, die DOS\-Zeilenumbrüche enthalten: .Sp .Vb 1 \& dos2unix \-ic *.txt .Ve .Sp Die Dateien auflisten, die Unix\-Zeilenumbrüche enthalten: .Sp .Vb 1 \& unix2dos \-ic *.txt .Ve .Sp Nur Dateien umwandeln, die DOS\-Zeilenumbrüche enthalten und die anderen Dateien unverändert belassen: .Sp .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .Sp Nach Textdateien suchen, die DOS\-Zeilenumbrüche enthalten: .Sp .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .RE .IP "\fB\-k, \-\-keepdate\fR" 4 .IX Item "-k, --keepdate" übernimmt den Zeitstempel der Eingabedatei in die Ausgabedatei. .IP "\fB\-L, \-\-license\fR" 4 .IX Item "-L, --license" zeigt die Lizenz des Programms an. .IP "\fB\-l, \-\-newline\fR" 4 .IX Item "-l, --newline" fügt eine zusätzliche neue Zeile hinzu. .Sp \&\fBdos2unix\fR: Nur DOS\-Zeilenumbrüche werden in Unix\-Zeilenumbrüche umgewandelt. Im Mac-Modus werden nur Mac\-Zeilenumbrüche in Unix\-Zeilenumbrüche umgewandelt. .Sp \&\fBunix2dos\fR: Nur Unix\-Zeilenumbrüche werden in DOS\-Zeilenumbrüche umgewandelt. Im Mac-Modus werden nur Unix\-Zeilenumbrüche in Mac\-Zeilenumbrüche umgewandelt. .IP "\fB\-m, \-\-add\-bom\fR" 4 .IX Item "-m, --add-bom" schreibt eine Markierung der Bytereihenfolge (\s-1BOM\s0) in die Ausgabedatei. In der Voreinstellung wird eine \s-1UTF\-8\-BOM\s0 geschrieben. .Sp Wenn die Eingabedatei in \s-1UTF\-16\s0 kodiert ist und die Option \f(CW\*(C`\-u\*(C'\fR verwendet wird, wird eine \s-1UTF\-16\-BOM\s0 geschrieben. .Sp Verwenden Sie diese Option niemals, wenn die Kodierung der Ausgabedatei nicht \s-1UTF\-8, UTF\-16\s0 oder \s-1GB 18030\s0 ist. Weitere Informationen finden Sie im Abschnitt \s-1UNICODE.\s0 .IP "\fB\-n, \-\-newfile \s-1EINGABEDATEI AUSGABEDATEI\s0 …\fR" 4 .IX Item "-n, --newfile EINGABEDATEI AUSGABEDATEI …" Neue-Datei-Modus. Die \s-1EINGABEDATEI\s0 wird umgewandelt und in die \s-1AUSGABEDATEI\s0 geschrieben. Die Dateinamen müssen paarweise angegeben werden. Platzhalter sollten \fInicht\fR verwendet werden, sonst werden Sie Ihre Dateien \&\fIverlieren\fR. .Sp Der Benutzer, der die Umwandlung im Neue-Datei-Modus startet, wird Besitzer der umgewandelten Datei. Die Lese\- und Schreibrechte werden aus den Zugriffsrechten der Originaldatei minus der \fIumask\fR\|(1) der Person ermittelt, die die Umwandlung ausgeführt hat. .IP "\fB\-o, \-\-oldfile \s-1DATEI\s0 …\fR" 4 .IX Item "-o, --oldfile DATEI …" Alte-Datei-Modus. Die \s-1DATEI\s0 wird umgewandelt und durch die Ausgabedatei überschrieben. Per Vorgabe werden Umwandlungen in diesem Modus ausgeführt. Platzhalter sind verwendbar. .Sp Im Alte-Datei-Modus (Ersetzungsmodus) erhalten die umgewandelten Dateien den gleichen Eigentümer, die gleiche Gruppe und die gleichen Lese\- und Schreibberechtigungen wie die Originaldatei, auch wenn die Datei von einem anderen Benutzer umgewandelt wird, der Schreibrechte für die Datei hat (zum Beispiel der Systemadministrator). Die Umwandlung wird abgebrochen, wenn es nicht möglich ist, die originalen Werte beizubehalten. Die Änderung des Eigentümers könnte zum Beispiel bewirken, dass der ursprüngliche Eigentümer die Datei nicht mehr lesen kann. Die Änderung der Gruppe könnte ein Sicherheitsrisiko sein, da die Datei vielleicht für Benutzer lesbar wird, für die sie nicht bestimmt ist. Die Beibehaltung von Eigentümer, Gruppe und Schreib\- und Leserechten wird nur unter Unix unterstützt. .IP "\fB\-q, \-\-quiet\fR" 4 .IX Item "-q, --quiet" Stiller Modus, in dem alle Warnungen und sonstige Meldungen unterdrückt werden. Der Rückgabewert ist 0, außer wenn fehlerhafte Befehlszeilenoptionen angegeben werden. .IP "\fB\-r, \-\-remove\-bom\fR" 4 .IX Item "-r, --remove-bom" entfernt die Markierung der Bytereihenfolge (\s-1BOM\s0). Es wird keine \s-1BOM\s0 in die Ausgabedatei geschrieben. Dies ist das Standardverhalten beim Umwandeln von Unix\-Zeilenumbrüchen. Siehe auch die Option \f(CW\*(C`\-b\*(C'\fR. .IP "\fB\-s, \-\-safe\fR" 4 .IX Item "-s, --safe" überspringt Binärdateien (Vorgabe). .Sp Binärdateien werden übersprungen, damit unerwünschtes Fehlverhalten vermieden wird. Denken Sie daran, dass die Erkennung nicht 100% sicher funktioniert. Die übergebenen Dateien werden auf Binärsymbole überprüft, die typischerweise in Textdateien nicht vorkommen. Es ist jedoch möglich, dass eine Binärdatei ausschließlich gewöhnliche Textzeichen enthält. Eine solche Binärdatei wird dann fälschlicherweise als Textdatei angesehen. .IP "\fB\-u, \-\-keep\-utf16\fR" 4 .IX Item "-u, --keep-utf16" erhält die originale UTF\-16\-Kodierung der Eingabedatei. Die Ausgabedatei wird in der gleichen UTF\-16\-Kodierung geschrieben (Little\-Endian\- oder Big-Endian-Bytereihenfolge) wie die Eingabedatei. Dies verhindert die Umwandlung in \s-1UTF\-8.\s0 Eine \s-1UTF\-16\-BOM\s0 wird dementsprechend geschrieben. Diese Option kann durch Angabe der Option \f(CW\*(C`\-ascii\*(C'\fR deaktiviert werden. .IP "\fB\-ul, \-\-assume\-utf16le\fR" 4 .IX Item "-ul, --assume-utf16le" nimmt an, dass die Eingabedatei das Format \s-1UTF\-16LE\s0 hat. .Sp Wenn die Eingabedatei eine Markierung der Bytereihenfolge enthält (\s-1BOM\s0), dann hat die \s-1BOM\s0 Vorrang vor dieser Option. .Sp Durch eine falsche Annahme (die Eingabedatei war nicht in \s-1UTF\-16LE\s0 kodiert) mit erfolgreicher Umwandlung erhalten Sie eine UTF\-8\-Ausgabedatei mit fehlerhaftem Text. Sie können die fehlgeschlagene Umwandlung mit \fIiconv\fR\|(1) rückgängig machen, indem Sie die Rückumwandlung von \s-1UTF\-8\s0 nach \s-1UTF\-16LE\s0 vornehmen. Dadurch gewinnen Sie die Originaldatei zurück. .Sp Die Annahme von \s-1UTF\-16LE\s0 wirkt wie ein \fIUmwandlungsmodus\fR. Beim Wechsel zum vorgegebenen \fIascii\fR\-Modus wird die UTF16LE\-Annahme deaktiviert. .IP "\fB\-ub, \-\-assume\-utf16be\fR" 4 .IX Item "-ub, --assume-utf16be" nimmt an, dass die Eingabedatei das Format \s-1UTF\-16BE\s0 hat. .Sp Diese Option ist gleichbedeutend mit \f(CW\*(C`\-ul\*(C'\fR. .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" zeigt ausführliche Meldungen an. Zusätzliche Informationen werden zu den Markierungen der Bytereihenfolge (\s-1BOM\s0) und zur Anzahl der umgewandelten Zeilenumbrüche angezeigt. .IP "\fB\-F, \-\-follow\-symlink\fR" 4 .IX Item "-F, --follow-symlink" folgt symbolischen Links und wandelt die Zieldateien um. .IP "\fB\-R, \-\-replace\-symlink\fR" 4 .IX Item "-R, --replace-symlink" ersetzt symbolische Links durch die umgewandelten Dateien (die originalen Zieldateien bleiben unverändert). .IP "\fB\-S, \-\-skip\-symlink\fR" 4 .IX Item "-S, --skip-symlink" erhält symbolische Links als solche und lässt die Ziele unverändert (Vorgabe). .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" zeigt Versionsinformationen an und beendet das Programm. .SH "MAC-MODUS" .IX Header "MAC-MODUS" Im Normalmodus werden Zeilenumbrüche von \s-1DOS\s0 nach Unix und umgekehrt umgewandelt. Mac\-Zeilenumbrüche werden nicht verändert. .PP Im Mac-Modus werden Zeilenumbrüche von Mac nach Unix und umgekehrt umgewandelt. DOS\-Zeilenumbrüche werden nicht verändert. .PP Um das Programm im Mac-Modus auszuführen, verwenden Sie die Befehlszeilenoption \f(CW\*(C`\-c mac\*(C'\fR oder die Befehle \f(CW\*(C`mac2unix\*(C'\fR oder \f(CW\*(C`unix2mac\*(C'\fR. .SH "UMWANDLUNGSMODI" .IX Header "UMWANDLUNGSMODI" .IP "\fBascii\fR" 4 .IX Item "ascii" Im \f(CW\*(C`ascii\*(C'\fR\-Modus werden nur Zeilenumbrüche umgewandelt. Dies ist der vorgegebene Umwandlungsmodus. .Sp Obwohl der Name dieses Modus auf \s-1ASCII\s0 hinweist, welches ein 7\-bit\-Standard ist, bezieht sich der eigentliche Modus auf 8 Bit. Verwenden Sie diesen Modus immer dann, wenn Sie Unicode-Dateien in UTF\-8\-Kodierung umwandeln. .IP "\fB7bit\fR" 4 .IX Item "7bit" In diesem Modus werden alle Nicht-ASCII-Zeichen aus 8 Bit in das 7\-Bit\-Bitmuster umgewandelt. .IP "\fBiso\fR" 4 .IX Item "iso" Die Zeichen werden aus dem DOS-Zeichensatz (der Codepage) in den ISO-Zeichensatz \s-1ISO\-8859\-1 \s0(Latin\-1) in Unix umgewandelt. DOS-Zeichen ohne Äquivalent in \s-1ISO\-8859\-1,\s0 für die die Umwandlung nicht möglich ist, werden durch einen Punkt ersetzt. Gleiches gilt für ISO\-8859\-1\-Zeichen ohne DOS\-Gegenstück. .Sp Wenn nur die Option \f(CW\*(C`\-iso\*(C'\fR angegeben ist, versucht dos2unix die aktive Codepage selbst zu ermitteln. Sollte dies nicht möglich sein, wird die Standard-Codepage \s-1CP437\s0 verwendet, welche hauptsächlich in den \s-1USA\s0 eingesetzt wird. Um eine bestimmte Codepage zu erzwingen, verwenden Sie die Optionen \f(CW\*(C`\-437\*(C'\fR (\s-1US\s0), \f(CW\*(C`\-850\*(C'\fR (Westeuropäisch), \f(CW\*(C`\-860\*(C'\fR (Portugiesisch), \&\f(CW\*(C`\-863\*(C'\fR (Kanadisches Französisch) oder \f(CW\*(C`\-865\*(C'\fR (Skandinavisch). Die Windows-Codepage \s-1CP1252 \s0(Westeuropäisch) wird durch die Option \f(CW\*(C`\-1252\*(C'\fR unterstützt. .Sp Wenden Sie niemals die ISO-Umwandlung auf Unicode-Textdateien an. In \s-1UTF\-8\s0 kodierte Dateien werden dadurch beschädigt. .Sp Einige Beispiele: .Sp Umwandlung aus der vorgegebenen DOS-Codepage nach Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-iso \-n in.txt ausgabe.txt .Ve .Sp Umwandlung von \s-1DOS CP850\s0 nach Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-850 \-n eingabe.txt ausgabe.txt .Ve .Sp Umwandlung von Windows \s-1CP1252\s0 nach Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-1252 \-n eingabe.txt ausgabe.txt .Ve .Sp Umwandlung von Windows \s-1CP1252\s0 nach Unix \s-1UTF\-8 \s0(Unicode): .Sp .Vb 1 \& iconv \-f CP1252 \-t UTF\-8 eingabe.txt | dos2unix > ausgabe.txt .Ve .Sp Umwandlung von Unix Latin\-1 in die vorgegebene DOS-Codepage: .Sp .Vb 1 \& unix2dos \-iso \-n eingabe.txt ausgabe.txt .Ve .Sp Umwandlung von Unix Latin\-1 nach \s-1DOS CP850:\s0 .Sp .Vb 1 \& unix2dos \-850 \-n eingabe.txt ausgabe.txt .Ve .Sp Umwandlung von Unix Latin\-1 nach Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos \-1252 \-n eingabe.txt ausgabe.txt .Ve .Sp Umwandlung von Unix \s-1UTF\-8 \s0(Unicode) nach Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos < eingabe.txt | iconv \-f UTF\-8 \-t CP1252 > ausgabe.txt .Ve .Sp Siehe auch und . .SH "UNICODE" .IX Header "UNICODE" .SS "Zeichenkodierungen" .IX Subsection "Zeichenkodierungen" Es gibt verschiedene Unicode-Zeichenkodierungen. Unter Unix und Linux sind Unicode-Dateien typischerweise in \s-1UTF\-8\s0 kodiert. Unter Windows können Textdateien in \s-1UTF\-8, UTF\-16\s0 oder \s-1UTF\-16\s0 in Big-Endian-Bytereihenfolge kodiert sein, liegen aber meist im Format \s-1UTF\-16\s0 vor. .SS "Umwandlung" .IX Subsection "Umwandlung" Unicode-Textdateien können \s-1DOS\-,\s0 Unix\- oder Mac\-Zeilenumbrüche enthalten, so wie reguläre Textdateien. .PP Alle Versionen von dos2unix und unix2dos können UTF\-8\-kodierte Dateien umwandeln, weil \s-1UTF\-8\s0 im Hinblick auf Abwärtskompatiblität mit \s-1ASCII\s0 entwickelt wurde. .PP Dos2unix und unix2dos mit Unterstützung für \s-1UTF\-16\s0 können in \s-1UTF\-16\s0 kodierte Dateien in Little\-Endian\- und Big-Endian-Bytereihenfolge lesen. Um festzustellen, ob dos2unix mit UTF\-16\-Unterstützung kompiliert wurde, geben Sie \f(CW\*(C`dos2unix \-V\*(C'\fR ein. .PP Unter Unix/Linux werden \s-1UTF\-16\s0 kodierte Dateien standardmäßig in die Zeichenkodierung entsprechend der Locale umgewandelt. Mit dem Befehl \&\fIlocale\fR\|(1) können Sie herausfinden, wie die Zeichenkodierung der Locale eingestellt ist. Wenn eine Umwandlung nicht möglich ist, verursacht dies einen Umwandlungsfehler, wodurch die Datei übersprungen wird. .PP Unter Windows werden UTF\-16\-Dateien standardmäßig in \s-1UTF\-8\s0 umgewandelt. In \&\s-1UTF\-8\s0 formatierte Textdateien werden von Windows und Unix/Linux gleichermaßen unterstützt. .PP Die Kodierungen \s-1UTF\-16\s0 und \s-1UTF\-8\s0 sind vollständig kompatibel, daher wird bei der Umwandlung keinerlei Text verlorengehen. Sollte bei der Umwandlung von \&\s-1UTF\-16\s0 in \s-1UTF\-8\s0 ein Problem auftreten, beispielsweise wenn die UTF\-16\-kodierte Eingabedatei einen Fehler enthält, dann wird diese Datei übersprungen. .PP Wenn die Option \f(CW\*(C`\-u\*(C'\fR verwendet wird, wird die Ausgabedatei in der gleichen UTF\-16\-Kodierung wie die Eingabedatei geschrieben. Die Option \f(CW\*(C`\-u\*(C'\fR verhindert die Umwandlung in \s-1UTF\-8.\s0 .PP Dos2unix und unix2dos bieten keine Option zur Umwandlung von UTF\-8\-Dateien in \s-1UTF\-16.\s0 .PP Umwandlungen im \s-1ISO\-\s0 und 7bit\-Modus funktionieren mit UTF\-16\-Dateien nicht. .SS "Markierung der Bytereihenfolge" .IX Subsection "Markierung der Bytereihenfolge" Unicode-Textdateien unter Windows haben typischerweise eine Markierung der Bytereihenfolge (\s-1BOM\s0), da viele Windows-Programme (zum Beispiel Notepad) solche BOMs standardmäßig hinzufügen. Weitere Informationen hierzu finden Sie auf . .PP Unter Unix haben Textdateien üblicherweise keine \s-1BOM.\s0 Es wird stattdessen angenommen, dass Textdateien in der Zeichenkodierung entsprechend der Spracheinstellung vorliegen. .PP Dos2unix kann nur dann erkennen, ob eine Datei UTF\-16\-kodiert ist, wenn die Datei eine \s-1BOM\s0 enthält. Ist dies nicht der Fall, nimmt dos2unix an, dass es sich um eine Binärdatei handelt. .PP Verwenden Sie die Optionen \f(CW\*(C`\-ul\*(C'\fR oder \f(CW\*(C`\-ub\*(C'\fR, um eine UTF\-16\-Datei ohne \s-1BOM\s0 umzuwandeln. .PP Dos2unix schreibt in der Voreinstellung keine \s-1BOM\s0 in die Ausgabedatei. Mit der Option \f(CW\*(C`\-b\*(C'\fR schreibt Dos2unix eine \s-1BOM,\s0 wenn die Eingabedatei ebenfalls eine \s-1BOM\s0 hat. .PP Unix2dos schreibt in der Voreinstellung eine \s-1BOM\s0 in die Ausgabedatei, wenn die Eingabedatei ebenfalls eine solche Markierung hat. Verwenden Sie die Option \f(CW\*(C`\-r\*(C'\fR, um die \s-1BOM\s0 zu entfernen. .PP Dos2unix und unix2dos schreiben immer eine \s-1BOM,\s0 wenn die Option \f(CW\*(C`\-m\*(C'\fR angegeben ist. .SS "Unicode-Dateinamen unter Windows" .IX Subsection "Unicode-Dateinamen unter Windows" Dos2unix verfügt über optionale Unterstützung für das Lesen und Schreiben von Unicode-Dateinamen in der Windows-Eingabeaufforderung. Dadurch kann dos2unix Dateien öffnen, deren Namen Zeichen enthalten, die nicht zur Standard-ANSI-Codepage des Systems gehören. Geben Sie \f(CW\*(C`dos2unix \-V\*(C'\fR ein, um zu sehen, ob dos2unix für Windows mit Unterstützung für Unicode-Dateinamen erstellt wurde. .PP Die Anzeige von Unicode-Dateinamen in einer Windows-Konsole ist gelegentlich nicht fehlerfrei, siehe die Option \f(CW\*(C`\-D\*(C'\fR, \f(CW\*(C`\-\-display\-enc\*(C'\fR. Die Dateinamen können falsch dargestellt werden, allerdings werden die Dateien mit deren korrekten Namen gespeichert. .SS "Unicode-Beispiele" .IX Subsection "Unicode-Beispiele" Umwandlung von Windows \s-1UTF\-16 \s0(mit \s-1BOM\s0) nach Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-n eingabe.txt ausgabe.txt .Ve .PP Umwandlung von Windows \s-1UTF\-16LE \s0(ohne \s-1BOM\s0) nach Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-ul \-n eingabe.txt ausgabe.txt .Ve .PP Umwandlung von Unix \s-1UTF\-8\s0 nach Windows \s-1UTF\-8\s0 mit \s-1BOM:\s0 .PP .Vb 1 \& unix2dos \-m \-n eingabe.txt ausgabe.txt .Ve .PP Umwandlung von Unix \s-1UTF\-8\s0 nach Windows \s-1UTF\-16:\s0 .PP .Vb 1 \& unix2dos < eingabe.txt | iconv \-f UTF\-8 \-t UTF\-16 > ausgabe.txt .Ve .SH "GB18030" .IX Header "GB18030" \&\s-1GB18030\s0 ist ein Standard der chinesischen Regierung. Eine Teilmenge des in \&\s-1GB18030\s0 definierten Standards ist offiziell für alle in China verkauften Softwareprodukte vorgeschrieben. Siehe auch . .PP \&\s-1GB18030\s0 ist vollständig zu Unicode kompatibel und kann als Unicode-Umwandlungsformat betrahctet werden. Wie auch \s-1UTF\-8\s0 ist \s-1GB18030\s0 kompatibel zu \s-1ASCII.\s0 Ebenfalls kompatibel ist es zur Codepage 936 von Windows, auch als \s-1GBK\s0 bekannt. .PP Unter Unix/Linux werden UTF\-16\-Dateien in \s-1GB18030\s0 umgewandelt, wenn die Einstellung der Locale auf \s-1GB18030\s0 gesetzt ist. Beachten Sie, dass dies nur funktioniert, wenn die Locale vom System unterstützt wird. Mit dem Befehl \&\f(CW\*(C`locale \-a\*(C'\fR erhalten Sie eine Liste der unterstützten Locales. .PP Unter Windows benötigen Sie die Option \f(CW\*(C`\-gb\*(C'\fR, um UTF\-16\-Dateien in \s-1GB18030\s0 umwandeln zu können. .PP In \s-1GB 18030\s0 kodierte Dateien haben wie Unicode-Dateien eine Markierung der Bytereihenfolge (\s-1BOM\s0). .SH "BEISPIELE" .IX Header "BEISPIELE" Aus der Standardeingabe lesen und in die Standardausgabe schreiben: .PP .Vb 2 \& dos2unix < a.txt \& cat a.txt | dos2unix .Ve .PP a.txt umwandeln und ersetzen, b.txt umwandeln und ersetzen: .PP .Vb 2 \& dos2unix a.txt b.txt \& dos2unix \-o a.txt b.txt .Ve .PP a.txt im ascii-Modus umwandeln und ersetzen: .PP .Vb 1 \& dos2unix a.txt .Ve .PP a.txt im ascii-Modus umwandeln und ersetzen, b.txt im 7bit\-Modus umwandeln und ersetzen: .PP .Vb 3 \& dos2unix a.txt \-c 7bit b.txt \& dos2unix \-c ascii a.txt \-c 7bit b.txt \& dos2unix \-ascii a.txt \-7 b.txt .Ve .PP a.txt aus dem Mac\- in das Unix-Format umwandeln: .PP .Vb 2 \& dos2unix \-c mac a.txt \& mac2unix a.txt .Ve .PP a.txt aus dem Unix\- in das Mac-Format umwandeln: .PP .Vb 2 \& unix2dos \-c mac a.txt \& unix2mac a.txt .Ve .PP a.txt unter Beibehaltung des ursprünglichen Zeitstempels umwandeln: .PP .Vb 2 \& dos2unix \-k a.txt \& dos2unix \-k \-o a.txt .Ve .PP a.txt umwandeln und das Ergebnis nach e.txt schreiben: .PP .Vb 1 \& dos2unix \-n a.txt e.txt .Ve .PP a.txt umwandeln und das Ergebnis nach e.txt schreiben, wobei e.txt den gleichen Zeitstempel erhält wie a.txt: .PP .Vb 1 \& dos2unix \-k \-n a.txt e.txt .Ve .PP a.txt umwandeln und ersetzen, b.txt umwandeln und das Ergebnis nach e.txt schreiben: .PP .Vb 2 \& dos2unix a.txt \-n b.txt e.txt \& dos2unix \-o a.txt \-n b.txt e.txt .Ve .PP c.txt umwandeln und das Ergebnis nach e.txt schreiben, a.txt umwandeln und ersetzen, b.txt umwandeln und ersetzen, d.txt umwandeln und das Ergebnis nach f.txt schreiben: .PP .Vb 1 \& dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt .Ve .SH "REKURSIVE UMWANDLUNG" .IX Header "REKURSIVE UMWANDLUNG" Verwenden Sie dos2unix zusammen mit den Befehlen \fIfind\fR\|(1) und \fIxargs\fR\|(1), um Textdateien in einem Verzeichnisbaum rekursiv umzuwandeln. Um beispielsweise alle *.txt\-Dateien im aktuellen Verzeichnis und dessen Unterverzeichnissen umzuwandeln, geben Sie Folgendes ein: .PP .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .PP In einer Eingabeaufforderung kann der folgende Befehl verwendet werden: .PP .Vb 1 \& for /R %G in (*.txt) do dos2unix "%G" .Ve .PP In der Windows PowerShell können Sie folgenden Befehl verwenden: .PP .Vb 1 \& get\-childitem \-path . \-filter \*(Aq*.txt\*(Aq \-recurse | foreach\-object {dos2unix $_.Fullname} .Ve .SH "LOKALISIERUNG" .IX Header "LOKALISIERUNG" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" Die primäre Sprache wird durch die Umgebungsvariable \s-1LANG\s0 festgelegt. Diese Variable besteht aus mehreren Teilen: Der erste Teil besteht aus zwei Kleinbuchstaben, die den Sprachcode angeben. Der zweite Teil ist optional und bezeichnet den Ländercode in Großbuchstaben, vom davor stehenden Sprachcode durch einen Unterstrich getrennt. Der dritte Teil ist ebenfalls optional und gibt die Zeichenkodierung an, vom Ländercode durch einen Punkt getrennt. Einige Beispiele für Standard-POSIX-Shells: .Sp .Vb 7 \& export LANG=de Deutsch \& export LANG=de_DE Deutsch, Deutschland \& export LANG=de_AT Deutsch, Österreich \& export LANG=es_ES Spanisch, Spanien \& export LANG=es_MX Spanisch, Mexiko \& export LANG=en_US.iso88591 Englisch, USA, Latin\-1\-Zeichenkodierung \& export LANG=en_GB.UTF\-8 Englisch, GB, UTF\-8\-Zeichenkodierung .Ve .Sp Eine vollständige Liste der Sprachen und Ländercodes finden Sie im Gettext-Handbuch: .Sp Auf Unix-Systemen erhalten Sie mit dem Befehl \fIlocale\fR\|(1) spezifische Informationen zu den Spracheinstellungen. .IP "\fB\s-1LANGUAGE\s0\fR" 4 .IX Item "LANGUAGE" Mit der Umgebungsvariable \s-1LANGUAGE\s0 können Sie eine Prioritätenliste für Sprachen übergeben, die Sie durch Doppelpunkte voneinander trennen. Dos2unix gibt \s-1LANGUAGE\s0 vor \s-1LANG\s0 den Vorzug, zum Beispiel bei Deutsch vor Niederländisch: \f(CW\*(C`LANGUAGE=de:nl\*(C'\fR. Sie müssen zunächst die Lokalisierung aktivieren, indem Sie die Variable \s-1LANG \s0(oder \s-1LC_ALL\s0) auf einen anderen Wert als »C« setzen, bevor Sie die Liste der Sprachprioritäten mit der Variable \&\s-1LANGUAGE\s0 nutzen können. Weitere Informationen finden Sie im Gettext-Handbuch: .Sp Falls Sie eine Sprache auswählen, die nicht verfügbar ist, erhalten Sie die Standardmeldungen in englischer Sprache. .IP "\fB\s-1DOS2UNIX_LOCALEDIR\s0\fR" 4 .IX Item "DOS2UNIX_LOCALEDIR" Durch die Umgebungsvariable \s-1DOS2UNIX_LOCALEDIR\s0 wird \s-1LOCALEDIR\s0 während der Kompilierung übergangen. \s-1LOCALEDIR\s0 wird verwendet, um Sprachdateien zu finden. Der GNU-Standardwert ist \f(CW\*(C`/usr/local/share/locale\*(C'\fR. Die Option \&\fB\-\-version\fR zeigt das verwendete \s-1LOCALEDIR\s0 an. .Sp Beispiel (POSIX-Shell): .Sp .Vb 1 \& export DOS2UNIX_LOCALEDIR=$HOME/share/locale .Ve .SH "RÜCKGABEWERT" .IX Header "RÜCKGABEWERT" Bei Erfolg wird 0 zurückgegeben. Bei aufgetretenen Systemfehlern wird der letzte Systemfehler zurückgegeben. Für alle anderen Fehler wird 1 zurückgegeben. .PP Der Rückgabewert ist im stillen Modus stets 0, außer wenn fehlerhafte Befehlszeilenoptionen verwendet werden. .SH "STANDARDS" .IX Header "STANDARDS" .PP .PP .PP .SH "AUTOREN" .IX Header "AUTOREN" Benjamin Lin \- , Bernd Johannes Wuebben (Mac2unix\-Modus) \- , Christian Wurll (Extra Zeilenumbruch) \&\- , Erwin Waterlander \- (Betreuer) .PP Projektseite: .PP SourceForge-Seite: .SH "SIEHE AUCH" .IX Header "SIEHE AUCH" \&\fIfile\fR\|(1) \fIfind\fR\|(1) \fIiconv\fR\|(1) \fIlocale\fR\|(1) \fIxargs\fR\|(1) dos2unix-7.3.4/man/de/man1/dos2unix.htm0000644000175500010010000011015412721132573017040 0ustar waterlanGeen dos2unix 7.3.4 - Formatumwandlung für Textdateien von DOS/Mac nach Unix und umgekehrt

BEZEICHNUNG

dos2unix - Formatumwandlung für Textdateien von DOS/Mac nach Unix und umgekehrt

ÜBERSICHT

    dos2unix [Optionen] [DATEI …] [-n EINGABEDATEI AUSGABEDATEI …]
    unix2dos [Optionen] [DATEI …] [-n EINGABEDATEI AUSGABEDATEI …]

BESCHREIBUNG

Das Paket Dos2unix enthält die Werkzeuge dos2unix und unix2dos zum Umwandeln einfacher Textdateien aus dem DOS- oder Mac-Format in das Unix-Format und umgekehrt.

In Textdateien unter DOS/Windows sind Zeilenumbrüche, auch als neue Zeile (NL) bekannt, eine Kombination aus zwei Zeichen: einem Wagenrücklauf (Carriage Return, CR) gefolgt von einem Zeilenvorschub (Line Feed, LF). In Unix-Textdateien bestehen Zeilenumbrüche nur aus einem Zeichen, dem Zeilenvorschub (LF). In Mac-Textdateien aus der Zeit vor MacOSX bestand ein Zeilenumbruch aus einem einzelnen CR-Zeichen. Heute verwendet Mac OS Zeilenumbrüche im Unix-Stil (LF).

Neben Zeilenumbrüchen kann Dos2unix auch die Zeichenkodierung von Dateien umwandeln. Einige DOS-Codepages können in Unix Latin-1 umgewandelt werden, und Windows-Unicode-Dateien (UTF-16) können in Unix-Unicode-Dateien (UTF-8) umgewandelt werden.

Binärdateien werden automatisch übersprungen, sofern die Umwandlung nicht erzwungen wird.

Nicht-reguläre Dateien, wie Verzeichnisse und FIFOS (Weiterleitungen) werden automatisch übersprungen.

Symbolische Links und deren Ziele werden per Vorgabe unverändert belassen. Symbolische Links können optional ersetzt werden, oder die Ausgabe wird in das Ziel des symbolischen Links geschrieben. Unter Windows wird das Schreiben in das Ziel eines symbolischen Links nicht unterstützt.

Dos2unix wurde nach dem Vorbild der dos2unix-Version unter SunOS/Solaris entwickelt, doch es gibt einen wesentlichen Unterschied zum Original: Diese Version ersetzt per Vorgabe Dateien bei der Umwandlung (Alte-Datei-Modus), während unter SunOS/Solaris nur die paarweise Umwandlung (Neue-Datei-Modus) unterstützt wird. Siehe dazu die Optionen -o und -n. Ein weiterer Unterschied ist, dass die SunOS/Solaris-Version in der Voreinstellung die Umwandlung im iso-Modus vornimmt, während diese Version den ascii-Modus verwendet.

OPTIONEN

--

nimmt alle folgenden Optionen als Dateinamen an. Verwenden Sie diese Option, wenn Sie Dateien umwandeln wollen, deren Namen mit einem Minuszeichen beginnen. Um beispielsweise eine Datei namens »-bla« umzuwandeln, können Sie folgenden Befehl verwenden:

    dos2unix -- -bla

oder im Neue-Datei-Modus:

    dos2unix -n -- -bla ausgabe.txt
-ascii

wandelt nur Zeilenumbrüche um. Dies ist der vorgegebene Umwandlungsmodus.

-iso

wandelt aus dem DOS- in den ISO-8859-1-Zeichensatz um. Weitere Informationen hierzu finden Sie im Abschnitt UMWANDLUNGSMODI.

-1252

verwendet die Windows-Codepage 1252 (Westeuropäisch).

-437

verwendet die DOS-Codepage 437 (US). Dies ist die vorgegebene Codepage für die ISO-Umwandlung.

-850

verwendet die DOS-Codepage 850 (Westeuropäisch).

-860

verwendet die DOS-Codepage 860 (Portugiesisch).

-863

verwendet die DOS-Codepage 863 (Kanadisches Französisch).

-865

verwendet die DOS-Codepage 865 (Skandinavisch).

-7

wandelt 8bit-Zeichen in ein 7bit-Bitmuster um.

-b, --keep-bom

erhält die Markierung der Bytereihenfolge (BOM). Wenn die Eingabedatei eine BOM enthält, wird ebenfalls eine BOM in die Ausgabedatei geschrieben. Dies ist das Standardverhalten beim Umwandeln von DOS-Zeilenumbrüchen. Siehe auch die Option -r.

-c, --convmode UMWANDLUNGSMODUS

legt den Umwandlungsmodus fest. UMWANDLUNGSMODUS kann ascii, 7bit, iso oder mac sein, wobei ascii die Vorgabe ist.

-D, --display-enc KODIERUNG

legt die Kodierung des angezeigten Texts fest. KODIERUNG kann ansi, unicode, unicodebom, utf8 oder <utf8bom> sein, wobei ansi die Vorgabe ist.

Diese Option ist nur in dos2unix für Windows mit Unterstützung für Unicode-Dateinamen verfügbar. Sie bleibt wirkungslos, wenn die tatsächlichen Dateinamen gelesen und geschrieben werden, lediglich bei der Darstellung wird sie berücksichtigt.

Es gibt verschiedene Möglichkeiten, Text in einer Windows-Konsole basierend auf dessen Kodierung darzustellen. Alle haben verschiedene Vor- und Nachteile.

ansi

Die Standardmethode von dos2unix ist die Verwendung von ANSI-kodiertem Text, der Vorteil ist deren Abwärtskompatibilität. Dies funktioniert mit Raster- und TrueType-Schriften. In manchen Gebieten müssen Sie mit dem Befehl chcp die aktive DOS-OEM-Codepage in die -System-ANSI-Codepage des Systems ändern, da dos2unix Letztere verwendet.

Der Nachteil von ANSI ist, dass internationale Dateinamen nicht korrekt dargestellt werden, wenn darin Zeichen enthalten sind, die nicht in der im System voreingestellten Codepage enthalten sind. Stattdessen wird entweder ein Fragezeichen oder ein falsches Zeichen angezeigt. Sofern Sie nicht mit fremden Dateinamen arbeiten, ist diese Methode in Ordnung.

unicode, unicodebom

Der Vorteil von Unicode (dem Windows-Namen für UTF-16) ist die üblicherweise korrekte Textdarstellung. Eine Änderung der aktiven Codepage ist nicht erforderlich. Sie müssen die Schriftart der Konsole auf eine TrueType-Schrift einstellen, damit internationale Zeichen richtig angezeigt werden können. Sollte ein Zeichen in einer TrueType-Schrift nicht enthalten sein, wird ein kleines Quadrat angezeigt, das gelegentlich noch ein Fragezeichen enthält.

Wenn Sie die ConEmu-Konsole nutzen, wird der gesamte Text korrekt dargestellt, da ConEmu automatisch eine passende Schrift wählt.

Nachteilig für Unicode ist, dass es nicht zu ASCII kompatibel ist. Die Ausgabe ist schwer zu verarbeiten, wenn sie in ein anderes Programm oder eine Datei weitergeleitet wird.

Wenn die Methode unicodebom verwendet wird, dann wird dem Unicode-Text eine BOM (Markierung der Bytereihenfolge) vorangestellt. Eine BOM ist ist für korrekte um- oder Weiterleitung in der PowerShell notwendig.

utf8, utf8bom

Der Vorteil von UTF-8 ist die ASCII-Kompatibilität. Sie müssen die Schriftart der Konsole auf eine TrueType-Schrift setzen. Dadurch wird der Text ähnlich wie in der unicode-Kodierung dargestellt.

Der Nachteil ist die falsche Darstellung aller Nicht-ASCII-Zeichen, wenn Sie die Standard-Rasterschrift verwenden. Nicht nur Unicode-Dateinamen, sondern auch übersetzte Meldungen werden unlesbar. Auf einem Windows-System, das für eine ostasiatische Region eingerichtet wurde, wird die Konsole bei der Anzeige von Meldungen deutlich flackern.

In einer ConEmu-Konsole funktioniert die UTF-8-Kodierung gut.

Wenn die Methode utf8bom verwendet wird, dann wird dem UTF-8-Text eine BOM (Markierung der Bytereihenfolge) vorangestellt. Eine BOM ist ist für korrekte um- oder Weiterleitung in der PowerShell notwendig.

Die Standardkodierung kann durch Setzen der Umgebungsvariable DOS2UNIX_DISPLAY_ENC auf unicode, unicodebom, utf8 oder utf8 geändert werden.

-f, --force

erzwingt die Umwandlung von Binärdateien.

-gb, --gb18030

wandelt unter Windows UTF-16-Dateien standardmäßig in UTF-8 um, ungeachtet der Einstellung der Locale. Verwenden Sie diese Option zum umwandeln von Utf-16-Dateien in GB18030. Diese Option ist nur unter Windows verfügbar. Siehe auch Abschnitt GB18030.

-h, --help

zeigt eine Hilfe an und beendet das Programm.

-i[SCHALTER], --info[=SCHALTER] DATEI

zeigt Dateiinformationen an. Es wird keine Umwandlung vorgenommen.

Die Ausgabe der Informationen geschieht in der folgenden Reihenfolge: Anzahl der DOS-Zeilenumbrüche, Anzahl der Unix-Zeilenumbrüche, Anzahl der Mac-Zeilenumbrüche, Markierung der Bytereihenfolge, Text- oder Binärformat, Dateiname.

Beispielausgabe:

     6       0       0  no_bom    text    dos.txt
     0       6       0  no_bom    text    unix.txt
     0       0       6  no_bom    text    mac.txt
     6       6       6  no_bom    text    mixed.txt
    50       0       0  UTF-16LE  text    utf16le.txt
     0      50       0  no_bom    text    utf8unix.txt
    50       0       0  UTF-8     text    utf8dos.txt
     2     418     219  no_bom    binary  dos2unix.exe

Beachten sie, dass manchmal eine Binärdatei fälschlicherweise als Textdatei erkannt wird. Siehe auch Option -s.

Optionale zusätzliche Schalter können gesetzt werden, um die Ausgabe anzupassen. Einer oder mehrere Schalter können hinzugefügt werden.

d

gibt die Anzahl der DOS-Zeilenumbrüche aus.

u

gibt die Anzahl der Unix-Zeilenumbrüche aus.

m

gibt die Anzahl der Mac-Zeilenumbrüche aus.

b

gibt die Markierung der Bytereihenfolge aus.

t

zeigt an, ob es sich um eine Text- oder eine Binärdatei handelt.

c

gibt nur die Dateien aus, die umgewandelt werden würden.

Mit dem Schalter c gibt dos2unix nur die Dateien aus, die DOS-Zeilenumbrüche enthalten, unix2dos nur die Dateien mit Unix-Zeilenumbrüchen.

h

gibt eine Kopfzeile aus.

p

zeigt Dateinamen ohne Pfade an.

Beispiele:

Informationen zu allen *.txt-Dateien anzeigen:

    dos2unix -i *.txt

Nur die Anzahl der DOS-Zeilenumbrüche und Unix-Zeilenumbrüche anzeigen:

    dos2unix -idu *.txt

Nur die Markierung der Bytereihenfolge anzeigen:

    dos2unix --info=b *.txt

Die Dateien auflisten, die DOS-Zeilenumbrüche enthalten:

    dos2unix -ic *.txt

Die Dateien auflisten, die Unix-Zeilenumbrüche enthalten:

    unix2dos -ic *.txt

Nur Dateien umwandeln, die DOS-Zeilenumbrüche enthalten und die anderen Dateien unverändert belassen:

    find . -name '*.txt' |xargs dos2unix

Nach Textdateien suchen, die DOS-Zeilenumbrüche enthalten:

    find . -name '*.txt' |xargs dos2unix
-k, --keepdate

übernimmt den Zeitstempel der Eingabedatei in die Ausgabedatei.

-L, --license

zeigt die Lizenz des Programms an.

-l, --newline

fügt eine zusätzliche neue Zeile hinzu.

dos2unix: Nur DOS-Zeilenumbrüche werden in Unix-Zeilenumbrüche umgewandelt. Im Mac-Modus werden nur Mac-Zeilenumbrüche in Unix-Zeilenumbrüche umgewandelt.

unix2dos: Nur Unix-Zeilenumbrüche werden in DOS-Zeilenumbrüche umgewandelt. Im Mac-Modus werden nur Unix-Zeilenumbrüche in Mac-Zeilenumbrüche umgewandelt.

-m, --add-bom

schreibt eine Markierung der Bytereihenfolge (BOM) in die Ausgabedatei. In der Voreinstellung wird eine UTF-8-BOM geschrieben.

Wenn die Eingabedatei in UTF-16 kodiert ist und die Option -u verwendet wird, wird eine UTF-16-BOM geschrieben.

Verwenden Sie diese Option niemals, wenn die Kodierung der Ausgabedatei nicht UTF-8, UTF-16 oder GB 18030 ist. Weitere Informationen finden Sie im Abschnitt UNICODE.

-n, --newfile EINGABEDATEI AUSGABEDATEI …

Neue-Datei-Modus. Die EINGABEDATEI wird umgewandelt und in die AUSGABEDATEI geschrieben. Die Dateinamen müssen paarweise angegeben werden. Platzhalter sollten nicht verwendet werden, sonst werden Sie Ihre Dateien verlieren.

Der Benutzer, der die Umwandlung im Neue-Datei-Modus startet, wird Besitzer der umgewandelten Datei. Die Lese- und Schreibrechte werden aus den Zugriffsrechten der Originaldatei minus der umask(1) der Person ermittelt, die die Umwandlung ausgeführt hat.

-o, --oldfile DATEI …

Alte-Datei-Modus. Die DATEI wird umgewandelt und durch die Ausgabedatei überschrieben. Per Vorgabe werden Umwandlungen in diesem Modus ausgeführt. Platzhalter sind verwendbar.

Im Alte-Datei-Modus (Ersetzungsmodus) erhalten die umgewandelten Dateien den gleichen Eigentümer, die gleiche Gruppe und die gleichen Lese- und Schreibberechtigungen wie die Originaldatei, auch wenn die Datei von einem anderen Benutzer umgewandelt wird, der Schreibrechte für die Datei hat (zum Beispiel der Systemadministrator). Die Umwandlung wird abgebrochen, wenn es nicht möglich ist, die originalen Werte beizubehalten. Die Änderung des Eigentümers könnte zum Beispiel bewirken, dass der ursprüngliche Eigentümer die Datei nicht mehr lesen kann. Die Änderung der Gruppe könnte ein Sicherheitsrisiko sein, da die Datei vielleicht für Benutzer lesbar wird, für die sie nicht bestimmt ist. Die Beibehaltung von Eigentümer, Gruppe und Schreib- und Leserechten wird nur unter Unix unterstützt.

-q, --quiet

Stiller Modus, in dem alle Warnungen und sonstige Meldungen unterdrückt werden. Der Rückgabewert ist 0, außer wenn fehlerhafte Befehlszeilenoptionen angegeben werden.

-r, --remove-bom

entfernt die Markierung der Bytereihenfolge (BOM). Es wird keine BOM in die Ausgabedatei geschrieben. Dies ist das Standardverhalten beim Umwandeln von Unix-Zeilenumbrüchen. Siehe auch die Option -b.

-s, --safe

überspringt Binärdateien (Vorgabe).

Binärdateien werden übersprungen, damit unerwünschtes Fehlverhalten vermieden wird. Denken Sie daran, dass die Erkennung nicht 100% sicher funktioniert. Die übergebenen Dateien werden auf Binärsymbole überprüft, die typischerweise in Textdateien nicht vorkommen. Es ist jedoch möglich, dass eine Binärdatei ausschließlich gewöhnliche Textzeichen enthält. Eine solche Binärdatei wird dann fälschlicherweise als Textdatei angesehen.

-u, --keep-utf16

erhält die originale UTF-16-Kodierung der Eingabedatei. Die Ausgabedatei wird in der gleichen UTF-16-Kodierung geschrieben (Little-Endian- oder Big-Endian-Bytereihenfolge) wie die Eingabedatei. Dies verhindert die Umwandlung in UTF-8. Eine UTF-16-BOM wird dementsprechend geschrieben. Diese Option kann durch Angabe der Option -ascii deaktiviert werden.

-ul, --assume-utf16le

nimmt an, dass die Eingabedatei das Format UTF-16LE hat.

Wenn die Eingabedatei eine Markierung der Bytereihenfolge enthält (BOM), dann hat die BOM Vorrang vor dieser Option.

Durch eine falsche Annahme (die Eingabedatei war nicht in UTF-16LE kodiert) mit erfolgreicher Umwandlung erhalten Sie eine UTF-8-Ausgabedatei mit fehlerhaftem Text. Sie können die fehlgeschlagene Umwandlung mit iconv(1) rückgängig machen, indem Sie die Rückumwandlung von UTF-8 nach UTF-16LE vornehmen. Dadurch gewinnen Sie die Originaldatei zurück.

Die Annahme von UTF-16LE wirkt wie ein Umwandlungsmodus. Beim Wechsel zum vorgegebenen ascii-Modus wird die UTF16LE-Annahme deaktiviert.

-ub, --assume-utf16be

nimmt an, dass die Eingabedatei das Format UTF-16BE hat.

Diese Option ist gleichbedeutend mit -ul.

-v, --verbose

zeigt ausführliche Meldungen an. Zusätzliche Informationen werden zu den Markierungen der Bytereihenfolge (BOM) und zur Anzahl der umgewandelten Zeilenumbrüche angezeigt.

folgt symbolischen Links und wandelt die Zieldateien um.

ersetzt symbolische Links durch die umgewandelten Dateien (die originalen Zieldateien bleiben unverändert).

erhält symbolische Links als solche und lässt die Ziele unverändert (Vorgabe).

-V, --version

zeigt Versionsinformationen an und beendet das Programm.

MAC-MODUS

Im Normalmodus werden Zeilenumbrüche von DOS nach Unix und umgekehrt umgewandelt. Mac-Zeilenumbrüche werden nicht verändert.

Im Mac-Modus werden Zeilenumbrüche von Mac nach Unix und umgekehrt umgewandelt. DOS-Zeilenumbrüche werden nicht verändert.

Um das Programm im Mac-Modus auszuführen, verwenden Sie die Befehlszeilenoption -c mac oder die Befehle mac2unix oder unix2mac.

UMWANDLUNGSMODI

ascii

Im ascii-Modus werden nur Zeilenumbrüche umgewandelt. Dies ist der vorgegebene Umwandlungsmodus.

Obwohl der Name dieses Modus auf ASCII hinweist, welches ein 7-bit-Standard ist, bezieht sich der eigentliche Modus auf 8 Bit. Verwenden Sie diesen Modus immer dann, wenn Sie Unicode-Dateien in UTF-8-Kodierung umwandeln.

7bit

In diesem Modus werden alle Nicht-ASCII-Zeichen aus 8 Bit in das 7-Bit-Bitmuster umgewandelt.

iso

Die Zeichen werden aus dem DOS-Zeichensatz (der Codepage) in den ISO-Zeichensatz ISO-8859-1 (Latin-1) in Unix umgewandelt. DOS-Zeichen ohne Äquivalent in ISO-8859-1, für die die Umwandlung nicht möglich ist, werden durch einen Punkt ersetzt. Gleiches gilt für ISO-8859-1-Zeichen ohne DOS-Gegenstück.

Wenn nur die Option -iso angegeben ist, versucht dos2unix die aktive Codepage selbst zu ermitteln. Sollte dies nicht möglich sein, wird die Standard-Codepage CP437 verwendet, welche hauptsächlich in den USA eingesetzt wird. Um eine bestimmte Codepage zu erzwingen, verwenden Sie die Optionen -437 (US), -850 (Westeuropäisch), -860 (Portugiesisch), -863 (Kanadisches Französisch) oder -865 (Skandinavisch). Die Windows-Codepage CP1252 (Westeuropäisch) wird durch die Option -1252 unterstützt.

Wenden Sie niemals die ISO-Umwandlung auf Unicode-Textdateien an. In UTF-8 kodierte Dateien werden dadurch beschädigt.

Einige Beispiele:

Umwandlung aus der vorgegebenen DOS-Codepage nach Unix Latin-1:

    dos2unix -iso -n in.txt ausgabe.txt

Umwandlung von DOS CP850 nach Unix Latin-1:

    dos2unix -850 -n eingabe.txt ausgabe.txt

Umwandlung von Windows CP1252 nach Unix Latin-1:

    dos2unix -1252 -n eingabe.txt ausgabe.txt

Umwandlung von Windows CP1252 nach Unix UTF-8 (Unicode):

    iconv -f CP1252 -t UTF-8 eingabe.txt | dos2unix > ausgabe.txt

Umwandlung von Unix Latin-1 in die vorgegebene DOS-Codepage:

    unix2dos -iso -n eingabe.txt ausgabe.txt

Umwandlung von Unix Latin-1 nach DOS CP850:

    unix2dos -850 -n eingabe.txt ausgabe.txt

Umwandlung von Unix Latin-1 nach Windows CP1252:

    unix2dos -1252 -n eingabe.txt ausgabe.txt

Umwandlung von Unix UTF-8 (Unicode) nach Windows CP1252:

    unix2dos < eingabe.txt | iconv -f UTF-8 -t CP1252 > ausgabe.txt

Siehe auch http://czyborra.com/charsets/codepages.html und http://czyborra.com/charsets/iso8859.html.

UNICODE

Zeichenkodierungen

Es gibt verschiedene Unicode-Zeichenkodierungen. Unter Unix und Linux sind Unicode-Dateien typischerweise in UTF-8 kodiert. Unter Windows können Textdateien in UTF-8, UTF-16 oder UTF-16 in Big-Endian-Bytereihenfolge kodiert sein, liegen aber meist im Format UTF-16 vor.

Umwandlung

Unicode-Textdateien können DOS-, Unix- oder Mac-Zeilenumbrüche enthalten, so wie reguläre Textdateien.

Alle Versionen von dos2unix und unix2dos können UTF-8-kodierte Dateien umwandeln, weil UTF-8 im Hinblick auf Abwärtskompatiblität mit ASCII entwickelt wurde.

Dos2unix und unix2dos mit Unterstützung für UTF-16 können in UTF-16 kodierte Dateien in Little-Endian- und Big-Endian-Bytereihenfolge lesen. Um festzustellen, ob dos2unix mit UTF-16-Unterstützung kompiliert wurde, geben Sie dos2unix -V ein.

Unter Unix/Linux werden UTF-16 kodierte Dateien standardmäßig in die Zeichenkodierung entsprechend der Locale umgewandelt. Mit dem Befehl locale(1) können Sie herausfinden, wie die Zeichenkodierung der Locale eingestellt ist. Wenn eine Umwandlung nicht möglich ist, verursacht dies einen Umwandlungsfehler, wodurch die Datei übersprungen wird.

Unter Windows werden UTF-16-Dateien standardmäßig in UTF-8 umgewandelt. In UTF-8 formatierte Textdateien werden von Windows und Unix/Linux gleichermaßen unterstützt.

Die Kodierungen UTF-16 und UTF-8 sind vollständig kompatibel, daher wird bei der Umwandlung keinerlei Text verlorengehen. Sollte bei der Umwandlung von UTF-16 in UTF-8 ein Problem auftreten, beispielsweise wenn die UTF-16-kodierte Eingabedatei einen Fehler enthält, dann wird diese Datei übersprungen.

Wenn die Option -u verwendet wird, wird die Ausgabedatei in der gleichen UTF-16-Kodierung wie die Eingabedatei geschrieben. Die Option -u verhindert die Umwandlung in UTF-8.

Dos2unix und unix2dos bieten keine Option zur Umwandlung von UTF-8-Dateien in UTF-16.

Umwandlungen im ISO- und 7bit-Modus funktionieren mit UTF-16-Dateien nicht.

Markierung der Bytereihenfolge

Unicode-Textdateien unter Windows haben typischerweise eine Markierung der Bytereihenfolge (BOM), da viele Windows-Programme (zum Beispiel Notepad) solche BOMs standardmäßig hinzufügen. Weitere Informationen hierzu finden Sie auf http://de.wikipedia.org/wiki/Byte-Reihenfolge.

Unter Unix haben Textdateien üblicherweise keine BOM. Es wird stattdessen angenommen, dass Textdateien in der Zeichenkodierung entsprechend der Spracheinstellung vorliegen.

Dos2unix kann nur dann erkennen, ob eine Datei UTF-16-kodiert ist, wenn die Datei eine BOM enthält. Ist dies nicht der Fall, nimmt dos2unix an, dass es sich um eine Binärdatei handelt.

Verwenden Sie die Optionen -ul oder -ub, um eine UTF-16-Datei ohne BOM umzuwandeln.

Dos2unix schreibt in der Voreinstellung keine BOM in die Ausgabedatei. Mit der Option -b schreibt Dos2unix eine BOM, wenn die Eingabedatei ebenfalls eine BOM hat.

Unix2dos schreibt in der Voreinstellung eine BOM in die Ausgabedatei, wenn die Eingabedatei ebenfalls eine solche Markierung hat. Verwenden Sie die Option -r, um die BOM zu entfernen.

Dos2unix und unix2dos schreiben immer eine BOM, wenn die Option -m angegeben ist.

Unicode-Dateinamen unter Windows

Dos2unix verfügt über optionale Unterstützung für das Lesen und Schreiben von Unicode-Dateinamen in der Windows-Eingabeaufforderung. Dadurch kann dos2unix Dateien öffnen, deren Namen Zeichen enthalten, die nicht zur Standard-ANSI-Codepage des Systems gehören. Geben Sie dos2unix -V ein, um zu sehen, ob dos2unix für Windows mit Unterstützung für Unicode-Dateinamen erstellt wurde.

Die Anzeige von Unicode-Dateinamen in einer Windows-Konsole ist gelegentlich nicht fehlerfrei, siehe die Option -D, --display-enc. Die Dateinamen können falsch dargestellt werden, allerdings werden die Dateien mit deren korrekten Namen gespeichert.

Unicode-Beispiele

Umwandlung von Windows UTF-16 (mit BOM) nach Unix UTF-8:

    dos2unix -n eingabe.txt ausgabe.txt

Umwandlung von Windows UTF-16LE (ohne BOM) nach Unix UTF-8:

    dos2unix -ul -n eingabe.txt ausgabe.txt

Umwandlung von Unix UTF-8 nach Windows UTF-8 mit BOM:

    unix2dos -m -n eingabe.txt ausgabe.txt

Umwandlung von Unix UTF-8 nach Windows UTF-16:

    unix2dos < eingabe.txt | iconv -f UTF-8 -t UTF-16 > ausgabe.txt

GB18030

GB18030 ist ein Standard der chinesischen Regierung. Eine Teilmenge des in GB18030 definierten Standards ist offiziell für alle in China verkauften Softwareprodukte vorgeschrieben. Siehe auch http://de.wikipedia.org/wiki/GB_18030.

GB18030 ist vollständig zu Unicode kompatibel und kann als Unicode-Umwandlungsformat betrahctet werden. Wie auch UTF-8 ist GB18030 kompatibel zu ASCII. Ebenfalls kompatibel ist es zur Codepage 936 von Windows, auch als GBK bekannt.

Unter Unix/Linux werden UTF-16-Dateien in GB18030 umgewandelt, wenn die Einstellung der Locale auf GB18030 gesetzt ist. Beachten Sie, dass dies nur funktioniert, wenn die Locale vom System unterstützt wird. Mit dem Befehl locale -a erhalten Sie eine Liste der unterstützten Locales.

Unter Windows benötigen Sie die Option -gb, um UTF-16-Dateien in GB18030 umwandeln zu können.

In GB 18030 kodierte Dateien haben wie Unicode-Dateien eine Markierung der Bytereihenfolge (BOM).

BEISPIELE

Aus der Standardeingabe lesen und in die Standardausgabe schreiben:

    dos2unix < a.txt
    cat a.txt | dos2unix

a.txt umwandeln und ersetzen, b.txt umwandeln und ersetzen:

    dos2unix a.txt b.txt
    dos2unix -o a.txt b.txt

a.txt im ascii-Modus umwandeln und ersetzen:

    dos2unix a.txt

a.txt im ascii-Modus umwandeln und ersetzen, b.txt im 7bit-Modus umwandeln und ersetzen:

    dos2unix a.txt -c 7bit b.txt
    dos2unix -c ascii a.txt -c 7bit b.txt
    dos2unix -ascii a.txt -7 b.txt

a.txt aus dem Mac- in das Unix-Format umwandeln:

    dos2unix -c mac a.txt
    mac2unix a.txt

a.txt aus dem Unix- in das Mac-Format umwandeln:

    unix2dos -c mac a.txt
    unix2mac a.txt

a.txt unter Beibehaltung des ursprünglichen Zeitstempels umwandeln:

    dos2unix -k a.txt
    dos2unix -k -o a.txt

a.txt umwandeln und das Ergebnis nach e.txt schreiben:

    dos2unix -n a.txt e.txt

a.txt umwandeln und das Ergebnis nach e.txt schreiben, wobei e.txt den gleichen Zeitstempel erhält wie a.txt:

    dos2unix -k -n a.txt e.txt

a.txt umwandeln und ersetzen, b.txt umwandeln und das Ergebnis nach e.txt schreiben:

    dos2unix a.txt -n b.txt e.txt
    dos2unix -o a.txt -n b.txt e.txt

c.txt umwandeln und das Ergebnis nach e.txt schreiben, a.txt umwandeln und ersetzen, b.txt umwandeln und ersetzen, d.txt umwandeln und das Ergebnis nach f.txt schreiben:

    dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt

REKURSIVE UMWANDLUNG

Verwenden Sie dos2unix zusammen mit den Befehlen find(1) und xargs(1), um Textdateien in einem Verzeichnisbaum rekursiv umzuwandeln. Um beispielsweise alle *.txt-Dateien im aktuellen Verzeichnis und dessen Unterverzeichnissen umzuwandeln, geben Sie Folgendes ein:

    find . -name '*.txt' |xargs dos2unix

In einer Eingabeaufforderung kann der folgende Befehl verwendet werden:

    for /R %G in (*.txt) do dos2unix "%G"

In der Windows PowerShell können Sie folgenden Befehl verwenden:

    get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}

LOKALISIERUNG

LANG

Die primäre Sprache wird durch die Umgebungsvariable LANG festgelegt. Diese Variable besteht aus mehreren Teilen: Der erste Teil besteht aus zwei Kleinbuchstaben, die den Sprachcode angeben. Der zweite Teil ist optional und bezeichnet den Ländercode in Großbuchstaben, vom davor stehenden Sprachcode durch einen Unterstrich getrennt. Der dritte Teil ist ebenfalls optional und gibt die Zeichenkodierung an, vom Ländercode durch einen Punkt getrennt. Einige Beispiele für Standard-POSIX-Shells:

    export LANG=de               Deutsch
    export LANG=de_DE            Deutsch, Deutschland
    export LANG=de_AT            Deutsch, Österreich
    export LANG=es_ES            Spanisch, Spanien
    export LANG=es_MX            Spanisch, Mexiko
    export LANG=en_US.iso88591   Englisch, USA, Latin-1-Zeichenkodierung
    export LANG=en_GB.UTF-8      Englisch, GB, UTF-8-Zeichenkodierung

Eine vollständige Liste der Sprachen und Ländercodes finden Sie im Gettext-Handbuch: http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

Auf Unix-Systemen erhalten Sie mit dem Befehl locale(1) spezifische Informationen zu den Spracheinstellungen.

LANGUAGE

Mit der Umgebungsvariable LANGUAGE können Sie eine Prioritätenliste für Sprachen übergeben, die Sie durch Doppelpunkte voneinander trennen. Dos2unix gibt LANGUAGE vor LANG den Vorzug, zum Beispiel bei Deutsch vor Niederländisch: LANGUAGE=de:nl. Sie müssen zunächst die Lokalisierung aktivieren, indem Sie die Variable LANG (oder LC_ALL) auf einen anderen Wert als »C« setzen, bevor Sie die Liste der Sprachprioritäten mit der Variable LANGUAGE nutzen können. Weitere Informationen finden Sie im Gettext-Handbuch: http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

Falls Sie eine Sprache auswählen, die nicht verfügbar ist, erhalten Sie die Standardmeldungen in englischer Sprache.

DOS2UNIX_LOCALEDIR

Durch die Umgebungsvariable DOS2UNIX_LOCALEDIR wird LOCALEDIR während der Kompilierung übergangen. LOCALEDIR wird verwendet, um Sprachdateien zu finden. Der GNU-Standardwert ist /usr/local/share/locale. Die Option --version zeigt das verwendete LOCALEDIR an.

Beispiel (POSIX-Shell):

    export DOS2UNIX_LOCALEDIR=$HOME/share/locale

RÜCKGABEWERT

Bei Erfolg wird 0 zurückgegeben. Bei aufgetretenen Systemfehlern wird der letzte Systemfehler zurückgegeben. Für alle anderen Fehler wird 1 zurückgegeben.

Der Rückgabewert ist im stillen Modus stets 0, außer wenn fehlerhafte Befehlszeilenoptionen verwendet werden.

STANDARDS

http://de.wikipedia.org/wiki/Textdatei

http://de.wikipedia.org/wiki/Wagenr%C3%BCcklauf

http://de.wikipedia.org/wiki/Zeilenumbruch

http://en.wikipedia.org/wiki/Unicode

AUTOREN

Benjamin Lin - <blin@socs.uts.edu.au>, Bernd Johannes Wuebben (Mac2unix-Modus) - <wuebben@kde.org>, Christian Wurll (Extra Zeilenumbruch) - <wurll@ira.uka.de>, Erwin Waterlander - <waterlan@xs4all.nl> (Betreuer)

Projektseite: http://waterlan.home.xs4all.nl/dos2unix.html

SourceForge-Seite: http://sourceforge.net/projects/dos2unix/

SIEHE AUCH

file(1) find(1) iconv(1) locale(1) xargs(1)

dos2unix-7.3.4/man/de/man1/dos2unix.pod0000644000175500010010000007121112721132560017026 0ustar waterlanGeen ***************************************************** * GENERATED FILE, DO NOT EDIT * * THIS IS NO SOURCE FILE, BUT RESULT OF COMPILATION * ***************************************************** This file was generated by po4a(7). Do not store it (in VCS, for example), but store the PO file used as source file by po4a-translate. In fact, consider this as a binary, and the PO file as a regular .c file: If the PO get lost, keeping this translation up-to-date will be harder. =pod =encoding UTF-8 =head1 BEZEICHNUNG dos2unix - Formatumwandlung für Textdateien von DOS/Mac nach Unix und umgekehrt =head1 ÜBERSICHT dos2unix [Optionen] [DATEI …] [-n EINGABEDATEI AUSGABEDATEI …] unix2dos [Optionen] [DATEI …] [-n EINGABEDATEI AUSGABEDATEI …] =head1 BESCHREIBUNG Das Paket Dos2unix enthält die Werkzeuge C und C zum Umwandeln einfacher Textdateien aus dem DOS- oder Mac-Format in das Unix-Format und umgekehrt. In Textdateien unter DOS/Windows sind Zeilenumbrüche, auch als neue Zeile (NL) bekannt, eine Kombination aus zwei Zeichen: einem Wagenrücklauf (Carriage Return, CR) gefolgt von einem Zeilenvorschub (Line Feed, LF). In Unix-Textdateien bestehen Zeilenumbrüche nur aus einem Zeichen, dem Zeilenvorschub (LF). In Mac-Textdateien aus der Zeit vor MacOSX bestand ein Zeilenumbruch aus einem einzelnen CR-Zeichen. Heute verwendet Mac OS Zeilenumbrüche im Unix-Stil (LF). Neben Zeilenumbrüchen kann Dos2unix auch die Zeichenkodierung von Dateien umwandeln. Einige DOS-Codepages können in Unix Latin-1 umgewandelt werden, und Windows-Unicode-Dateien (UTF-16) können in Unix-Unicode-Dateien (UTF-8) umgewandelt werden. Binärdateien werden automatisch übersprungen, sofern die Umwandlung nicht erzwungen wird. Nicht-reguläre Dateien, wie Verzeichnisse und FIFOS (Weiterleitungen) werden automatisch übersprungen. Symbolische Links und deren Ziele werden per Vorgabe unverändert belassen. Symbolische Links können optional ersetzt werden, oder die Ausgabe wird in das Ziel des symbolischen Links geschrieben. Unter Windows wird das Schreiben in das Ziel eines symbolischen Links nicht unterstützt. Dos2unix wurde nach dem Vorbild der dos2unix-Version unter SunOS/Solaris entwickelt, doch es gibt einen wesentlichen Unterschied zum Original: Diese Version ersetzt per Vorgabe Dateien bei der Umwandlung (Alte-Datei-Modus), während unter SunOS/Solaris nur die paarweise Umwandlung (Neue-Datei-Modus) unterstützt wird. Siehe dazu die Optionen C<-o> und C<-n>. Ein weiterer Unterschied ist, dass die SunOS/Solaris-Version in der Voreinstellung die Umwandlung im I-Modus vornimmt, während diese Version den I-Modus verwendet. =head1 OPTIONEN =over 4 =item B<--> nimmt alle folgenden Optionen als Dateinamen an. Verwenden Sie diese Option, wenn Sie Dateien umwandeln wollen, deren Namen mit einem Minuszeichen beginnen. Um beispielsweise eine Datei namens »-bla« umzuwandeln, können Sie folgenden Befehl verwenden: dos2unix -- -bla oder im Neue-Datei-Modus: dos2unix -n -- -bla ausgabe.txt =item B<-ascii> wandelt nur Zeilenumbrüche um. Dies ist der vorgegebene Umwandlungsmodus. =item B<-iso> wandelt aus dem DOS- in den ISO-8859-1-Zeichensatz um. Weitere Informationen hierzu finden Sie im Abschnitt UMWANDLUNGSMODI. =item B<-1252> verwendet die Windows-Codepage 1252 (Westeuropäisch). =item B<-437> verwendet die DOS-Codepage 437 (US). Dies ist die vorgegebene Codepage für die ISO-Umwandlung. =item B<-850> verwendet die DOS-Codepage 850 (Westeuropäisch). =item B<-860> verwendet die DOS-Codepage 860 (Portugiesisch). =item B<-863> verwendet die DOS-Codepage 863 (Kanadisches Französisch). =item B<-865> verwendet die DOS-Codepage 865 (Skandinavisch). =item B<-7> wandelt 8bit-Zeichen in ein 7bit-Bitmuster um. =item B<-b, --keep-bom> erhält die Markierung der Bytereihenfolge (BOM). Wenn die Eingabedatei eine BOM enthält, wird ebenfalls eine BOM in die Ausgabedatei geschrieben. Dies ist das Standardverhalten beim Umwandeln von DOS-Zeilenumbrüchen. Siehe auch die Option C<-r>. =item B<-c, --convmode UMWANDLUNGSMODUS> legt den Umwandlungsmodus fest. UMWANDLUNGSMODUS kann I, I<7bit>, I oder I sein, wobei I die Vorgabe ist. =item B<-D, --display-enc KODIERUNG> legt die Kodierung des angezeigten Texts fest. KODIERUNG kann I, I, I, I oder sein, wobei I die Vorgabe ist. Diese Option ist nur in dos2unix für Windows mit Unterstützung für Unicode-Dateinamen verfügbar. Sie bleibt wirkungslos, wenn die tatsächlichen Dateinamen gelesen und geschrieben werden, lediglich bei der Darstellung wird sie berücksichtigt. Es gibt verschiedene Möglichkeiten, Text in einer Windows-Konsole basierend auf dessen Kodierung darzustellen. Alle haben verschiedene Vor- und Nachteile. =over 4 =item B Die Standardmethode von dos2unix ist die Verwendung von ANSI-kodiertem Text, der Vorteil ist deren Abwärtskompatibilität. Dies funktioniert mit Raster- und TrueType-Schriften. In manchen Gebieten müssen Sie mit dem Befehl C die aktive DOS-OEM-Codepage in die -System-ANSI-Codepage des Systems ändern, da dos2unix Letztere verwendet. Der Nachteil von ANSI ist, dass internationale Dateinamen nicht korrekt dargestellt werden, wenn darin Zeichen enthalten sind, die nicht in der im System voreingestellten Codepage enthalten sind. Stattdessen wird entweder ein Fragezeichen oder ein falsches Zeichen angezeigt. Sofern Sie nicht mit fremden Dateinamen arbeiten, ist diese Methode in Ordnung. =item B Der Vorteil von Unicode (dem Windows-Namen für UTF-16) ist die üblicherweise korrekte Textdarstellung. Eine Änderung der aktiven Codepage ist nicht erforderlich. Sie müssen die Schriftart der Konsole auf eine TrueType-Schrift einstellen, damit internationale Zeichen richtig angezeigt werden können. Sollte ein Zeichen in einer TrueType-Schrift nicht enthalten sein, wird ein kleines Quadrat angezeigt, das gelegentlich noch ein Fragezeichen enthält. Wenn Sie die ConEmu-Konsole nutzen, wird der gesamte Text korrekt dargestellt, da ConEmu automatisch eine passende Schrift wählt. Nachteilig für Unicode ist, dass es nicht zu ASCII kompatibel ist. Die Ausgabe ist schwer zu verarbeiten, wenn sie in ein anderes Programm oder eine Datei weitergeleitet wird. Wenn die Methode C verwendet wird, dann wird dem Unicode-Text eine BOM (Markierung der Bytereihenfolge) vorangestellt. Eine BOM ist ist für korrekte um- oder Weiterleitung in der PowerShell notwendig. =item B Der Vorteil von UTF-8 ist die ASCII-Kompatibilität. Sie müssen die Schriftart der Konsole auf eine TrueType-Schrift setzen. Dadurch wird der Text ähnlich wie in der C-Kodierung dargestellt. Der Nachteil ist die falsche Darstellung aller Nicht-ASCII-Zeichen, wenn Sie die Standard-Rasterschrift verwenden. Nicht nur Unicode-Dateinamen, sondern auch übersetzte Meldungen werden unlesbar. Auf einem Windows-System, das für eine ostasiatische Region eingerichtet wurde, wird die Konsole bei der Anzeige von Meldungen deutlich flackern. In einer ConEmu-Konsole funktioniert die UTF-8-Kodierung gut. Wenn die Methode C verwendet wird, dann wird dem UTF-8-Text eine BOM (Markierung der Bytereihenfolge) vorangestellt. Eine BOM ist ist für korrekte um- oder Weiterleitung in der PowerShell notwendig. =back Die Standardkodierung kann durch Setzen der Umgebungsvariable DOS2UNIX_DISPLAY_ENC auf C, C, C oder C geändert werden. =item B<-f, --force> erzwingt die Umwandlung von Binärdateien. =item B<-gb, --gb18030> wandelt unter Windows UTF-16-Dateien standardmäßig in UTF-8 um, ungeachtet der Einstellung der Locale. Verwenden Sie diese Option zum umwandeln von Utf-16-Dateien in GB18030. Diese Option ist nur unter Windows verfügbar. Siehe auch Abschnitt GB18030. =item B<-h, --help> zeigt eine Hilfe an und beendet das Programm. =item B<-i[SCHALTER], --info[=SCHALTER] DATEI> zeigt Dateiinformationen an. Es wird keine Umwandlung vorgenommen. Die Ausgabe der Informationen geschieht in der folgenden Reihenfolge: Anzahl der DOS-Zeilenumbrüche, Anzahl der Unix-Zeilenumbrüche, Anzahl der Mac-Zeilenumbrüche, Markierung der Bytereihenfolge, Text- oder Binärformat, Dateiname. Beispielausgabe: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Beachten sie, dass manchmal eine Binärdatei fälschlicherweise als Textdatei erkannt wird. Siehe auch Option C<-s>. Optionale zusätzliche Schalter können gesetzt werden, um die Ausgabe anzupassen. Einer oder mehrere Schalter können hinzugefügt werden. =over 4 =item B gibt die Anzahl der DOS-Zeilenumbrüche aus. =item B gibt die Anzahl der Unix-Zeilenumbrüche aus. =item B gibt die Anzahl der Mac-Zeilenumbrüche aus. =item B gibt die Markierung der Bytereihenfolge aus. =item B zeigt an, ob es sich um eine Text- oder eine Binärdatei handelt. =item B gibt nur die Dateien aus, die umgewandelt werden würden. Mit dem Schalter C gibt dos2unix nur die Dateien aus, die DOS-Zeilenumbrüche enthalten, unix2dos nur die Dateien mit Unix-Zeilenumbrüchen. =item B gibt eine Kopfzeile aus. =item B

zeigt Dateinamen ohne Pfade an. =back Beispiele: Informationen zu allen *.txt-Dateien anzeigen: dos2unix -i *.txt Nur die Anzahl der DOS-Zeilenumbrüche und Unix-Zeilenumbrüche anzeigen: dos2unix -idu *.txt Nur die Markierung der Bytereihenfolge anzeigen: dos2unix --info=b *.txt Die Dateien auflisten, die DOS-Zeilenumbrüche enthalten: dos2unix -ic *.txt Die Dateien auflisten, die Unix-Zeilenumbrüche enthalten: unix2dos -ic *.txt Nur Dateien umwandeln, die DOS-Zeilenumbrüche enthalten und die anderen Dateien unverändert belassen: find . -name '*.txt' |xargs dos2unix Nach Textdateien suchen, die DOS-Zeilenumbrüche enthalten: find . -name '*.txt' |xargs dos2unix =item B<-k, --keepdate> übernimmt den Zeitstempel der Eingabedatei in die Ausgabedatei. =item B<-L, --license> zeigt die Lizenz des Programms an. =item B<-l, --newline> fügt eine zusätzliche neue Zeile hinzu. B: Nur DOS-Zeilenumbrüche werden in Unix-Zeilenumbrüche umgewandelt. Im Mac-Modus werden nur Mac-Zeilenumbrüche in Unix-Zeilenumbrüche umgewandelt. B: Nur Unix-Zeilenumbrüche werden in DOS-Zeilenumbrüche umgewandelt. Im Mac-Modus werden nur Unix-Zeilenumbrüche in Mac-Zeilenumbrüche umgewandelt. =item B<-m, --add-bom> schreibt eine Markierung der Bytereihenfolge (BOM) in die Ausgabedatei. In der Voreinstellung wird eine UTF-8-BOM geschrieben. Wenn die Eingabedatei in UTF-16 kodiert ist und die Option C<-u> verwendet wird, wird eine UTF-16-BOM geschrieben. Verwenden Sie diese Option niemals, wenn die Kodierung der Ausgabedatei nicht UTF-8, UTF-16 oder GB 18030 ist. Weitere Informationen finden Sie im Abschnitt UNICODE. =item B<-n, --newfile EINGABEDATEI AUSGABEDATEI …> Neue-Datei-Modus. Die EINGABEDATEI wird umgewandelt und in die AUSGABEDATEI geschrieben. Die Dateinamen müssen paarweise angegeben werden. Platzhalter sollten I verwendet werden, sonst werden Sie Ihre Dateien I. Der Benutzer, der die Umwandlung im Neue-Datei-Modus startet, wird Besitzer der umgewandelten Datei. Die Lese- und Schreibrechte werden aus den Zugriffsrechten der Originaldatei minus der umask(1) der Person ermittelt, die die Umwandlung ausgeführt hat. =item B<-o, --oldfile DATEI …> Alte-Datei-Modus. Die DATEI wird umgewandelt und durch die Ausgabedatei überschrieben. Per Vorgabe werden Umwandlungen in diesem Modus ausgeführt. Platzhalter sind verwendbar. Im Alte-Datei-Modus (Ersetzungsmodus) erhalten die umgewandelten Dateien den gleichen Eigentümer, die gleiche Gruppe und die gleichen Lese- und Schreibberechtigungen wie die Originaldatei, auch wenn die Datei von einem anderen Benutzer umgewandelt wird, der Schreibrechte für die Datei hat (zum Beispiel der Systemadministrator). Die Umwandlung wird abgebrochen, wenn es nicht möglich ist, die originalen Werte beizubehalten. Die Änderung des Eigentümers könnte zum Beispiel bewirken, dass der ursprüngliche Eigentümer die Datei nicht mehr lesen kann. Die Änderung der Gruppe könnte ein Sicherheitsrisiko sein, da die Datei vielleicht für Benutzer lesbar wird, für die sie nicht bestimmt ist. Die Beibehaltung von Eigentümer, Gruppe und Schreib- und Leserechten wird nur unter Unix unterstützt. =item B<-q, --quiet> Stiller Modus, in dem alle Warnungen und sonstige Meldungen unterdrückt werden. Der Rückgabewert ist 0, außer wenn fehlerhafte Befehlszeilenoptionen angegeben werden. =item B<-r, --remove-bom> entfernt die Markierung der Bytereihenfolge (BOM). Es wird keine BOM in die Ausgabedatei geschrieben. Dies ist das Standardverhalten beim Umwandeln von Unix-Zeilenumbrüchen. Siehe auch die Option C<-b>. =item B<-s, --safe> überspringt Binärdateien (Vorgabe). Binärdateien werden übersprungen, damit unerwünschtes Fehlverhalten vermieden wird. Denken Sie daran, dass die Erkennung nicht 100% sicher funktioniert. Die übergebenen Dateien werden auf Binärsymbole überprüft, die typischerweise in Textdateien nicht vorkommen. Es ist jedoch möglich, dass eine Binärdatei ausschließlich gewöhnliche Textzeichen enthält. Eine solche Binärdatei wird dann fälschlicherweise als Textdatei angesehen. =item B<-u, --keep-utf16> erhält die originale UTF-16-Kodierung der Eingabedatei. Die Ausgabedatei wird in der gleichen UTF-16-Kodierung geschrieben (Little-Endian- oder Big-Endian-Bytereihenfolge) wie die Eingabedatei. Dies verhindert die Umwandlung in UTF-8. Eine UTF-16-BOM wird dementsprechend geschrieben. Diese Option kann durch Angabe der Option C<-ascii> deaktiviert werden. =item B<-ul, --assume-utf16le> nimmt an, dass die Eingabedatei das Format UTF-16LE hat. Wenn die Eingabedatei eine Markierung der Bytereihenfolge enthält (BOM), dann hat die BOM Vorrang vor dieser Option. Durch eine falsche Annahme (die Eingabedatei war nicht in UTF-16LE kodiert) mit erfolgreicher Umwandlung erhalten Sie eine UTF-8-Ausgabedatei mit fehlerhaftem Text. Sie können die fehlgeschlagene Umwandlung mit iconv(1) rückgängig machen, indem Sie die Rückumwandlung von UTF-8 nach UTF-16LE vornehmen. Dadurch gewinnen Sie die Originaldatei zurück. Die Annahme von UTF-16LE wirkt wie ein I. Beim Wechsel zum vorgegebenen I-Modus wird die UTF16LE-Annahme deaktiviert. =item B<-ub, --assume-utf16be> nimmt an, dass die Eingabedatei das Format UTF-16BE hat. Diese Option ist gleichbedeutend mit C<-ul>. =item B<-v, --verbose> zeigt ausführliche Meldungen an. Zusätzliche Informationen werden zu den Markierungen der Bytereihenfolge (BOM) und zur Anzahl der umgewandelten Zeilenumbrüche angezeigt. =item B<-F, --follow-symlink> folgt symbolischen Links und wandelt die Zieldateien um. =item B<-R, --replace-symlink> ersetzt symbolische Links durch die umgewandelten Dateien (die originalen Zieldateien bleiben unverändert). =item B<-S, --skip-symlink> erhält symbolische Links als solche und lässt die Ziele unverändert (Vorgabe). =item B<-V, --version> zeigt Versionsinformationen an und beendet das Programm. =back =head1 MAC-MODUS Im Normalmodus werden Zeilenumbrüche von DOS nach Unix und umgekehrt umgewandelt. Mac-Zeilenumbrüche werden nicht verändert. Im Mac-Modus werden Zeilenumbrüche von Mac nach Unix und umgekehrt umgewandelt. DOS-Zeilenumbrüche werden nicht verändert. Um das Programm im Mac-Modus auszuführen, verwenden Sie die Befehlszeilenoption C<-c mac> oder die Befehle C oder C. =head1 UMWANDLUNGSMODI =over 4 =item B Im C-Modus werden nur Zeilenumbrüche umgewandelt. Dies ist der vorgegebene Umwandlungsmodus. Obwohl der Name dieses Modus auf ASCII hinweist, welches ein 7-bit-Standard ist, bezieht sich der eigentliche Modus auf 8 Bit. Verwenden Sie diesen Modus immer dann, wenn Sie Unicode-Dateien in UTF-8-Kodierung umwandeln. =item B<7bit> In diesem Modus werden alle Nicht-ASCII-Zeichen aus 8 Bit in das 7-Bit-Bitmuster umgewandelt. =item B Die Zeichen werden aus dem DOS-Zeichensatz (der Codepage) in den ISO-Zeichensatz ISO-8859-1 (Latin-1) in Unix umgewandelt. DOS-Zeichen ohne Äquivalent in ISO-8859-1, für die die Umwandlung nicht möglich ist, werden durch einen Punkt ersetzt. Gleiches gilt für ISO-8859-1-Zeichen ohne DOS-Gegenstück. Wenn nur die Option C<-iso> angegeben ist, versucht dos2unix die aktive Codepage selbst zu ermitteln. Sollte dies nicht möglich sein, wird die Standard-Codepage CP437 verwendet, welche hauptsächlich in den USA eingesetzt wird. Um eine bestimmte Codepage zu erzwingen, verwenden Sie die Optionen C<-437> (US), C<-850> (Westeuropäisch), C<-860> (Portugiesisch), C<-863> (Kanadisches Französisch) oder C<-865> (Skandinavisch). Die Windows-Codepage CP1252 (Westeuropäisch) wird durch die Option C<-1252> unterstützt. Wenden Sie niemals die ISO-Umwandlung auf Unicode-Textdateien an. In UTF-8 kodierte Dateien werden dadurch beschädigt. Einige Beispiele: Umwandlung aus der vorgegebenen DOS-Codepage nach Unix Latin-1: dos2unix -iso -n in.txt ausgabe.txt Umwandlung von DOS CP850 nach Unix Latin-1: dos2unix -850 -n eingabe.txt ausgabe.txt Umwandlung von Windows CP1252 nach Unix Latin-1: dos2unix -1252 -n eingabe.txt ausgabe.txt Umwandlung von Windows CP1252 nach Unix UTF-8 (Unicode): iconv -f CP1252 -t UTF-8 eingabe.txt | dos2unix > ausgabe.txt Umwandlung von Unix Latin-1 in die vorgegebene DOS-Codepage: unix2dos -iso -n eingabe.txt ausgabe.txt Umwandlung von Unix Latin-1 nach DOS CP850: unix2dos -850 -n eingabe.txt ausgabe.txt Umwandlung von Unix Latin-1 nach Windows CP1252: unix2dos -1252 -n eingabe.txt ausgabe.txt Umwandlung von Unix UTF-8 (Unicode) nach Windows CP1252: unix2dos < eingabe.txt | iconv -f UTF-8 -t CP1252 > ausgabe.txt Siehe auch L und L. =back =head1 UNICODE =head2 Zeichenkodierungen Es gibt verschiedene Unicode-Zeichenkodierungen. Unter Unix und Linux sind Unicode-Dateien typischerweise in UTF-8 kodiert. Unter Windows können Textdateien in UTF-8, UTF-16 oder UTF-16 in Big-Endian-Bytereihenfolge kodiert sein, liegen aber meist im Format UTF-16 vor. =head2 Umwandlung Unicode-Textdateien können DOS-, Unix- oder Mac-Zeilenumbrüche enthalten, so wie reguläre Textdateien. Alle Versionen von dos2unix und unix2dos können UTF-8-kodierte Dateien umwandeln, weil UTF-8 im Hinblick auf Abwärtskompatiblität mit ASCII entwickelt wurde. Dos2unix und unix2dos mit Unterstützung für UTF-16 können in UTF-16 kodierte Dateien in Little-Endian- und Big-Endian-Bytereihenfolge lesen. Um festzustellen, ob dos2unix mit UTF-16-Unterstützung kompiliert wurde, geben Sie C ein. Unter Unix/Linux werden UTF-16 kodierte Dateien standardmäßig in die Zeichenkodierung entsprechend der Locale umgewandelt. Mit dem Befehl locale(1) können Sie herausfinden, wie die Zeichenkodierung der Locale eingestellt ist. Wenn eine Umwandlung nicht möglich ist, verursacht dies einen Umwandlungsfehler, wodurch die Datei übersprungen wird. Unter Windows werden UTF-16-Dateien standardmäßig in UTF-8 umgewandelt. In UTF-8 formatierte Textdateien werden von Windows und Unix/Linux gleichermaßen unterstützt. Die Kodierungen UTF-16 und UTF-8 sind vollständig kompatibel, daher wird bei der Umwandlung keinerlei Text verlorengehen. Sollte bei der Umwandlung von UTF-16 in UTF-8 ein Problem auftreten, beispielsweise wenn die UTF-16-kodierte Eingabedatei einen Fehler enthält, dann wird diese Datei übersprungen. Wenn die Option C<-u> verwendet wird, wird die Ausgabedatei in der gleichen UTF-16-Kodierung wie die Eingabedatei geschrieben. Die Option C<-u> verhindert die Umwandlung in UTF-8. Dos2unix und unix2dos bieten keine Option zur Umwandlung von UTF-8-Dateien in UTF-16. Umwandlungen im ISO- und 7bit-Modus funktionieren mit UTF-16-Dateien nicht. =head2 Markierung der Bytereihenfolge Unicode-Textdateien unter Windows haben typischerweise eine Markierung der Bytereihenfolge (BOM), da viele Windows-Programme (zum Beispiel Notepad) solche BOMs standardmäßig hinzufügen. Weitere Informationen hierzu finden Sie auf L. Unter Unix haben Textdateien üblicherweise keine BOM. Es wird stattdessen angenommen, dass Textdateien in der Zeichenkodierung entsprechend der Spracheinstellung vorliegen. Dos2unix kann nur dann erkennen, ob eine Datei UTF-16-kodiert ist, wenn die Datei eine BOM enthält. Ist dies nicht der Fall, nimmt dos2unix an, dass es sich um eine Binärdatei handelt. Verwenden Sie die Optionen C<-ul> oder C<-ub>, um eine UTF-16-Datei ohne BOM umzuwandeln. Dos2unix schreibt in der Voreinstellung keine BOM in die Ausgabedatei. Mit der Option C<-b> schreibt Dos2unix eine BOM, wenn die Eingabedatei ebenfalls eine BOM hat. Unix2dos schreibt in der Voreinstellung eine BOM in die Ausgabedatei, wenn die Eingabedatei ebenfalls eine solche Markierung hat. Verwenden Sie die Option C<-r>, um die BOM zu entfernen. Dos2unix und unix2dos schreiben immer eine BOM, wenn die Option C<-m> angegeben ist. =head2 Unicode-Dateinamen unter Windows Dos2unix verfügt über optionale Unterstützung für das Lesen und Schreiben von Unicode-Dateinamen in der Windows-Eingabeaufforderung. Dadurch kann dos2unix Dateien öffnen, deren Namen Zeichen enthalten, die nicht zur Standard-ANSI-Codepage des Systems gehören. Geben Sie C ein, um zu sehen, ob dos2unix für Windows mit Unterstützung für Unicode-Dateinamen erstellt wurde. Die Anzeige von Unicode-Dateinamen in einer Windows-Konsole ist gelegentlich nicht fehlerfrei, siehe die Option C<-D>, C<--display-enc>. Die Dateinamen können falsch dargestellt werden, allerdings werden die Dateien mit deren korrekten Namen gespeichert. =head2 Unicode-Beispiele Umwandlung von Windows UTF-16 (mit BOM) nach Unix UTF-8: dos2unix -n eingabe.txt ausgabe.txt Umwandlung von Windows UTF-16LE (ohne BOM) nach Unix UTF-8: dos2unix -ul -n eingabe.txt ausgabe.txt Umwandlung von Unix UTF-8 nach Windows UTF-8 mit BOM: unix2dos -m -n eingabe.txt ausgabe.txt Umwandlung von Unix UTF-8 nach Windows UTF-16: unix2dos < eingabe.txt | iconv -f UTF-8 -t UTF-16 > ausgabe.txt =head1 GB18030 GB18030 ist ein Standard der chinesischen Regierung. Eine Teilmenge des in GB18030 definierten Standards ist offiziell für alle in China verkauften Softwareprodukte vorgeschrieben. Siehe auch L. GB18030 ist vollständig zu Unicode kompatibel und kann als Unicode-Umwandlungsformat betrahctet werden. Wie auch UTF-8 ist GB18030 kompatibel zu ASCII. Ebenfalls kompatibel ist es zur Codepage 936 von Windows, auch als GBK bekannt. Unter Unix/Linux werden UTF-16-Dateien in GB18030 umgewandelt, wenn die Einstellung der Locale auf GB18030 gesetzt ist. Beachten Sie, dass dies nur funktioniert, wenn die Locale vom System unterstützt wird. Mit dem Befehl C erhalten Sie eine Liste der unterstützten Locales. Unter Windows benötigen Sie die Option C<-gb>, um UTF-16-Dateien in GB18030 umwandeln zu können. In GB 18030 kodierte Dateien haben wie Unicode-Dateien eine Markierung der Bytereihenfolge (BOM). =head1 BEISPIELE Aus der Standardeingabe lesen und in die Standardausgabe schreiben: dos2unix < a.txt cat a.txt | dos2unix a.txt umwandeln und ersetzen, b.txt umwandeln und ersetzen: dos2unix a.txt b.txt dos2unix -o a.txt b.txt a.txt im ascii-Modus umwandeln und ersetzen: dos2unix a.txt a.txt im ascii-Modus umwandeln und ersetzen, b.txt im 7bit-Modus umwandeln und ersetzen: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt a.txt aus dem Mac- in das Unix-Format umwandeln: dos2unix -c mac a.txt mac2unix a.txt a.txt aus dem Unix- in das Mac-Format umwandeln: unix2dos -c mac a.txt unix2mac a.txt a.txt unter Beibehaltung des ursprünglichen Zeitstempels umwandeln: dos2unix -k a.txt dos2unix -k -o a.txt a.txt umwandeln und das Ergebnis nach e.txt schreiben: dos2unix -n a.txt e.txt a.txt umwandeln und das Ergebnis nach e.txt schreiben, wobei e.txt den gleichen Zeitstempel erhält wie a.txt: dos2unix -k -n a.txt e.txt a.txt umwandeln und ersetzen, b.txt umwandeln und das Ergebnis nach e.txt schreiben: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt c.txt umwandeln und das Ergebnis nach e.txt schreiben, a.txt umwandeln und ersetzen, b.txt umwandeln und ersetzen, d.txt umwandeln und das Ergebnis nach f.txt schreiben: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 REKURSIVE UMWANDLUNG Verwenden Sie dos2unix zusammen mit den Befehlen find(1) und xargs(1), um Textdateien in einem Verzeichnisbaum rekursiv umzuwandeln. Um beispielsweise alle *.txt-Dateien im aktuellen Verzeichnis und dessen Unterverzeichnissen umzuwandeln, geben Sie Folgendes ein: find . -name '*.txt' |xargs dos2unix In einer Eingabeaufforderung kann der folgende Befehl verwendet werden: for /R %G in (*.txt) do dos2unix "%G" In der Windows PowerShell können Sie folgenden Befehl verwenden: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} =head1 LOKALISIERUNG =over 4 =item B Die primäre Sprache wird durch die Umgebungsvariable LANG festgelegt. Diese Variable besteht aus mehreren Teilen: Der erste Teil besteht aus zwei Kleinbuchstaben, die den Sprachcode angeben. Der zweite Teil ist optional und bezeichnet den Ländercode in Großbuchstaben, vom davor stehenden Sprachcode durch einen Unterstrich getrennt. Der dritte Teil ist ebenfalls optional und gibt die Zeichenkodierung an, vom Ländercode durch einen Punkt getrennt. Einige Beispiele für Standard-POSIX-Shells: export LANG=de Deutsch export LANG=de_DE Deutsch, Deutschland export LANG=de_AT Deutsch, Österreich export LANG=es_ES Spanisch, Spanien export LANG=es_MX Spanisch, Mexiko export LANG=en_US.iso88591 Englisch, USA, Latin-1-Zeichenkodierung export LANG=en_GB.UTF-8 Englisch, GB, UTF-8-Zeichenkodierung Eine vollständige Liste der Sprachen und Ländercodes finden Sie im Gettext-Handbuch: L Auf Unix-Systemen erhalten Sie mit dem Befehl locale(1) spezifische Informationen zu den Spracheinstellungen. =item B Mit der Umgebungsvariable LANGUAGE können Sie eine Prioritätenliste für Sprachen übergeben, die Sie durch Doppelpunkte voneinander trennen. Dos2unix gibt LANGUAGE vor LANG den Vorzug, zum Beispiel bei Deutsch vor Niederländisch: C. Sie müssen zunächst die Lokalisierung aktivieren, indem Sie die Variable LANG (oder LC_ALL) auf einen anderen Wert als »C« setzen, bevor Sie die Liste der Sprachprioritäten mit der Variable LANGUAGE nutzen können. Weitere Informationen finden Sie im Gettext-Handbuch: L Falls Sie eine Sprache auswählen, die nicht verfügbar ist, erhalten Sie die Standardmeldungen in englischer Sprache. =item B Durch die Umgebungsvariable DOS2UNIX_LOCALEDIR wird LOCALEDIR während der Kompilierung übergangen. LOCALEDIR wird verwendet, um Sprachdateien zu finden. Der GNU-Standardwert ist C. Die Option B<--version> zeigt das verwendete LOCALEDIR an. Beispiel (POSIX-Shell): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 RÜCKGABEWERT Bei Erfolg wird 0 zurückgegeben. Bei aufgetretenen Systemfehlern wird der letzte Systemfehler zurückgegeben. Für alle anderen Fehler wird 1 zurückgegeben. Der Rückgabewert ist im stillen Modus stets 0, außer wenn fehlerhafte Befehlszeilenoptionen verwendet werden. =head1 STANDARDS L L L L =head1 AUTOREN Benjamin Lin - , Bernd Johannes Wuebben (Mac2unix-Modus) - , Christian Wurll (Extra Zeilenumbruch) - , Erwin Waterlander - (Betreuer) Projektseite: L SourceForge-Seite: L =head1 SIEHE AUCH file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/de/man1/dos2unix.txt0000644000175500010010000007533412721132570017076 0ustar waterlanGeenBEZEICHNUNG dos2unix - Formatumwandlung für Textdateien von DOS/Mac nach Unix und umgekehrt ÜBERSICHT dos2unix [Optionen] [DATEI …] [-n EINGABEDATEI AUSGABEDATEI …] unix2dos [Optionen] [DATEI …] [-n EINGABEDATEI AUSGABEDATEI …] BESCHREIBUNG Das Paket Dos2unix enthält die Werkzeuge "dos2unix" und "unix2dos" zum Umwandeln einfacher Textdateien aus dem DOS- oder Mac-Format in das Unix-Format und umgekehrt. In Textdateien unter DOS/Windows sind Zeilenumbrüche, auch als neue Zeile (NL) bekannt, eine Kombination aus zwei Zeichen: einem Wagenrücklauf (Carriage Return, CR) gefolgt von einem Zeilenvorschub (Line Feed, LF). In Unix-Textdateien bestehen Zeilenumbrüche nur aus einem Zeichen, dem Zeilenvorschub (LF). In Mac-Textdateien aus der Zeit vor MacOSX bestand ein Zeilenumbruch aus einem einzelnen CR-Zeichen. Heute verwendet Mac OS Zeilenumbrüche im Unix-Stil (LF). Neben Zeilenumbrüchen kann Dos2unix auch die Zeichenkodierung von Dateien umwandeln. Einige DOS-Codepages können in Unix Latin-1 umgewandelt werden, und Windows-Unicode-Dateien (UTF-16) können in Unix-Unicode-Dateien (UTF-8) umgewandelt werden. Binärdateien werden automatisch übersprungen, sofern die Umwandlung nicht erzwungen wird. Nicht-reguläre Dateien, wie Verzeichnisse und FIFOS (Weiterleitungen) werden automatisch übersprungen. Symbolische Links und deren Ziele werden per Vorgabe unverändert belassen. Symbolische Links können optional ersetzt werden, oder die Ausgabe wird in das Ziel des symbolischen Links geschrieben. Unter Windows wird das Schreiben in das Ziel eines symbolischen Links nicht unterstützt. Dos2unix wurde nach dem Vorbild der dos2unix-Version unter SunOS/Solaris entwickelt, doch es gibt einen wesentlichen Unterschied zum Original: Diese Version ersetzt per Vorgabe Dateien bei der Umwandlung (Alte-Datei-Modus), während unter SunOS/Solaris nur die paarweise Umwandlung (Neue-Datei-Modus) unterstützt wird. Siehe dazu die Optionen "-o" und "-n". Ein weiterer Unterschied ist, dass die SunOS/Solaris-Version in der Voreinstellung die Umwandlung im *iso*-Modus vornimmt, während diese Version den *ascii*-Modus verwendet. OPTIONEN -- nimmt alle folgenden Optionen als Dateinamen an. Verwenden Sie diese Option, wenn Sie Dateien umwandeln wollen, deren Namen mit einem Minuszeichen beginnen. Um beispielsweise eine Datei namens »-bla« umzuwandeln, können Sie folgenden Befehl verwenden: dos2unix -- -bla oder im Neue-Datei-Modus: dos2unix -n -- -bla ausgabe.txt -ascii wandelt nur Zeilenumbrüche um. Dies ist der vorgegebene Umwandlungsmodus. -iso wandelt aus dem DOS- in den ISO-8859-1-Zeichensatz um. Weitere Informationen hierzu finden Sie im Abschnitt UMWANDLUNGSMODI. -1252 verwendet die Windows-Codepage 1252 (Westeuropäisch). -437 verwendet die DOS-Codepage 437 (US). Dies ist die vorgegebene Codepage für die ISO-Umwandlung. -850 verwendet die DOS-Codepage 850 (Westeuropäisch). -860 verwendet die DOS-Codepage 860 (Portugiesisch). -863 verwendet die DOS-Codepage 863 (Kanadisches Französisch). -865 verwendet die DOS-Codepage 865 (Skandinavisch). -7 wandelt 8bit-Zeichen in ein 7bit-Bitmuster um. -b, --keep-bom erhält die Markierung der Bytereihenfolge (BOM). Wenn die Eingabedatei eine BOM enthält, wird ebenfalls eine BOM in die Ausgabedatei geschrieben. Dies ist das Standardverhalten beim Umwandeln von DOS-Zeilenumbrüchen. Siehe auch die Option "-r". -c, --convmode UMWANDLUNGSMODUS legt den Umwandlungsmodus fest. UMWANDLUNGSMODUS kann *ascii*, *7bit*, *iso* oder *mac* sein, wobei *ascii* die Vorgabe ist. -D, --display-enc KODIERUNG legt die Kodierung des angezeigten Texts fest. KODIERUNG kann *ansi*, *unicode*, *unicodebom*, *utf8* oder sein, wobei *ansi* die Vorgabe ist. Diese Option ist nur in dos2unix für Windows mit Unterstützung für Unicode-Dateinamen verfügbar. Sie bleibt wirkungslos, wenn die tatsächlichen Dateinamen gelesen und geschrieben werden, lediglich bei der Darstellung wird sie berücksichtigt. Es gibt verschiedene Möglichkeiten, Text in einer Windows-Konsole basierend auf dessen Kodierung darzustellen. Alle haben verschiedene Vor- und Nachteile. ansi Die Standardmethode von dos2unix ist die Verwendung von ANSI-kodiertem Text, der Vorteil ist deren Abwärtskompatibilität. Dies funktioniert mit Raster- und TrueType-Schriften. In manchen Gebieten müssen Sie mit dem Befehl "chcp" die aktive DOS-OEM-Codepage in die -System-ANSI-Codepage des Systems ändern, da dos2unix Letztere verwendet. Der Nachteil von ANSI ist, dass internationale Dateinamen nicht korrekt dargestellt werden, wenn darin Zeichen enthalten sind, die nicht in der im System voreingestellten Codepage enthalten sind. Stattdessen wird entweder ein Fragezeichen oder ein falsches Zeichen angezeigt. Sofern Sie nicht mit fremden Dateinamen arbeiten, ist diese Methode in Ordnung. unicode, unicodebom Der Vorteil von Unicode (dem Windows-Namen für UTF-16) ist die üblicherweise korrekte Textdarstellung. Eine Änderung der aktiven Codepage ist nicht erforderlich. Sie müssen die Schriftart der Konsole auf eine TrueType-Schrift einstellen, damit internationale Zeichen richtig angezeigt werden können. Sollte ein Zeichen in einer TrueType-Schrift nicht enthalten sein, wird ein kleines Quadrat angezeigt, das gelegentlich noch ein Fragezeichen enthält. Wenn Sie die ConEmu-Konsole nutzen, wird der gesamte Text korrekt dargestellt, da ConEmu automatisch eine passende Schrift wählt. Nachteilig für Unicode ist, dass es nicht zu ASCII kompatibel ist. Die Ausgabe ist schwer zu verarbeiten, wenn sie in ein anderes Programm oder eine Datei weitergeleitet wird. Wenn die Methode "unicodebom" verwendet wird, dann wird dem Unicode-Text eine BOM (Markierung der Bytereihenfolge) vorangestellt. Eine BOM ist ist für korrekte um- oder Weiterleitung in der PowerShell notwendig. utf8, utf8bom Der Vorteil von UTF-8 ist die ASCII-Kompatibilität. Sie müssen die Schriftart der Konsole auf eine TrueType-Schrift setzen. Dadurch wird der Text ähnlich wie in der "unicode"-Kodierung dargestellt. Der Nachteil ist die falsche Darstellung aller Nicht-ASCII-Zeichen, wenn Sie die Standard-Rasterschrift verwenden. Nicht nur Unicode-Dateinamen, sondern auch übersetzte Meldungen werden unlesbar. Auf einem Windows-System, das für eine ostasiatische Region eingerichtet wurde, wird die Konsole bei der Anzeige von Meldungen deutlich flackern. In einer ConEmu-Konsole funktioniert die UTF-8-Kodierung gut. Wenn die Methode "utf8bom" verwendet wird, dann wird dem UTF-8-Text eine BOM (Markierung der Bytereihenfolge) vorangestellt. Eine BOM ist ist für korrekte um- oder Weiterleitung in der PowerShell notwendig. Die Standardkodierung kann durch Setzen der Umgebungsvariable DOS2UNIX_DISPLAY_ENC auf "unicode", "unicodebom", "utf8" oder "utf8" geändert werden. -f, --force erzwingt die Umwandlung von Binärdateien. -gb, --gb18030 wandelt unter Windows UTF-16-Dateien standardmäßig in UTF-8 um, ungeachtet der Einstellung der Locale. Verwenden Sie diese Option zum umwandeln von Utf-16-Dateien in GB18030. Diese Option ist nur unter Windows verfügbar. Siehe auch Abschnitt GB18030. -h, --help zeigt eine Hilfe an und beendet das Programm. -i[SCHALTER], --info[=SCHALTER] DATEI zeigt Dateiinformationen an. Es wird keine Umwandlung vorgenommen. Die Ausgabe der Informationen geschieht in der folgenden Reihenfolge: Anzahl der DOS-Zeilenumbrüche, Anzahl der Unix-Zeilenumbrüche, Anzahl der Mac-Zeilenumbrüche, Markierung der Bytereihenfolge, Text- oder Binärformat, Dateiname. Beispielausgabe: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Beachten sie, dass manchmal eine Binärdatei fälschlicherweise als Textdatei erkannt wird. Siehe auch Option "-s". Optionale zusätzliche Schalter können gesetzt werden, um die Ausgabe anzupassen. Einer oder mehrere Schalter können hinzugefügt werden. d gibt die Anzahl der DOS-Zeilenumbrüche aus. u gibt die Anzahl der Unix-Zeilenumbrüche aus. m gibt die Anzahl der Mac-Zeilenumbrüche aus. b gibt die Markierung der Bytereihenfolge aus. t zeigt an, ob es sich um eine Text- oder eine Binärdatei handelt. c gibt nur die Dateien aus, die umgewandelt werden würden. Mit dem Schalter "c" gibt dos2unix nur die Dateien aus, die DOS-Zeilenumbrüche enthalten, unix2dos nur die Dateien mit Unix-Zeilenumbrüchen. h gibt eine Kopfzeile aus. p zeigt Dateinamen ohne Pfade an. Beispiele: Informationen zu allen *.txt-Dateien anzeigen: dos2unix -i *.txt Nur die Anzahl der DOS-Zeilenumbrüche und Unix-Zeilenumbrüche anzeigen: dos2unix -idu *.txt Nur die Markierung der Bytereihenfolge anzeigen: dos2unix --info=b *.txt Die Dateien auflisten, die DOS-Zeilenumbrüche enthalten: dos2unix -ic *.txt Die Dateien auflisten, die Unix-Zeilenumbrüche enthalten: unix2dos -ic *.txt Nur Dateien umwandeln, die DOS-Zeilenumbrüche enthalten und die anderen Dateien unverändert belassen: find . -name '*.txt' |xargs dos2unix Nach Textdateien suchen, die DOS-Zeilenumbrüche enthalten: find . -name '*.txt' |xargs dos2unix -k, --keepdate übernimmt den Zeitstempel der Eingabedatei in die Ausgabedatei. -L, --license zeigt die Lizenz des Programms an. -l, --newline fügt eine zusätzliche neue Zeile hinzu. dos2unix: Nur DOS-Zeilenumbrüche werden in Unix-Zeilenumbrüche umgewandelt. Im Mac-Modus werden nur Mac-Zeilenumbrüche in Unix-Zeilenumbrüche umgewandelt. unix2dos: Nur Unix-Zeilenumbrüche werden in DOS-Zeilenumbrüche umgewandelt. Im Mac-Modus werden nur Unix-Zeilenumbrüche in Mac-Zeilenumbrüche umgewandelt. -m, --add-bom schreibt eine Markierung der Bytereihenfolge (BOM) in die Ausgabedatei. In der Voreinstellung wird eine UTF-8-BOM geschrieben. Wenn die Eingabedatei in UTF-16 kodiert ist und die Option "-u" verwendet wird, wird eine UTF-16-BOM geschrieben. Verwenden Sie diese Option niemals, wenn die Kodierung der Ausgabedatei nicht UTF-8, UTF-16 oder GB 18030 ist. Weitere Informationen finden Sie im Abschnitt UNICODE. -n, --newfile EINGABEDATEI AUSGABEDATEI … Neue-Datei-Modus. Die EINGABEDATEI wird umgewandelt und in die AUSGABEDATEI geschrieben. Die Dateinamen müssen paarweise angegeben werden. Platzhalter sollten *nicht* verwendet werden, sonst werden Sie Ihre Dateien *verlieren*. Der Benutzer, der die Umwandlung im Neue-Datei-Modus startet, wird Besitzer der umgewandelten Datei. Die Lese- und Schreibrechte werden aus den Zugriffsrechten der Originaldatei minus der umask(1) der Person ermittelt, die die Umwandlung ausgeführt hat. -o, --oldfile DATEI … Alte-Datei-Modus. Die DATEI wird umgewandelt und durch die Ausgabedatei überschrieben. Per Vorgabe werden Umwandlungen in diesem Modus ausgeführt. Platzhalter sind verwendbar. Im Alte-Datei-Modus (Ersetzungsmodus) erhalten die umgewandelten Dateien den gleichen Eigentümer, die gleiche Gruppe und die gleichen Lese- und Schreibberechtigungen wie die Originaldatei, auch wenn die Datei von einem anderen Benutzer umgewandelt wird, der Schreibrechte für die Datei hat (zum Beispiel der Systemadministrator). Die Umwandlung wird abgebrochen, wenn es nicht möglich ist, die originalen Werte beizubehalten. Die Änderung des Eigentümers könnte zum Beispiel bewirken, dass der ursprüngliche Eigentümer die Datei nicht mehr lesen kann. Die Änderung der Gruppe könnte ein Sicherheitsrisiko sein, da die Datei vielleicht für Benutzer lesbar wird, für die sie nicht bestimmt ist. Die Beibehaltung von Eigentümer, Gruppe und Schreib- und Leserechten wird nur unter Unix unterstützt. -q, --quiet Stiller Modus, in dem alle Warnungen und sonstige Meldungen unterdrückt werden. Der Rückgabewert ist 0, außer wenn fehlerhafte Befehlszeilenoptionen angegeben werden. -r, --remove-bom entfernt die Markierung der Bytereihenfolge (BOM). Es wird keine BOM in die Ausgabedatei geschrieben. Dies ist das Standardverhalten beim Umwandeln von Unix-Zeilenumbrüchen. Siehe auch die Option "-b". -s, --safe überspringt Binärdateien (Vorgabe). Binärdateien werden übersprungen, damit unerwünschtes Fehlverhalten vermieden wird. Denken Sie daran, dass die Erkennung nicht 100% sicher funktioniert. Die übergebenen Dateien werden auf Binärsymbole überprüft, die typischerweise in Textdateien nicht vorkommen. Es ist jedoch möglich, dass eine Binärdatei ausschließlich gewöhnliche Textzeichen enthält. Eine solche Binärdatei wird dann fälschlicherweise als Textdatei angesehen. -u, --keep-utf16 erhält die originale UTF-16-Kodierung der Eingabedatei. Die Ausgabedatei wird in der gleichen UTF-16-Kodierung geschrieben (Little-Endian- oder Big-Endian-Bytereihenfolge) wie die Eingabedatei. Dies verhindert die Umwandlung in UTF-8. Eine UTF-16-BOM wird dementsprechend geschrieben. Diese Option kann durch Angabe der Option "-ascii" deaktiviert werden. -ul, --assume-utf16le nimmt an, dass die Eingabedatei das Format UTF-16LE hat. Wenn die Eingabedatei eine Markierung der Bytereihenfolge enthält (BOM), dann hat die BOM Vorrang vor dieser Option. Durch eine falsche Annahme (die Eingabedatei war nicht in UTF-16LE kodiert) mit erfolgreicher Umwandlung erhalten Sie eine UTF-8-Ausgabedatei mit fehlerhaftem Text. Sie können die fehlgeschlagene Umwandlung mit iconv(1) rückgängig machen, indem Sie die Rückumwandlung von UTF-8 nach UTF-16LE vornehmen. Dadurch gewinnen Sie die Originaldatei zurück. Die Annahme von UTF-16LE wirkt wie ein *Umwandlungsmodus*. Beim Wechsel zum vorgegebenen *ascii*-Modus wird die UTF16LE-Annahme deaktiviert. -ub, --assume-utf16be nimmt an, dass die Eingabedatei das Format UTF-16BE hat. Diese Option ist gleichbedeutend mit "-ul". -v, --verbose zeigt ausführliche Meldungen an. Zusätzliche Informationen werden zu den Markierungen der Bytereihenfolge (BOM) und zur Anzahl der umgewandelten Zeilenumbrüche angezeigt. -F, --follow-symlink folgt symbolischen Links und wandelt die Zieldateien um. -R, --replace-symlink ersetzt symbolische Links durch die umgewandelten Dateien (die originalen Zieldateien bleiben unverändert). -S, --skip-symlink erhält symbolische Links als solche und lässt die Ziele unverändert (Vorgabe). -V, --version zeigt Versionsinformationen an und beendet das Programm. MAC-MODUS Im Normalmodus werden Zeilenumbrüche von DOS nach Unix und umgekehrt umgewandelt. Mac-Zeilenumbrüche werden nicht verändert. Im Mac-Modus werden Zeilenumbrüche von Mac nach Unix und umgekehrt umgewandelt. DOS-Zeilenumbrüche werden nicht verändert. Um das Programm im Mac-Modus auszuführen, verwenden Sie die Befehlszeilenoption "-c mac" oder die Befehle "mac2unix" oder "unix2mac". UMWANDLUNGSMODI ascii Im "ascii"-Modus werden nur Zeilenumbrüche umgewandelt. Dies ist der vorgegebene Umwandlungsmodus. Obwohl der Name dieses Modus auf ASCII hinweist, welches ein 7-bit-Standard ist, bezieht sich der eigentliche Modus auf 8 Bit. Verwenden Sie diesen Modus immer dann, wenn Sie Unicode-Dateien in UTF-8-Kodierung umwandeln. 7bit In diesem Modus werden alle Nicht-ASCII-Zeichen aus 8 Bit in das 7-Bit-Bitmuster umgewandelt. iso Die Zeichen werden aus dem DOS-Zeichensatz (der Codepage) in den ISO-Zeichensatz ISO-8859-1 (Latin-1) in Unix umgewandelt. DOS-Zeichen ohne Äquivalent in ISO-8859-1, für die die Umwandlung nicht möglich ist, werden durch einen Punkt ersetzt. Gleiches gilt für ISO-8859-1-Zeichen ohne DOS-Gegenstück. Wenn nur die Option "-iso" angegeben ist, versucht dos2unix die aktive Codepage selbst zu ermitteln. Sollte dies nicht möglich sein, wird die Standard-Codepage CP437 verwendet, welche hauptsächlich in den USA eingesetzt wird. Um eine bestimmte Codepage zu erzwingen, verwenden Sie die Optionen -437 (US), -850 (Westeuropäisch), -860 (Portugiesisch), -863 (Kanadisches Französisch) oder -865 (Skandinavisch). Die Windows-Codepage CP1252 (Westeuropäisch) wird durch die Option -1252 unterstützt. Wenden Sie niemals die ISO-Umwandlung auf Unicode-Textdateien an. In UTF-8 kodierte Dateien werden dadurch beschädigt. Einige Beispiele: Umwandlung aus der vorgegebenen DOS-Codepage nach Unix Latin-1: dos2unix -iso -n in.txt ausgabe.txt Umwandlung von DOS CP850 nach Unix Latin-1: dos2unix -850 -n eingabe.txt ausgabe.txt Umwandlung von Windows CP1252 nach Unix Latin-1: dos2unix -1252 -n eingabe.txt ausgabe.txt Umwandlung von Windows CP1252 nach Unix UTF-8 (Unicode): iconv -f CP1252 -t UTF-8 eingabe.txt | dos2unix > ausgabe.txt Umwandlung von Unix Latin-1 in die vorgegebene DOS-Codepage: unix2dos -iso -n eingabe.txt ausgabe.txt Umwandlung von Unix Latin-1 nach DOS CP850: unix2dos -850 -n eingabe.txt ausgabe.txt Umwandlung von Unix Latin-1 nach Windows CP1252: unix2dos -1252 -n eingabe.txt ausgabe.txt Umwandlung von Unix UTF-8 (Unicode) nach Windows CP1252: unix2dos < eingabe.txt | iconv -f UTF-8 -t CP1252 > ausgabe.txt Siehe auch und . UNICODE Zeichenkodierungen Es gibt verschiedene Unicode-Zeichenkodierungen. Unter Unix und Linux sind Unicode-Dateien typischerweise in UTF-8 kodiert. Unter Windows können Textdateien in UTF-8, UTF-16 oder UTF-16 in Big-Endian-Bytereihenfolge kodiert sein, liegen aber meist im Format UTF-16 vor. Umwandlung Unicode-Textdateien können DOS-, Unix- oder Mac-Zeilenumbrüche enthalten, so wie reguläre Textdateien. Alle Versionen von dos2unix und unix2dos können UTF-8-kodierte Dateien umwandeln, weil UTF-8 im Hinblick auf Abwärtskompatiblität mit ASCII entwickelt wurde. Dos2unix und unix2dos mit Unterstützung für UTF-16 können in UTF-16 kodierte Dateien in Little-Endian- und Big-Endian-Bytereihenfolge lesen. Um festzustellen, ob dos2unix mit UTF-16-Unterstützung kompiliert wurde, geben Sie "dos2unix -V" ein. Unter Unix/Linux werden UTF-16 kodierte Dateien standardmäßig in die Zeichenkodierung entsprechend der Locale umgewandelt. Mit dem Befehl locale(1) können Sie herausfinden, wie die Zeichenkodierung der Locale eingestellt ist. Wenn eine Umwandlung nicht möglich ist, verursacht dies einen Umwandlungsfehler, wodurch die Datei übersprungen wird. Unter Windows werden UTF-16-Dateien standardmäßig in UTF-8 umgewandelt. In UTF-8 formatierte Textdateien werden von Windows und Unix/Linux gleichermaßen unterstützt. Die Kodierungen UTF-16 und UTF-8 sind vollständig kompatibel, daher wird bei der Umwandlung keinerlei Text verlorengehen. Sollte bei der Umwandlung von UTF-16 in UTF-8 ein Problem auftreten, beispielsweise wenn die UTF-16-kodierte Eingabedatei einen Fehler enthält, dann wird diese Datei übersprungen. Wenn die Option "-u" verwendet wird, wird die Ausgabedatei in der gleichen UTF-16-Kodierung wie die Eingabedatei geschrieben. Die Option "-u" verhindert die Umwandlung in UTF-8. Dos2unix und unix2dos bieten keine Option zur Umwandlung von UTF-8-Dateien in UTF-16. Umwandlungen im ISO- und 7bit-Modus funktionieren mit UTF-16-Dateien nicht. Markierung der Bytereihenfolge Unicode-Textdateien unter Windows haben typischerweise eine Markierung der Bytereihenfolge (BOM), da viele Windows-Programme (zum Beispiel Notepad) solche BOMs standardmäßig hinzufügen. Weitere Informationen hierzu finden Sie auf . Unter Unix haben Textdateien üblicherweise keine BOM. Es wird stattdessen angenommen, dass Textdateien in der Zeichenkodierung entsprechend der Spracheinstellung vorliegen. Dos2unix kann nur dann erkennen, ob eine Datei UTF-16-kodiert ist, wenn die Datei eine BOM enthält. Ist dies nicht der Fall, nimmt dos2unix an, dass es sich um eine Binärdatei handelt. Verwenden Sie die Optionen "-ul" oder "-ub", um eine UTF-16-Datei ohne BOM umzuwandeln. Dos2unix schreibt in der Voreinstellung keine BOM in die Ausgabedatei. Mit der Option "-b" schreibt Dos2unix eine BOM, wenn die Eingabedatei ebenfalls eine BOM hat. Unix2dos schreibt in der Voreinstellung eine BOM in die Ausgabedatei, wenn die Eingabedatei ebenfalls eine solche Markierung hat. Verwenden Sie die Option "-r", um die BOM zu entfernen. Dos2unix und unix2dos schreiben immer eine BOM, wenn die Option "-m" angegeben ist. Unicode-Dateinamen unter Windows Dos2unix verfügt über optionale Unterstützung für das Lesen und Schreiben von Unicode-Dateinamen in der Windows-Eingabeaufforderung. Dadurch kann dos2unix Dateien öffnen, deren Namen Zeichen enthalten, die nicht zur Standard-ANSI-Codepage des Systems gehören. Geben Sie "dos2unix -V" ein, um zu sehen, ob dos2unix für Windows mit Unterstützung für Unicode-Dateinamen erstellt wurde. Die Anzeige von Unicode-Dateinamen in einer Windows-Konsole ist gelegentlich nicht fehlerfrei, siehe die Option "-D", "--display-enc". Die Dateinamen können falsch dargestellt werden, allerdings werden die Dateien mit deren korrekten Namen gespeichert. Unicode-Beispiele Umwandlung von Windows UTF-16 (mit BOM) nach Unix UTF-8: dos2unix -n eingabe.txt ausgabe.txt Umwandlung von Windows UTF-16LE (ohne BOM) nach Unix UTF-8: dos2unix -ul -n eingabe.txt ausgabe.txt Umwandlung von Unix UTF-8 nach Windows UTF-8 mit BOM: unix2dos -m -n eingabe.txt ausgabe.txt Umwandlung von Unix UTF-8 nach Windows UTF-16: unix2dos < eingabe.txt | iconv -f UTF-8 -t UTF-16 > ausgabe.txt GB18030 GB18030 ist ein Standard der chinesischen Regierung. Eine Teilmenge des in GB18030 definierten Standards ist offiziell für alle in China verkauften Softwareprodukte vorgeschrieben. Siehe auch . GB18030 ist vollständig zu Unicode kompatibel und kann als Unicode-Umwandlungsformat betrahctet werden. Wie auch UTF-8 ist GB18030 kompatibel zu ASCII. Ebenfalls kompatibel ist es zur Codepage 936 von Windows, auch als GBK bekannt. Unter Unix/Linux werden UTF-16-Dateien in GB18030 umgewandelt, wenn die Einstellung der Locale auf GB18030 gesetzt ist. Beachten Sie, dass dies nur funktioniert, wenn die Locale vom System unterstützt wird. Mit dem Befehl "locale -a" erhalten Sie eine Liste der unterstützten Locales. Unter Windows benötigen Sie die Option "-gb", um UTF-16-Dateien in GB18030 umwandeln zu können. In GB 18030 kodierte Dateien haben wie Unicode-Dateien eine Markierung der Bytereihenfolge (BOM). BEISPIELE Aus der Standardeingabe lesen und in die Standardausgabe schreiben: dos2unix < a.txt cat a.txt | dos2unix a.txt umwandeln und ersetzen, b.txt umwandeln und ersetzen: dos2unix a.txt b.txt dos2unix -o a.txt b.txt a.txt im ascii-Modus umwandeln und ersetzen: dos2unix a.txt a.txt im ascii-Modus umwandeln und ersetzen, b.txt im 7bit-Modus umwandeln und ersetzen: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt a.txt aus dem Mac- in das Unix-Format umwandeln: dos2unix -c mac a.txt mac2unix a.txt a.txt aus dem Unix- in das Mac-Format umwandeln: unix2dos -c mac a.txt unix2mac a.txt a.txt unter Beibehaltung des ursprünglichen Zeitstempels umwandeln: dos2unix -k a.txt dos2unix -k -o a.txt a.txt umwandeln und das Ergebnis nach e.txt schreiben: dos2unix -n a.txt e.txt a.txt umwandeln und das Ergebnis nach e.txt schreiben, wobei e.txt den gleichen Zeitstempel erhält wie a.txt: dos2unix -k -n a.txt e.txt a.txt umwandeln und ersetzen, b.txt umwandeln und das Ergebnis nach e.txt schreiben: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt c.txt umwandeln und das Ergebnis nach e.txt schreiben, a.txt umwandeln und ersetzen, b.txt umwandeln und ersetzen, d.txt umwandeln und das Ergebnis nach f.txt schreiben: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt REKURSIVE UMWANDLUNG Verwenden Sie dos2unix zusammen mit den Befehlen find(1) und xargs(1), um Textdateien in einem Verzeichnisbaum rekursiv umzuwandeln. Um beispielsweise alle *.txt-Dateien im aktuellen Verzeichnis und dessen Unterverzeichnissen umzuwandeln, geben Sie Folgendes ein: find . -name '*.txt' |xargs dos2unix In einer Eingabeaufforderung kann der folgende Befehl verwendet werden: for /R %G in (*.txt) do dos2unix "%G" In der Windows PowerShell können Sie folgenden Befehl verwenden: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} LOKALISIERUNG LANG Die primäre Sprache wird durch die Umgebungsvariable LANG festgelegt. Diese Variable besteht aus mehreren Teilen: Der erste Teil besteht aus zwei Kleinbuchstaben, die den Sprachcode angeben. Der zweite Teil ist optional und bezeichnet den Ländercode in Großbuchstaben, vom davor stehenden Sprachcode durch einen Unterstrich getrennt. Der dritte Teil ist ebenfalls optional und gibt die Zeichenkodierung an, vom Ländercode durch einen Punkt getrennt. Einige Beispiele für Standard-POSIX-Shells: export LANG=de Deutsch export LANG=de_DE Deutsch, Deutschland export LANG=de_AT Deutsch, Österreich export LANG=es_ES Spanisch, Spanien export LANG=es_MX Spanisch, Mexiko export LANG=en_US.iso88591 Englisch, USA, Latin-1-Zeichenkodierung export LANG=en_GB.UTF-8 Englisch, GB, UTF-8-Zeichenkodierung Eine vollständige Liste der Sprachen und Ländercodes finden Sie im Gettext-Handbuch: Auf Unix-Systemen erhalten Sie mit dem Befehl locale(1) spezifische Informationen zu den Spracheinstellungen. LANGUAGE Mit der Umgebungsvariable LANGUAGE können Sie eine Prioritätenliste für Sprachen übergeben, die Sie durch Doppelpunkte voneinander trennen. Dos2unix gibt LANGUAGE vor LANG den Vorzug, zum Beispiel bei Deutsch vor Niederländisch: "LANGUAGE=de:nl". Sie müssen zunächst die Lokalisierung aktivieren, indem Sie die Variable LANG (oder LC_ALL) auf einen anderen Wert als »C« setzen, bevor Sie die Liste der Sprachprioritäten mit der Variable LANGUAGE nutzen können. Weitere Informationen finden Sie im Gettext-Handbuch: Falls Sie eine Sprache auswählen, die nicht verfügbar ist, erhalten Sie die Standardmeldungen in englischer Sprache. DOS2UNIX_LOCALEDIR Durch die Umgebungsvariable DOS2UNIX_LOCALEDIR wird LOCALEDIR während der Kompilierung übergangen. LOCALEDIR wird verwendet, um Sprachdateien zu finden. Der GNU-Standardwert ist "/usr/local/share/locale". Die Option --version zeigt das verwendete LOCALEDIR an. Beispiel (POSIX-Shell): export DOS2UNIX_LOCALEDIR=$HOME/share/locale RÜCKGABEWERT Bei Erfolg wird 0 zurückgegeben. Bei aufgetretenen Systemfehlern wird der letzte Systemfehler zurückgegeben. Für alle anderen Fehler wird 1 zurückgegeben. Der Rückgabewert ist im stillen Modus stets 0, außer wenn fehlerhafte Befehlszeilenoptionen verwendet werden. STANDARDS AUTOREN Benjamin Lin - , Bernd Johannes Wuebben (Mac2unix-Modus) - , Christian Wurll (Extra Zeilenumbruch) - , Erwin Waterlander - (Betreuer) Projektseite: SourceForge-Seite: SIEHE AUCH file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/es/0000755000175500010010000000000012721132565013735 5ustar waterlanGeendos2unix-7.3.4/man/es/man1/0000755000175500010010000000000012721132613014563 5ustar waterlanGeendos2unix-7.3.4/man/es/man1/dos2unix.10000644000175500010010000010366412721132566016441 0ustar waterlanGeen.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dos2unix 1" .TH dos2unix 1 "2016-05-24" "dos2unix" "2016-05-24" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NOMBRE" .IX Header "NOMBRE" dos2unix \- Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa .SH "SINOPSIS" .IX Header "SINOPSIS" .Vb 2 \& dos2unix [parámetros] [ARCHIVO ...] [\-n ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...] \& unix2dos [parámetros] [ARCHIVO ...] [\-n ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...] .Ve .SH "DESCRIPCIÓN" .IX Header "DESCRIPCIÓN" El paquete Dos2unix incluye las herramientas \f(CW\*(C`dos2unix\*(C'\fR y \f(CW\*(C`unix2dos\*(C'\fR para convertir archivos de texto plano en formato \s-1DOS\s0 o Mac a formato Unix y viceversa. .PP En archivos de texto DOS/Windows, un salto de línea, también conocido como nueva línea, es una combinación de dos caracteres: un retorno de carro (\s-1CR\s0) seguido por un salto de línea (\s-1LF\s0). En archivos de texto Unix, un salto de línea es solamente un carácter: el salto de línea (\s-1LF\s0). En archivos de texto Mac, antes de Mac \s-1OS X,\s0 un salto de línea era sólo un carácter retorno de carro (\s-1CR\s0). Actualmente, Mac \s-1OS\s0 usa el estilo Unix de saltos de línea (\s-1LF\s0). .PP Además de saltos de línea, Dos2unix puede también convertir la codificación de archivos. Unas cuantas páginas de códigos \s-1DOS\s0 pueden ser convertidas a Unix Latin\-1. Y archivos Unicode de Windows (\s-1UTF\-16\s0) pueden ser convertidos a archivos Unicode de Unix (\s-1UTF\-8\s0). .PP Los archivos binarios son ignorados automáticamente, a menos que se fuerce su conversión. .PP Los archivos no regulares, tales como directorios y \s-1FIFO,\s0 son ignorados automáticamente. .PP Los enlaces simbólicos y sus destinos no son modificados por defecto. Los enlaces simbólicos pueden opcionalmente ser reemplazados, o la salida puede ser escrita al destino simbólico del enlace. En Windows no está soportada la escritura a enlaces simbólicos. .PP Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options \f(CW\*(C`\-o\*(C'\fR and \f(CW\*(C`\-n\*(C'\fR. Another difference is that the SunOS/Solaris version uses by default \fIiso\fR mode conversion while this version uses by default \fIascii\fR mode conversion. .SH "PARÁMETROS" .IX Header "PARÁMETROS" .IP "\fB\-\-\fR" 4 .IX Item "--" Todos los parámetros siguientes son tratados como nombres de archivo. Use este parámetro si desea convertir archivos cuyos nombres inician con un guión. Por ejemplo para convertir un archivoo llamado \*(L"\-foo\*(R", use este comando: .Sp .Vb 1 \& dos2unix \-\- \-foo .Ve .Sp O en modo de archivo nuevo: .Sp .Vb 1 \& dos2unix \-n \-\- \-foo out.txt .Ve .IP "\fB\-ascii\fR" 4 .IX Item "-ascii" Sólo convierte los salto de línea. Éste es el modo de conversión por defecto. .IP "\fB\-iso\fR" 4 .IX Item "-iso" Conversión entre el conjunto de caracteres \s-1DOS\s0 e \s-1ISO\-8859\-1.\s0 Véase también la sección \s-1MODOS DE\s0 CONVERSIÓN. .IP "\fB\-1252\fR" 4 .IX Item "-1252" Usa la página de códigos Windows 1252 (Europa Occidental). .IP "\fB\-437\fR" 4 .IX Item "-437" Usa la página de códigos \s-1DOS 437 \s0(\s-1EE. UU.\s0). Está es la página de códigos usada por defecto para conversión \s-1ISO.\s0 .IP "\fB\-850\fR" 4 .IX Item "-850" Usa la página de códigos \s-1DOS 850 \s0(Europa Occidental). .IP "\fB\-860\fR" 4 .IX Item "-860" Usa la página de códigos \s-1DOS 860 \s0(Portugués). .IP "\fB\-863\fR" 4 .IX Item "-863" Usa la página de códigos \s-1DOS 863 \s0(Francocanadiense). .IP "\fB\-865\fR" 4 .IX Item "-865" Usa la página de códigos \s-1DOS 865 \s0(Nórdico). .IP "\fB\-7\fR" 4 .IX Item "-7" Convierte caracteres de 8 bits al espacio de 7 bits. .IP "\fB\-b, \-\-keep\-bom\fR" 4 .IX Item "-b, --keep-bom" Mantiene la Marca de Orden de Byte (\s-1BOM\s0). Cuando el archivo de entrada tiene \s-1BOM,\s0 escribe \s-1BOM\s0 en el archivo de salida. Este es el comportamiento por defecto en la conversión a saltos de línea \s-1DOS.\s0 Vea también la opción \&\f(CW\*(C`\-r\*(C'\fR. .IP "\fB\-c, \-\-convmode \s-1CONVMODE\s0\fR" 4 .IX Item "-c, --convmode CONVMODE" Establece el modo de conversión, Donde \s-1CONVMODE\s0 puede ser: \fIascii\fR, \&\fI7bit\fR, \fIiso\fR, \fImac\fR siendo ascii el valor por defecto. .IP "\fB\-D, \-\-display\-enc \s-1ENCODING\s0\fR" 4 .IX Item "-D, --display-enc ENCODING" Set encoding of displayed text. Where \s-1ENCODING\s0 is one of: \fIansi\fR, \&\fIunicode\fR, \fIunicodebom\fR, \fIutf8\fR, \fIutf8bom\fR with ansi being the default. .Sp This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed. .Sp There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages. .RS 4 .IP "\fBansi\fR" 4 .IX Item "ansi" Dos2unix's default method is to use \s-1ANSI\s0 encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active \s-1DOS OEM\s0 code page to the Windows system \s-1ANSI\s0 code page using the \f(CW\*(C`chcp\*(C'\fR command, because dos2unix uses the Windows system code page. .Sp The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is \s-1OK.\s0 .IP "\fBunicode, unicodebom\fR" 4 .IX Item "unicode, unicodebom" The advantage of unicode (the Windows name for \s-1UTF\-16\s0) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it. .Sp When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font. .Sp The disadvantage of unicode is that it is not compatible with \s-1ASCII.\s0 The output is not easy to handle when you redirect it to another program. .Sp When method \f(CW\*(C`unicodebom\*(C'\fR is used the Unicode text will be preceded with a \&\s-1BOM \s0(Byte Order Mark). A \s-1BOM\s0 is required for correct redirection or piping in PowerShell. .IP "\fButf8, utf8bom\fR" 4 .IX Item "utf8, utf8bom" The advantage of utf8 is that it is compatible with \s-1ASCII.\s0 You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the \f(CW\*(C`unicode\*(C'\fR encoding. .Sp The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed. .Sp In a ConEmu console the utf8 encoding method works well. .Sp When method \f(CW\*(C`utf8bom\*(C'\fR is used the \s-1UTF\-8\s0 text will be preceded with a \s-1BOM \&\s0(Byte Order Mark). A \s-1BOM\s0 is required for correct redirection or piping in PowerShell. .RE .RS 4 .Sp The default encoding can be changed with environment variable \&\s-1DOS2UNIX_DISPLAY_ENC\s0 by setting it to \f(CW\*(C`unicode\*(C'\fR, \f(CW\*(C`unicodebom\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR, or \&\f(CW\*(C`utf8bom\*(C'\fR. .RE .IP "\fB\-f, \-\-force\fR" 4 .IX Item "-f, --force" Fuerza la conversión de archivos binarios. .IP "\fB\-gb, \-\-gb18030\fR" 4 .IX Item "-gb, --gb18030" En Windows los archivos \s-1UTF\-16\s0 se convierten por defecto a \s-1UTF\-8,\s0 sin tener en cuenta la configuración local. Use esta opción para convertir archivos \&\s-1UTF\-16\s0 a \s-1GB18030.\s0 Esta opción sólo está disponible en Windows.l Véase también la sección \s-1GB18030.\s0 .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Despiega la ayuda y termina el programa. .IP "\fB\-i[\s-1MARCAS\s0], \-\-info[= \s-1MARCAS\s0] \s-1ARCHIVO ...\s0\fR" 4 .IX Item "-i[MARCAS], --info[= MARCAS] ARCHIVO ..." Muestra la información del archivo. No se realiza ninguna conversión. .Sp Se muestra la siguiente información, en este orden: número de saltos de línea \s-1DOS,\s0 número de saltos de línea Unix, número de saltos de línea Mac, Marca de Orden de Byte, de texto o binario, nombre del archivo. .Sp Ejemplo de salida: .Sp .Vb 8 \& 6 0 0 no_bom text dos.txt \& 0 6 0 no_bom text unix.txt \& 0 0 6 no_bom text mac.txt \& 6 6 6 no_bom text mixed.txt \& 50 0 0 UTF\-16LE text utf16le.txt \& 0 50 0 no_bom text utf8unix.txt \& 50 0 0 UTF\-8 text utf8dos.txt \& 2 418 219 no_bom binary dos2unix.exe .Ve .Sp Note that sometimes a binary file can be mistaken for a text file. See also option \f(CW\*(C`\-s\*(C'\fR. .Sp Se pueden utilizar marcas extras opcionales para modificar la salida. Se pueden añadir una o más marcas. .RS 4 .IP "\fBd\fR" 4 .IX Item "d" Muestra el número de saltos de línea \s-1DOS.\s0 .IP "\fBu\fR" 4 .IX Item "u" Muestra el número de saltos de línea Unix. .IP "\fBm\fR" 4 .IX Item "m" Muestra el número de saltos de línea Mac. .IP "\fBb\fR" 4 .IX Item "b" Muestra la Marca de Orden de Byte. .IP "\fBt\fR" 4 .IX Item "t" Muestra si el archivo es de texto o binario. .IP "\fBc\fR" 4 .IX Item "c" Muestra sólo los archivos que pueden ser convertidos. .Sp Con la marca \f(CW\*(C`c\*(C'\fR dos2unix sólo mostrará los archivos que contengan saltos de línea \s-1DOS,\s0 unix2dos sólo mostrará los nombres de archivo que tengan saltos de línea Unix. .IP "\fBh\fR" 4 .IX Item "h" Print a header. .IP "\fBp\fR" 4 .IX Item "p" Show file names without path. .RE .RS 4 .Sp Ejemplos: .Sp Muestra información para todos los archivos *.txt: .Sp .Vb 1 \& dos2unix \-i *.txt .Ve .Sp Muestra sólo el número de saltos de línea de \s-1DOS\s0 y de Unix: .Sp .Vb 1 \& dos2unix \-idu *.txt .Ve .Sp Muestra sólo la Marca de Orden de Byte. .Sp .Vb 1 \& dos2unix \-\-info=b *.txt .Ve .Sp Muestra los archivos que tienen saltos de línea \s-1DOS:\s0 .Sp .Vb 1 \& dos2unix \-ic *.txt .Ve .Sp Muestra los archivos que tienen saltos de línea Unix: .Sp .Vb 1 \& unix2dos \-ic *.txt .Ve .Sp Convert only files that have \s-1DOS\s0 line breaks and leave the other files untouched: .Sp .Vb 1 \& dos2unix \-ic *.txt | xargs dos2unix .Ve .Sp Find text files that have \s-1DOS\s0 line breaks: .Sp .Vb 1 \& find \-name \*(Aq*.txt\*(Aq | xargs dos2unix \-ic .Ve .RE .IP "\fB\-k, \-\-keepdate\fR" 4 .IX Item "-k, --keepdate" Mantiene la fecha del archivo de salida igual a la del archivo de entrada. .IP "\fB\-L, \-\-license\fR" 4 .IX Item "-L, --license" Muestra la licencia del programa. .IP "\fB\-l, \-\-newline\fR" 4 .IX Item "-l, --newline" Añade salto de línea adicional. .Sp \&\fBdos2unix\fR: Sólo los saltos de línea \s-1DOS\s0 son cambiados por dos saltos de línea Unix. En modo Mac sólo los saltos de línea Mac son cambiados por dos saltos de línea Unix. .Sp \&\fBunix2dos\fR: Sólo los saltos de línea Unix son cambiados por dos saltos de línea \s-1DOS.\s0 En modo Mac los saltos de línea Unix son cambiados por dos saltos de línea Mac. .IP "\fB\-m, \-\-add\-bom\fR" 4 .IX Item "-m, --add-bom" Escribe una Marca de Orden de Bytes (\s-1BOM\s0) en el archivo de salida. Por defecto se escribe una \s-1BOM UTF\-8.\s0 .Sp Cuando el archivo de entrada es \s-1UTF\-16\s0 y se usa la opción \f(CW\*(C`\-u\*(C'\fR, se escribirá un \s-1BOM UTF\-16.\s0 .Sp No utilice esta opción cuando la codificación de salida sea distinta de \&\s-1UTF\-8, UTF\-16\s0 o \s-1GB18030.\s0 Véase también la sección \s-1UNICODE.\s0 .IP "\fB\-n, \-\-newfile \s-1ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...\s0\fR" 4 .IX Item "-n, --newfile ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ..." Modo de archivo nuevo. Convierte el archivo \s-1ARCHIVO_DE_ENTRADA\s0 y escribe la salida al archivo \s-1ARCHIVO_DE_SALIDA.\s0 Los nombres de archivo deben ser dados en pares y los comodines \fIno\fR deben ser usados o \fIperderá\fR sus archivos. .Sp La persona que inicia la conversión en el modo de archivo nuevo (emparejado) será el propietario del archivo convertido. Los permisos de lectura/escritura del archivo nuevo serán los permisos del archivo original menos la \fIumask\fR\|(1) de la persona que ejecute la conversión. .IP "\fB\-o, \-\-oldfile \s-1ARCHIVO ...\s0\fR" 4 .IX Item "-o, --oldfile ARCHIVO ..." Modo de archivo antiguo. Convierte el archivo \s-1ARCHIVO\s0 y lo sobrescribe con la salida. El programa por defecto se ejecuta en este modo. Se pueden emplear comodines. .Sp En modo de archivo antiguo (in situ), el archivo convertido tiene el mismo propietario, grupo y permisos de lectura/escritura que el archivo original. Lo mismo aplica cuando el archivo es convertido por otro usuario que tiene permiso de lectura en el archivo (p.e. usuario root). La conversión será abortada cuando no sea posible preservar los valores originales. Cambiar el propietario implicaría que el propietario original ya no podrá leer el archivo. Cambiar el grupo podría ser un riesgo de seguridad, ya que el archivo podría ser accesible a personas inadecuadas. La preservación del propietario, grupo, y permisos de lectura/escritura sólo está soportada bajo Unix. .IP "\fB\-q, \-\-quiet\fR" 4 .IX Item "-q, --quiet" Modo silencioso. Suprime todas las advertencias y mensajes. El valor retornado es cero. Excepto cuando se emplean parámetros incorrectos. .IP "\fB\-r, \-\-remove\-bom\fR" 4 .IX Item "-r, --remove-bom" Elimina la Marca de Orden de Byte (\s-1BOM\s0). No escribe el \s-1BOM\s0 en el archivo de salida. Este es el comportamiento por defecto al convertir a saltos de línea Unix. Vea también la opción \f(CW\*(C`\-b\*(C'\fR. .IP "\fB\-s, \-\-safe\fR" 4 .IX Item "-s, --safe" Ignora los archivos binarios (por defecto). .Sp The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file. .IP "\fB\-u, \-\-keep\-utf16\fR" 4 .IX Item "-u, --keep-utf16" Mantiene la codificación original \s-1UTF\-16\s0 en el archivo de entrada. El archivo de salida se escribirá con la misma codificación \s-1UTF\-16,\s0 little o big endian, como el archivo de entrada. Esto impide la transformación a \&\s-1UTF\-8.\s0 En consecuencia se escribirá un \s-1BOM UTF\-16.\s0 Esta opción se puede desactivar con la opción \f(CW\*(C`\-ascii\*(C'\fR. .IP "\fB\-ul, \-\-assume\-utf16le\fR" 4 .IX Item "-ul, --assume-utf16le" Se asume que el formato de archivo de entrada es \s-1UTF\-16LE.\s0 .Sp Cuando existe una Marca de Orden de Bytes (\s-1BOM\s0) en el archivo de entrada, la \&\s-1BOM\s0 tiene prioridad sobre esta opción. .Sp Cuando se hace una suposición incorrecta (el archivo de entrada no estaba en formato \s-1UTF\-16LE\s0) y la conversión tiene éxito, obtendrá un archivo \s-1UTF\-8\s0 de salida con el texto erróneo. La conversión errónea puede deshacerse con \&\fIiconv\fR\|(1) convirtiendo el archivo \s-1UTF\-8\s0 de salida de vuelta a \s-1UTF\-16LE.\s0 Esto restaurará el archivo original. .Sp El supuesto de \s-1UTF\-16LE\s0 funciona como un \fImodo de conversión\fR. Al cambiar al modo por defecto \fIascii\fR el supuesto \s-1UTF\-16LE\s0 es deshabilitado. .IP "\fB\-ub, \-\-assume\-utf16be\fR" 4 .IX Item "-ub, --assume-utf16be" Se asume que el formato del archivo de entrada es \s-1UTF\-16BE.\s0 .Sp Esta opción funciona igual que la opción \f(CW\*(C`\-ul\*(C'\fR. .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Mostrar mensajes detallados. Se muestra información extra acerca de Marcas de Orden de Bytes (\s-1BOM\s0) y el número de saltos de línea convertidos. .IP "\fB\-F, \-\-follow\-symlink\fR" 4 .IX Item "-F, --follow-symlink" Sigue los enlaces simbólicos y convierte los destinos. .IP "\fB\-R, \-\-replace\-symlink\fR" 4 .IX Item "-R, --replace-symlink" Reemplaza los enlaces simbólicos con los archivos convertidos (los archivos destino originales no se alteran). .IP "\fB\-S, \-\-skip\-symlink\fR" 4 .IX Item "-S, --skip-symlink" No altera los enlaces simbólicos ni sus destinos (por defecto). .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" Despiega la información de la versión y termina el programa. .SH "MODO MAC" .IX Header "MODO MAC" En modo normal los saltos de línea son convertidos de \s-1DOS\s0 a Unix y viceversa. Los saltos de línea Mac no son convertidos. .PP En modo Mac los saltos de línea son convertidos de Mac a Unix y viceversa. Los saltos de línea \s-1DOS\s0 no son modificados. .PP Para ejecutar en modo Mac use el modificador \f(CW\*(C`\-c mac\*(C'\fR o use los comandos \&\f(CW\*(C`mac2unix\*(C'\fR o \f(CW\*(C`unix2mac\*(C'\fR. .SH "MODOS DE CONVERSIÓN" .IX Header "MODOS DE CONVERSIÓN" .IP "\fBascii\fR" 4 .IX Item "ascii" En modo \f(CW\*(C`ascii\*(C'\fR sólo los saltos de línea son convertidos. Éste es el modo de conversión por defecto. .Sp Aunque el nombre de este modo es \s-1ASCII,\s0 que es un estándar de 7 bits, éste emplea 8 bits. Siempre use este modo cuando convierta archivos Unicode \&\s-1UTF\-8.\s0 .IP "\fB7bit\fR" 4 .IX Item "7bit" En este modo todos los caracteres no \s-1ASCII\s0 de 8 bits (con valores de 128 a 255) son convertidos al espacio de 7 bits. .IP "\fBiso\fR" 4 .IX Item "iso" Los caracteres son convertidos entre un conjunto de caracteres \s-1DOS \s0(página de códigos) y el conjunto de caracteres \s-1ISO\-8859\-1 \s0(Latín\-1) de Unix. Los caracteres \s-1DOS\s0 sin equivalente \s-1ISO\-8859\-1,\s0 para los cuales la conversión es imposible, son convertidos en un punto. Lo mismo se aplica para caracteres \&\s-1ISO\-8859\-1\s0 sin contraparte \s-1DOS.\s0 .Sp Cuando sólo se emplea el parámetro \f(CW\*(C`\-iso\*(C'\fR, dos2unix intentará determinar la página de códigos activa. Cuando esto no sea posible, dos2unix utilizará la página de códigos 437 por defecto, la cual es empleada principalmente en \&\s-1EE. UU.\s0 Para forzar una página de códigos específica emplee los parámetros \&\f(CW\*(C`\-437\*(C'\fR (\s-1EE. UU.\s0), \f(CW\*(C`\-850\*(C'\fR (Europa Occidental), \f(CW\*(C`\-860\*(C'\fR (Portugués), \f(CW\*(C`\-863\*(C'\fR (Francocanadiense), o \f(CW\*(C`\-865\*(C'\fR (Nórdico). La página de códigos Windows 1252 (Europa Occidental) también está soportada con el parámetro \f(CW\*(C`\-1252\*(C'\fR. Para acceder a otras páginas de códigos use dos2unix en combinación con \&\fIiconv\fR\|(1). Iconv puede convertir entre una larga lista de codificaciones de caracteres. .Sp No use la conversión \s-1ISO\s0 en archivos de texto Unicode. Esto corrompería los archivos codificados como \s-1UTF\-8.\s0 .Sp Algunos ejemplos: .Sp Convierte de la página de códigos por defecto de \s-1DOS\s0 a Latín\-1 de Unix: .Sp .Vb 1 \& dos2unix \-iso \-n in.txt out.txt .Ve .Sp Convierte de \s-1DOS CP850\s0 a Unix Latín\-1: .Sp .Vb 1 \& dos2unix \-850 \-n in.txt out.txt .Ve .Sp Convierte de Windows \s-1CP1252\s0 a Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-1252 \-n in.txt out.txt .Ve .Sp Convierte de Windows \s-1CP1252\s0 a Unix \s-1UTF\-8 \s0(Unicode). .Sp .Vb 1 \& iconv \-f CP1252 \-t UTF\-8 in.txt | dos2unix > out.txt .Ve .Sp Convierte de Unix Latin\-1 a la página de códigos por defecto de \s-1DOS:\s0 .Sp .Vb 1 \& unix2dos \-iso \-n in.txt out.txt .Ve .Sp Convierte de Unix Latin\-1 a \s-1DOS CP850:\s0 .Sp .Vb 1 \& unix2dos \-850 \-n in.txt out.txt .Ve .Sp Convierte de Unix Latin\-1 a Windows \s-1CP1252.\s0 .Sp .Vb 1 \& unix2dos \-1252 \-n in.txt out.txt .Ve .Sp Convierte de Unix \s-1UTF\-8 \s0(Unicode) a Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t CP1252 > out.txt .Ve .Sp Véase también y . .SH "UNICODE" .IX Header "UNICODE" .SS "Codificaciones" .IX Subsection "Codificaciones" Existen diferentes codificaciones Unicode. En Unix y Linux los archivos Unicode son codificados comúnmente en \s-1UTF\-8.\s0 En Windows los archivos de texto Unicode pueden estar codificados en \s-1UTF\-8, UTF\-16,\s0 o \s-1UTF\-16\s0 big endian, pero en general son codificados en formato \s-1UTF\-16.\s0 .SS "Conversion" .IX Subsection "Conversion" Los archivos de texto Unicode pueden tener saltos de línea \s-1DOS,\s0 Unix o Mac, como cualquier archivo de texto. .PP Todas las versiones de dos2unix y unix2dos pueden convertir archivos codificados como \s-1UTF\-8,\s0 debido a que \s-1UTF\-8\s0 fue diseñado para retro-compatibilidad con \s-1ASCII.\s0 .PP Dos2unix y unix2dos con soporte Unicode \s-1UTF\-16,\s0 pueden leer archivos de texto codificados como \s-1UTF\-16\s0 little y big endian. Para ver si dos2unix fue compilado con soporte \s-1UTF\-16\s0 escriba \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP En Unix/Linux los archivos codificados con \s-1UTF\-16\s0 se convierten a la codificación de caracteres local. Use el comando \fIlocale\fR\|(1) para averiguar la codificación de caracteres local. Cuando no se puede hacer la conversión se obtendrá un error de conversión y se omitirá el archivo. .PP En Windows los archivos \s-1UTF\-16\s0 se convierten por defecto a \s-1UTF\-8.\s0 Los archivos de texto forrajeados con \s-1UTF\-8\s0 están soportados tanto en Windows como en Unix/Linux. .PP Las codificaciones \s-1UTF\-16\s0 y \s-1UTF\-8\s0 son totalmente compatibles, no se perderá ningún texto en la conversión. Cuando ocurre un error de conversión de \&\s-1UTF\-16\s0 a \s-1UTF\-8,\s0 por ejemplo cuando el archivo de entrada \s-1UTF\-16\s0 contiene un error, se omitirá el archivo. .PP Cuando se usa la opción \f(CW\*(C`\-u\*(C'\fR, el archivo de salida se escribirá en la misma codificación \s-1UTF\-16\s0 que el archivo de entrada. La opción \f(CW\*(C`\-u\*(C'\fR previene la conversión a \s-1UTF\-8.\s0 .PP Dos2unix y unix2dos no tienen la opción de convertir archivos \s-1UTF\-8\s0 a \&\s-1UTF\-16.\s0 .PP La conversión en modos \s-1ISO\s0 y 7\-bit no funciona en archivos \s-1UTF\-16.\s0 .SS "Marca de orden de bytes" .IX Subsection "Marca de orden de bytes" En Windows los archivos de texto Unicode típicamente tienen una Marca de Orden de Bytes (\s-1BOM\s0), debido a que muchos programas de Windows (incluyendo el Bloc de Notas) añaden una \s-1BOM\s0 por defecto. Véase también . .PP En Unix los archivos Unicode no suelen tener \s-1BOM.\s0 Se supone que los archivos de texto son codificados en la codificación local de caracteres. .PP Dos2unix sólo puede detectar si un archivo está en formato \s-1UTF\-16\s0 si el archivo tiene una \s-1BOM.\s0 Cuando un archivo \s-1UTF\-16\s0 no tiene una \s-1BOM,\s0 dos2unix tratará el archivo como un archivo binario. .PP Use la opción \f(CW\*(C`\-ul\*(C'\fR o \f(CW\*(C`\-ub\*(C'\fR para convertir un archivo \s-1UTF\-16\s0 sin \s-1BOM.\s0 .PP Dos2Unix, por defecto, no escribe \s-1BOM\s0 en el archivo de salida. Con la opción \&\f(CW\*(C`\-b\*(C'\fR Dos2unix escribe el \s-1BOM\s0 cuando el archivo de entrada tiene \s-1BOM.\s0 .PP Unix2dos escribe \s-1BOM\s0 en el archivo de salida cuando el archivo de entrada tiene \s-1BOM.\s0 Use la opción \f(CW\*(C`\-r\*(C'\fR para eliminar la \s-1BOM.\s0 .PP Dos2unix y unix2dos escriben siempre \s-1BOM\s0 cuando se usa la opción \f(CW\*(C`\-m\*(C'\fR. .SS "Unicode file names on Windows" .IX Subsection "Unicode file names on Windows" Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system \s-1ANSI\s0 code page. To see if dos2unix for Windows was built with Unicode file name support type \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP There are some issues with displaying Unicode file names in a Windows console. See option \f(CW\*(C`\-D\*(C'\fR, \f(CW\*(C`\-\-display\-enc\*(C'\fR. The file names may be displayed wrongly in the console, but the files will be written with the correct name. .SS "Ejemplos Unicode" .IX Subsection "Ejemplos Unicode" Convertir de Windows \s-1UTF\-16 \s0(con una \s-1BOM\s0) a Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-n in.txt out.txt .Ve .PP Convertir de Windows \s-1UTF\-16LE \s0(sin una \s-1BOM\s0) a Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-ul \-n in.txt out.txt .Ve .PP Convertir de Unix \s-1UTF\-8\s0 a Windows \s-1UTF\-8\s0 sin una \s-1BOM:\s0 .PP .Vb 1 \& unix2dos \-m \-n in.txt out.txt .Ve .PP Convertir de Unix \s-1UTF\-8\s0 a Windows \s-1UTF\-16:\s0 .PP .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t UTF\-16 > out.txt .Ve .SH "GB18030" .IX Header "GB18030" \&\s-1GB18030\s0 es un estándar del gobierno chino. Todo producto software vendido en China está obligado por ley a contener un subconjunto del \s-1GB18030\s0 estándar. Véase . .PP \&\s-1GB18030\s0 es totalmente compatible con Unicode y puede considerarse como formato de transformación Unicode. Como ocurre con \s-1UTF\-8, GB18030\s0 es compatible con \s-1ASCII. GB18030\s0 también es compatible con la página de códigos de Windows 936, también conocida como \s-1GBK.\s0 .PP En Unix/Linux los archivos \s-1UTF\-16\s0 se convierten a \s-1GB18030\s0 cuando la codificación local se establece en \s-1GB18030.\s0 Tenga en cuenta que esto sólo funcionará si la configuración local es soportada por el sistema. Utilice \&\f(CW\*(C`locale \-a\*(C'\fR para obtener el listado de configuraciones regionales admitidas. .PP Use la opción \f(CW\*(C`\-ul\*(C'\fR o \f(CW\*(C`\-ub\*(C'\fR para convertir un archivo \s-1UTF\-16\s0 sin \s-1BOM.\s0 .PP Los archivos codificados como \s-1GB18030\s0 pueden tener una Marca de Orden de Bytes, como ocurre con los archivos Unicode. .SH "EJEMPLOS" .IX Header "EJEMPLOS" Lee la entrada desde 'stdin' y escribe la salida a 'stdout': .PP .Vb 2 \& dos2unix < a.txt \& cat a.txt | dos2unix .Ve .PP Convierte y reemplaza a.txt. Convierte y reemplaza b.txt: .PP .Vb 2 \& dos2unix a.txt b.txt \& dos2unix \-o a.txt b.txt .Ve .PP Convierte y reemplaza a.txt empleando modo de conversión ascii: .PP .Vb 1 \& dos2unix a.txt .Ve .PP Convierte y reemplaza a.txt empleando modo de conversión ascii, convierte y reemplaza b.txt empleando modo de conversión de 7bits: .PP .Vb 3 \& dos2unix a.txt \-c 7bit b.txt \& dos2unix \-c ascii a.txt \-c 7bit b.txt \& dos2unix \-ascii a.txt \-7 b.txt .Ve .PP Convierte a.txt del formato de Mac a Unix: .PP .Vb 2 \& dos2unix \-c mac a.txt \& mac2unix a.txt .Ve .PP Convierte a.txt del formato de Unix a Mac: .PP .Vb 2 \& unix2dos \-c mac a.txt \& unix2mac a.txt .Ve .PP Convierte y reemplaza a.txt manteniendo la fecha del archivo original: .PP .Vb 2 \& dos2unix \-k a.txt \& dos2unix \-k \-o a.txt .Ve .PP Convierte a.txt y escribe la salida en e.txt: .PP .Vb 1 \& dos2unix \-n a.txt e.txt .Ve .PP Convierte a.txt y escribe la salida en e.txt, manteniendo la fecha de e.txt igual a la de a.txt: .PP .Vb 1 \& dos2unix \-k \-n a.txt e.txt .Ve .PP Convierte y reemplaza a.txt, convierte b.txt y escribe en e.txt: .PP .Vb 2 \& dos2unix a.txt \-n b.txt e.txt \& dos2unix \-o a.txt \-n b.txt e.txt .Ve .PP Convierte c.txt y escribe en e.txt, convierte y reemplaza a.txt, convierte y reemplaza b.txt, convierte d.txt y escribe en f.txt: .PP .Vb 1 \& dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt .Ve .SH "CONVERSIÓN RECURSIVA" .IX Header "CONVERSIÓN RECURSIVA" Use dos2unix en combinación con los comandos \fIfind\fR\|(1) y \fIxargs\fR\|(1) para convertir recursivamente archivos de texto contenidos en un árbol de directorios. Por ejemplo para convertir todos los archivos .txt en el árbol de directorios debajo del directorio actual escriba: .PP .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .PP In a Windows Command Prompt the following command can be used: .PP .Vb 1 \& for /R %G in (*.txt) do dos2unix "%G" .Ve .PP PowerShell users can use the following command in Windows PowerShell: .PP .Vb 1 \& get\-childitem \-path . \-filter \*(Aq*.txt\*(Aq \-recurse | foreach\-object {dos2unix $_.Fullname} .Ve .SH "INTERNACIONALIZACIÓN" .IX Header "INTERNACIONALIZACIÓN" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" El idioma principal se selecciona con la variable de entorno \s-1LANG.\s0 La variable \s-1LANG\s0 consiste de varias partes. La primer parte es el código del idioma en minúsculas. La segunda es opcional y es el código del país en mayúsculas, precedido por un guión bajo. Existe también una tercera parte opcional: la codificación de caracteres, precedida por un punto. Unos cuantos ejemplos para intérpretes de comandos tipo \s-1POSIX\s0 estándar: .Sp .Vb 7 \& export LANG=nl Neerlandés \& export LANG=nl_NL Neerlandés, Países Bajos \& export LANG=nl_BE Neerlandés, Bélgica \& export LANG=es_ES Español, España \& export LANG=es_MX Español, México \& export LANG=en_US.iso88591 Ingles, EE. UU., codificación Latín\-1 \& export LANG=en_GB.UTF\-8 Ingles, Reino Unido, codificación UTF\-8 .Ve .Sp Para obtener una lista completa de códigos de idioma y país véase el manual de gettext: .Sp En sistemas Unix puede emplear el comando \fIlocale\fR\|(1) para obtener información específica de locale. .IP "\fB\s-1LANGUAGE\s0\fR" 4 .IX Item "LANGUAGE" Con la variable de entorno \s-1LANGUAGE\s0 puede especificar una lista de prioridad de los idiomas, separados por dos puntos. Dos2unix da preferencia a \s-1LANGUAGE\s0 sobre \s-1LANG.\s0 Por ejemplo, primero neerlandés y entonces alemán: \&\f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. Para usar una lista de prioridad de idiomas a través de la variable \s-1LANGUAGE\s0 tiene que habilitar antes la internacionalización, asignando un valor distinto de \*(L"C\*(R" a \s-1LANG \s0(o \s-1LC_ALL\s0). Véase también el manual de gettext: .Sp Si selecciona un idioma que no está disponible el programa funcionará en ingles. .IP "\fB\s-1DOS2UNIX_LOCALEDIR\s0\fR" 4 .IX Item "DOS2UNIX_LOCALEDIR" Con la variable de entorno \s-1DOS2UNIX_LOCALEDIR\s0 el \s-1LOCALEDIR\s0 asignado durante la compilación puede ser modificado. \s-1LOCALEDIR\s0 es usado para encontrar los archivos de idioma. El valor por defecto de \s-1GNU\s0 es \&\f(CW\*(C`/usr/local/share/locale\*(C'\fR. El parámetro \fB\-\-version\fR mostrará el \s-1LOCALEDIR\s0 en uso. .Sp Ejemplo (intérprete de comandos \s-1POSIX\s0): .Sp .Vb 1 \& export DOS2UNIX_LOCALEDIR=$HOME/share/locale .Ve .SH "VALOR DE RETORNO" .IX Header "VALOR DE RETORNO" Se regresa cero cuando el programa termina exitosamente. Cuando ocurre un error del sistema se regresará el último número de error del sistema. Para otros errores se regresa 1. .PP El valor de retorno es siempre cero en modo silencioso, excepto cuando se emplean parámetros incorrectos. .SH "ESTÁNDARES" .IX Header "ESTÁNDARES" .PP .PP .PP .SH "AUTORES" .IX Header "AUTORES" Benjamin Lin \- , Bernd Johannes Wuebben (mac2unix mode) \- , Christian Wurll (add extra newline) \- , Erwin Waterlander \- (maintainer) .PP Página del proyecto: .PP Página de SourceForge: .SH "VÉASE TAMBIÉN" .IX Header "VÉASE TAMBIÉN" \&\fIfile\fR\|(1) \fIfind\fR\|(1) \fIiconv\fR\|(1) \fIlocale\fR\|(1) \fIxargs\fR\|(1) dos2unix-7.3.4/man/es/man1/dos2unix.htm0000644000175500010010000010712112721132574017060 0ustar waterlanGeen dos2unix 7.3.4 - Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa

NOMBRE

dos2unix - Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa

SINOPSIS

    dos2unix [parámetros] [ARCHIVO ...] [-n ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...]
    unix2dos [parámetros] [ARCHIVO ...] [-n ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...]

DESCRIPCIÓN

El paquete Dos2unix incluye las herramientas dos2unix y unix2dos para convertir archivos de texto plano en formato DOS o Mac a formato Unix y viceversa.

En archivos de texto DOS/Windows, un salto de línea, también conocido como nueva línea, es una combinación de dos caracteres: un retorno de carro (CR) seguido por un salto de línea (LF). En archivos de texto Unix, un salto de línea es solamente un carácter: el salto de línea (LF). En archivos de texto Mac, antes de Mac OS X, un salto de línea era sólo un carácter retorno de carro (CR). Actualmente, Mac OS usa el estilo Unix de saltos de línea (LF).

Además de saltos de línea, Dos2unix puede también convertir la codificación de archivos. Unas cuantas páginas de códigos DOS pueden ser convertidas a Unix Latin-1. Y archivos Unicode de Windows (UTF-16) pueden ser convertidos a archivos Unicode de Unix (UTF-8).

Los archivos binarios son ignorados automáticamente, a menos que se fuerce su conversión.

Los archivos no regulares, tales como directorios y FIFO, son ignorados automáticamente.

Los enlaces simbólicos y sus destinos no son modificados por defecto. Los enlaces simbólicos pueden opcionalmente ser reemplazados, o la salida puede ser escrita al destino simbólico del enlace. En Windows no está soportada la escritura a enlaces simbólicos.

Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options -o and -n. Another difference is that the SunOS/Solaris version uses by default iso mode conversion while this version uses by default ascii mode conversion.

PARÁMETROS

--

Todos los parámetros siguientes son tratados como nombres de archivo. Use este parámetro si desea convertir archivos cuyos nombres inician con un guión. Por ejemplo para convertir un archivoo llamado "-foo", use este comando:

    dos2unix -- -foo

O en modo de archivo nuevo:

    dos2unix -n -- -foo out.txt
-ascii

Sólo convierte los salto de línea. Éste es el modo de conversión por defecto.

-iso

Conversión entre el conjunto de caracteres DOS e ISO-8859-1. Véase también la sección MODOS DE CONVERSIÓN.

-1252

Usa la página de códigos Windows 1252 (Europa Occidental).

-437

Usa la página de códigos DOS 437 (EE. UU.). Está es la página de códigos usada por defecto para conversión ISO.

-850

Usa la página de códigos DOS 850 (Europa Occidental).

-860

Usa la página de códigos DOS 860 (Portugués).

-863

Usa la página de códigos DOS 863 (Francocanadiense).

-865

Usa la página de códigos DOS 865 (Nórdico).

-7

Convierte caracteres de 8 bits al espacio de 7 bits.

-b, --keep-bom

Mantiene la Marca de Orden de Byte (BOM). Cuando el archivo de entrada tiene BOM, escribe BOM en el archivo de salida. Este es el comportamiento por defecto en la conversión a saltos de línea DOS. Vea también la opción -r.

-c, --convmode CONVMODE

Establece el modo de conversión, Donde CONVMODE puede ser: ascii, 7bit, iso, mac siendo ascii el valor por defecto.

-D, --display-enc ENCODING

Set encoding of displayed text. Where ENCODING is one of: ansi, unicode, unicodebom, utf8, utf8bom with ansi being the default.

This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed.

There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages.

ansi

Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the chcp command, because dos2unix uses the Windows system code page.

The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK.

unicode, unicodebom

The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it.

When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font.

The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program.

When method unicodebom is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell.

utf8, utf8bom

The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the unicode encoding.

The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed.

In a ConEmu console the utf8 encoding method works well.

When method utf8bom is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell.

The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to unicode, unicodebom, utf8, or utf8bom.

-f, --force

Fuerza la conversión de archivos binarios.

-gb, --gb18030

En Windows los archivos UTF-16 se convierten por defecto a UTF-8, sin tener en cuenta la configuración local. Use esta opción para convertir archivos UTF-16 a GB18030. Esta opción sólo está disponible en Windows.l Véase también la sección GB18030.

-h, --help

Despiega la ayuda y termina el programa.

-i[MARCAS], --info[= MARCAS] ARCHIVO ...

Muestra la información del archivo. No se realiza ninguna conversión.

Se muestra la siguiente información, en este orden: número de saltos de línea DOS, número de saltos de línea Unix, número de saltos de línea Mac, Marca de Orden de Byte, de texto o binario, nombre del archivo.

Ejemplo de salida:

     6       0       0  no_bom    text    dos.txt
     0       6       0  no_bom    text    unix.txt
     0       0       6  no_bom    text    mac.txt
     6       6       6  no_bom    text    mixed.txt
    50       0       0  UTF-16LE  text    utf16le.txt
     0      50       0  no_bom    text    utf8unix.txt
    50       0       0  UTF-8     text    utf8dos.txt
     2     418     219  no_bom    binary  dos2unix.exe

Note that sometimes a binary file can be mistaken for a text file. See also option -s.

Se pueden utilizar marcas extras opcionales para modificar la salida. Se pueden añadir una o más marcas.

d

Muestra el número de saltos de línea DOS.

u

Muestra el número de saltos de línea Unix.

m

Muestra el número de saltos de línea Mac.

b

Muestra la Marca de Orden de Byte.

t

Muestra si el archivo es de texto o binario.

c

Muestra sólo los archivos que pueden ser convertidos.

Con la marca c dos2unix sólo mostrará los archivos que contengan saltos de línea DOS, unix2dos sólo mostrará los nombres de archivo que tengan saltos de línea Unix.

h

Print a header.

p

Show file names without path.

Ejemplos:

Muestra información para todos los archivos *.txt:

    dos2unix -i *.txt

Muestra sólo el número de saltos de línea de DOS y de Unix:

    dos2unix -idu *.txt

Muestra sólo la Marca de Orden de Byte.

    dos2unix --info=b *.txt

Muestra los archivos que tienen saltos de línea DOS:

    dos2unix -ic *.txt

Muestra los archivos que tienen saltos de línea Unix:

    unix2dos -ic *.txt

Convert only files that have DOS line breaks and leave the other files untouched:

    dos2unix -ic *.txt | xargs dos2unix

Find text files that have DOS line breaks:

    find -name '*.txt' | xargs dos2unix -ic
-k, --keepdate

Mantiene la fecha del archivo de salida igual a la del archivo de entrada.

-L, --license

Muestra la licencia del programa.

-l, --newline

Añade salto de línea adicional.

dos2unix: Sólo los saltos de línea DOS son cambiados por dos saltos de línea Unix. En modo Mac sólo los saltos de línea Mac son cambiados por dos saltos de línea Unix.

unix2dos: Sólo los saltos de línea Unix son cambiados por dos saltos de línea DOS. En modo Mac los saltos de línea Unix son cambiados por dos saltos de línea Mac.

-m, --add-bom

Escribe una Marca de Orden de Bytes (BOM) en el archivo de salida. Por defecto se escribe una BOM UTF-8.

Cuando el archivo de entrada es UTF-16 y se usa la opción -u, se escribirá un BOM UTF-16.

No utilice esta opción cuando la codificación de salida sea distinta de UTF-8, UTF-16 o GB18030. Véase también la sección UNICODE.

-n, --newfile ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...

Modo de archivo nuevo. Convierte el archivo ARCHIVO_DE_ENTRADA y escribe la salida al archivo ARCHIVO_DE_SALIDA. Los nombres de archivo deben ser dados en pares y los comodines no deben ser usados o perderá sus archivos.

La persona que inicia la conversión en el modo de archivo nuevo (emparejado) será el propietario del archivo convertido. Los permisos de lectura/escritura del archivo nuevo serán los permisos del archivo original menos la umask(1) de la persona que ejecute la conversión.

-o, --oldfile ARCHIVO ...

Modo de archivo antiguo. Convierte el archivo ARCHIVO y lo sobrescribe con la salida. El programa por defecto se ejecuta en este modo. Se pueden emplear comodines.

En modo de archivo antiguo (in situ), el archivo convertido tiene el mismo propietario, grupo y permisos de lectura/escritura que el archivo original. Lo mismo aplica cuando el archivo es convertido por otro usuario que tiene permiso de lectura en el archivo (p.e. usuario root). La conversión será abortada cuando no sea posible preservar los valores originales. Cambiar el propietario implicaría que el propietario original ya no podrá leer el archivo. Cambiar el grupo podría ser un riesgo de seguridad, ya que el archivo podría ser accesible a personas inadecuadas. La preservación del propietario, grupo, y permisos de lectura/escritura sólo está soportada bajo Unix.

-q, --quiet

Modo silencioso. Suprime todas las advertencias y mensajes. El valor retornado es cero. Excepto cuando se emplean parámetros incorrectos.

-r, --remove-bom

Elimina la Marca de Orden de Byte (BOM). No escribe el BOM en el archivo de salida. Este es el comportamiento por defecto al convertir a saltos de línea Unix. Vea también la opción -b.

-s, --safe

Ignora los archivos binarios (por defecto).

The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file.

-u, --keep-utf16

Mantiene la codificación original UTF-16 en el archivo de entrada. El archivo de salida se escribirá con la misma codificación UTF-16, little o big endian, como el archivo de entrada. Esto impide la transformación a UTF-8. En consecuencia se escribirá un BOM UTF-16. Esta opción se puede desactivar con la opción -ascii.

-ul, --assume-utf16le

Se asume que el formato de archivo de entrada es UTF-16LE.

Cuando existe una Marca de Orden de Bytes (BOM) en el archivo de entrada, la BOM tiene prioridad sobre esta opción.

Cuando se hace una suposición incorrecta (el archivo de entrada no estaba en formato UTF-16LE) y la conversión tiene éxito, obtendrá un archivo UTF-8 de salida con el texto erróneo. La conversión errónea puede deshacerse con iconv(1) convirtiendo el archivo UTF-8 de salida de vuelta a UTF-16LE. Esto restaurará el archivo original.

El supuesto de UTF-16LE funciona como un modo de conversión. Al cambiar al modo por defecto ascii el supuesto UTF-16LE es deshabilitado.

-ub, --assume-utf16be

Se asume que el formato del archivo de entrada es UTF-16BE.

Esta opción funciona igual que la opción -ul.

-v, --verbose

Mostrar mensajes detallados. Se muestra información extra acerca de Marcas de Orden de Bytes (BOM) y el número de saltos de línea convertidos.

Sigue los enlaces simbólicos y convierte los destinos.

Reemplaza los enlaces simbólicos con los archivos convertidos (los archivos destino originales no se alteran).

No altera los enlaces simbólicos ni sus destinos (por defecto).

-V, --version

Despiega la información de la versión y termina el programa.

MODO MAC

En modo normal los saltos de línea son convertidos de DOS a Unix y viceversa. Los saltos de línea Mac no son convertidos.

En modo Mac los saltos de línea son convertidos de Mac a Unix y viceversa. Los saltos de línea DOS no son modificados.

Para ejecutar en modo Mac use el modificador -c mac o use los comandos mac2unix o unix2mac.

MODOS DE CONVERSIÓN

ascii

En modo ascii sólo los saltos de línea son convertidos. Éste es el modo de conversión por defecto.

Aunque el nombre de este modo es ASCII, que es un estándar de 7 bits, éste emplea 8 bits. Siempre use este modo cuando convierta archivos Unicode UTF-8.

7bit

En este modo todos los caracteres no ASCII de 8 bits (con valores de 128 a 255) son convertidos al espacio de 7 bits.

iso

Los caracteres son convertidos entre un conjunto de caracteres DOS (página de códigos) y el conjunto de caracteres ISO-8859-1 (Latín-1) de Unix. Los caracteres DOS sin equivalente ISO-8859-1, para los cuales la conversión es imposible, son convertidos en un punto. Lo mismo se aplica para caracteres ISO-8859-1 sin contraparte DOS.

Cuando sólo se emplea el parámetro -iso, dos2unix intentará determinar la página de códigos activa. Cuando esto no sea posible, dos2unix utilizará la página de códigos 437 por defecto, la cual es empleada principalmente en EE. UU. Para forzar una página de códigos específica emplee los parámetros -437 (EE. UU.), -850 (Europa Occidental), -860 (Portugués), -863 (Francocanadiense), o -865 (Nórdico). La página de códigos Windows 1252 (Europa Occidental) también está soportada con el parámetro -1252. Para acceder a otras páginas de códigos use dos2unix en combinación con iconv(1). Iconv puede convertir entre una larga lista de codificaciones de caracteres.

No use la conversión ISO en archivos de texto Unicode. Esto corrompería los archivos codificados como UTF-8.

Algunos ejemplos:

Convierte de la página de códigos por defecto de DOS a Latín-1 de Unix:

    dos2unix -iso -n in.txt out.txt

Convierte de DOS CP850 a Unix Latín-1:

    dos2unix -850 -n in.txt out.txt

Convierte de Windows CP1252 a Unix Latin-1:

    dos2unix -1252 -n in.txt out.txt

Convierte de Windows CP1252 a Unix UTF-8 (Unicode).

    iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt

Convierte de Unix Latin-1 a la página de códigos por defecto de DOS:

    unix2dos -iso -n in.txt out.txt

Convierte de Unix Latin-1 a DOS CP850:

    unix2dos -850 -n in.txt out.txt

Convierte de Unix Latin-1 a Windows CP1252.

    unix2dos -1252 -n in.txt out.txt

Convierte de Unix UTF-8 (Unicode) a Windows CP1252:

    unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt

Véase también http://czyborra.com/charsets/codepages.html y http://czyborra.com/charsets/iso8859.html.

UNICODE

Codificaciones

Existen diferentes codificaciones Unicode. En Unix y Linux los archivos Unicode son codificados comúnmente en UTF-8. En Windows los archivos de texto Unicode pueden estar codificados en UTF-8, UTF-16, o UTF-16 big endian, pero en general son codificados en formato UTF-16.

Conversion

Los archivos de texto Unicode pueden tener saltos de línea DOS, Unix o Mac, como cualquier archivo de texto.

Todas las versiones de dos2unix y unix2dos pueden convertir archivos codificados como UTF-8, debido a que UTF-8 fue diseñado para retro-compatibilidad con ASCII.

Dos2unix y unix2dos con soporte Unicode UTF-16, pueden leer archivos de texto codificados como UTF-16 little y big endian. Para ver si dos2unix fue compilado con soporte UTF-16 escriba dos2unix -V.

En Unix/Linux los archivos codificados con UTF-16 se convierten a la codificación de caracteres local. Use el comando locale(1) para averiguar la codificación de caracteres local. Cuando no se puede hacer la conversión se obtendrá un error de conversión y se omitirá el archivo.

En Windows los archivos UTF-16 se convierten por defecto a UTF-8. Los archivos de texto forrajeados con UTF-8 están soportados tanto en Windows como en Unix/Linux.

Las codificaciones UTF-16 y UTF-8 son totalmente compatibles, no se perderá ningún texto en la conversión. Cuando ocurre un error de conversión de UTF-16 a UTF-8, por ejemplo cuando el archivo de entrada UTF-16 contiene un error, se omitirá el archivo.

Cuando se usa la opción -u, el archivo de salida se escribirá en la misma codificación UTF-16 que el archivo de entrada. La opción -u previene la conversión a UTF-8.

Dos2unix y unix2dos no tienen la opción de convertir archivos UTF-8 a UTF-16.

La conversión en modos ISO y 7-bit no funciona en archivos UTF-16.

Marca de orden de bytes

En Windows los archivos de texto Unicode típicamente tienen una Marca de Orden de Bytes (BOM), debido a que muchos programas de Windows (incluyendo el Bloc de Notas) añaden una BOM por defecto. Véase también http://es.wikipedia.org/wiki/Marca_de_orden_de_bytes_%28BOM%29.

En Unix los archivos Unicode no suelen tener BOM. Se supone que los archivos de texto son codificados en la codificación local de caracteres.

Dos2unix sólo puede detectar si un archivo está en formato UTF-16 si el archivo tiene una BOM. Cuando un archivo UTF-16 no tiene una BOM, dos2unix tratará el archivo como un archivo binario.

Use la opción -ul o -ub para convertir un archivo UTF-16 sin BOM.

Dos2Unix, por defecto, no escribe BOM en el archivo de salida. Con la opción -b Dos2unix escribe el BOM cuando el archivo de entrada tiene BOM.

Unix2dos escribe BOM en el archivo de salida cuando el archivo de entrada tiene BOM. Use la opción -r para eliminar la BOM.

Dos2unix y unix2dos escriben siempre BOM cuando se usa la opción -m.

Unicode file names on Windows

Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type dos2unix -V.

There are some issues with displaying Unicode file names in a Windows console. See option -D, --display-enc. The file names may be displayed wrongly in the console, but the files will be written with the correct name.

Ejemplos Unicode

Convertir de Windows UTF-16 (con una BOM) a Unix UTF-8:

    dos2unix -n in.txt out.txt

Convertir de Windows UTF-16LE (sin una BOM) a Unix UTF-8:

    dos2unix -ul -n in.txt out.txt

Convertir de Unix UTF-8 a Windows UTF-8 sin una BOM:

    unix2dos -m -n in.txt out.txt

Convertir de Unix UTF-8 a Windows UTF-16:

    unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt

GB18030

GB18030 es un estándar del gobierno chino. Todo producto software vendido en China está obligado por ley a contener un subconjunto del GB18030 estándar. Véase http://en.wikipedia.org/wiki/GB_18030.

GB18030 es totalmente compatible con Unicode y puede considerarse como formato de transformación Unicode. Como ocurre con UTF-8, GB18030 es compatible con ASCII. GB18030 también es compatible con la página de códigos de Windows 936, también conocida como GBK.

En Unix/Linux los archivos UTF-16 se convierten a GB18030 cuando la codificación local se establece en GB18030. Tenga en cuenta que esto sólo funcionará si la configuración local es soportada por el sistema. Utilice locale -a para obtener el listado de configuraciones regionales admitidas.

Use la opción -ul o -ub para convertir un archivo UTF-16 sin BOM.

Los archivos codificados como GB18030 pueden tener una Marca de Orden de Bytes, como ocurre con los archivos Unicode.

EJEMPLOS

Lee la entrada desde 'stdin' y escribe la salida a 'stdout':

    dos2unix < a.txt
    cat a.txt | dos2unix

Convierte y reemplaza a.txt. Convierte y reemplaza b.txt:

    dos2unix a.txt b.txt
    dos2unix -o a.txt b.txt

Convierte y reemplaza a.txt empleando modo de conversión ascii:

    dos2unix a.txt

Convierte y reemplaza a.txt empleando modo de conversión ascii, convierte y reemplaza b.txt empleando modo de conversión de 7bits:

    dos2unix a.txt -c 7bit b.txt
    dos2unix -c ascii a.txt -c 7bit b.txt
    dos2unix -ascii a.txt -7 b.txt

Convierte a.txt del formato de Mac a Unix:

    dos2unix -c mac a.txt
    mac2unix a.txt

Convierte a.txt del formato de Unix a Mac:

    unix2dos -c mac a.txt
    unix2mac a.txt

Convierte y reemplaza a.txt manteniendo la fecha del archivo original:

    dos2unix -k a.txt
    dos2unix -k -o a.txt

Convierte a.txt y escribe la salida en e.txt:

    dos2unix -n a.txt e.txt

Convierte a.txt y escribe la salida en e.txt, manteniendo la fecha de e.txt igual a la de a.txt:

    dos2unix -k -n a.txt e.txt

Convierte y reemplaza a.txt, convierte b.txt y escribe en e.txt:

    dos2unix a.txt -n b.txt e.txt
    dos2unix -o a.txt -n b.txt e.txt

Convierte c.txt y escribe en e.txt, convierte y reemplaza a.txt, convierte y reemplaza b.txt, convierte d.txt y escribe en f.txt:

    dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt

CONVERSIÓN RECURSIVA

Use dos2unix en combinación con los comandos find(1) y xargs(1) para convertir recursivamente archivos de texto contenidos en un árbol de directorios. Por ejemplo para convertir todos los archivos .txt en el árbol de directorios debajo del directorio actual escriba:

    find . -name '*.txt' |xargs dos2unix

In a Windows Command Prompt the following command can be used:

    for /R %G in (*.txt) do dos2unix "%G"

PowerShell users can use the following command in Windows PowerShell:

    get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}

INTERNACIONALIZACIÓN

LANG

El idioma principal se selecciona con la variable de entorno LANG. La variable LANG consiste de varias partes. La primer parte es el código del idioma en minúsculas. La segunda es opcional y es el código del país en mayúsculas, precedido por un guión bajo. Existe también una tercera parte opcional: la codificación de caracteres, precedida por un punto. Unos cuantos ejemplos para intérpretes de comandos tipo POSIX estándar:

    export LANG=nl               Neerlandés
    export LANG=nl_NL            Neerlandés, Países Bajos
    export LANG=nl_BE            Neerlandés, Bélgica
    export LANG=es_ES            Español, España
    export LANG=es_MX            Español, México
    export LANG=en_US.iso88591   Ingles, EE. UU., codificación Latín-1
    export LANG=en_GB.UTF-8      Ingles, Reino Unido, codificación UTF-8

Para obtener una lista completa de códigos de idioma y país véase el manual de gettext: http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

En sistemas Unix puede emplear el comando locale(1) para obtener información específica de locale.

LANGUAGE

Con la variable de entorno LANGUAGE puede especificar una lista de prioridad de los idiomas, separados por dos puntos. Dos2unix da preferencia a LANGUAGE sobre LANG. Por ejemplo, primero neerlandés y entonces alemán: LANGUAGE=nl:de. Para usar una lista de prioridad de idiomas a través de la variable LANGUAGE tiene que habilitar antes la internacionalización, asignando un valor distinto de "C" a LANG (o LC_ALL). Véase también el manual de gettext: http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

Si selecciona un idioma que no está disponible el programa funcionará en ingles.

DOS2UNIX_LOCALEDIR

Con la variable de entorno DOS2UNIX_LOCALEDIR el LOCALEDIR asignado durante la compilación puede ser modificado. LOCALEDIR es usado para encontrar los archivos de idioma. El valor por defecto de GNU es /usr/local/share/locale. El parámetro --version mostrará el LOCALEDIR en uso.

Ejemplo (intérprete de comandos POSIX):

    export DOS2UNIX_LOCALEDIR=$HOME/share/locale

VALOR DE RETORNO

Se regresa cero cuando el programa termina exitosamente. Cuando ocurre un error del sistema se regresará el último número de error del sistema. Para otros errores se regresa 1.

El valor de retorno es siempre cero en modo silencioso, excepto cuando se emplean parámetros incorrectos.

ESTÁNDARES

http://es.wikipedia.org/wiki/Documento_de_texto

http://es.wikipedia.org/wiki/Retorno_de_carro

http://es.wikipedia.org/wiki/Nueva_l%C3%ADnea

http://es.wikipedia.org/wiki/Unicode

AUTORES

Benjamin Lin - <blin@socs.uts.edu.au>, Bernd Johannes Wuebben (mac2unix mode) - <wuebben@kde.org>, Christian Wurll (add extra newline) - <wurll@ira.uka.de>, Erwin Waterlander - <waterlan@xs4all.nl> (maintainer)

Página del proyecto: http://waterlan.home.xs4all.nl/dos2unix.html

Página de SourceForge: http://sourceforge.net/projects/dos2unix/

VÉASE TAMBIÉN

file(1) find(1) iconv(1) locale(1) xargs(1)

dos2unix-7.3.4/man/es/man1/dos2unix.pod0000644000175500010010000006622412721132566017063 0ustar waterlanGeen ***************************************************** * GENERATED FILE, DO NOT EDIT * * THIS IS NO SOURCE FILE, BUT RESULT OF COMPILATION * ***************************************************** This file was generated by po4a(7). Do not store it (in VCS, for example), but store the PO file used as source file by po4a-translate. In fact, consider this as a binary, and the PO file as a regular .c file: If the PO get lost, keeping this translation up-to-date will be harder. =pod =encoding UTF-8 =head1 NOMBRE dos2unix - Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa =head1 SINOPSIS dos2unix [parámetros] [ARCHIVO ...] [-n ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...] unix2dos [parámetros] [ARCHIVO ...] [-n ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...] =head1 DESCRIPCIÓN El paquete Dos2unix incluye las herramientas C y C para convertir archivos de texto plano en formato DOS o Mac a formato Unix y viceversa. En archivos de texto DOS/Windows, un salto de línea, también conocido como nueva línea, es una combinación de dos caracteres: un retorno de carro (CR) seguido por un salto de línea (LF). En archivos de texto Unix, un salto de línea es solamente un carácter: el salto de línea (LF). En archivos de texto Mac, antes de Mac OS X, un salto de línea era sólo un carácter retorno de carro (CR). Actualmente, Mac OS usa el estilo Unix de saltos de línea (LF). Además de saltos de línea, Dos2unix puede también convertir la codificación de archivos. Unas cuantas páginas de códigos DOS pueden ser convertidas a Unix Latin-1. Y archivos Unicode de Windows (UTF-16) pueden ser convertidos a archivos Unicode de Unix (UTF-8). Los archivos binarios son ignorados automáticamente, a menos que se fuerce su conversión. Los archivos no regulares, tales como directorios y FIFO, son ignorados automáticamente. Los enlaces simbólicos y sus destinos no son modificados por defecto. Los enlaces simbólicos pueden opcionalmente ser reemplazados, o la salida puede ser escrita al destino simbólico del enlace. En Windows no está soportada la escritura a enlaces simbólicos. Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion. =head1 PARÁMETROS =over 4 =item B<--> Todos los parámetros siguientes son tratados como nombres de archivo. Use este parámetro si desea convertir archivos cuyos nombres inician con un guión. Por ejemplo para convertir un archivoo llamado "-foo", use este comando: dos2unix -- -foo O en modo de archivo nuevo: dos2unix -n -- -foo out.txt =item B<-ascii> Sólo convierte los salto de línea. Éste es el modo de conversión por defecto. =item B<-iso> Conversión entre el conjunto de caracteres DOS e ISO-8859-1. Véase también la sección MODOS DE CONVERSIÓN. =item B<-1252> Usa la página de códigos Windows 1252 (Europa Occidental). =item B<-437> Usa la página de códigos DOS 437 (EE. UU.). Está es la página de códigos usada por defecto para conversión ISO. =item B<-850> Usa la página de códigos DOS 850 (Europa Occidental). =item B<-860> Usa la página de códigos DOS 860 (Portugués). =item B<-863> Usa la página de códigos DOS 863 (Francocanadiense). =item B<-865> Usa la página de códigos DOS 865 (Nórdico). =item B<-7> Convierte caracteres de 8 bits al espacio de 7 bits. =item B<-b, --keep-bom> Mantiene la Marca de Orden de Byte (BOM). Cuando el archivo de entrada tiene BOM, escribe BOM en el archivo de salida. Este es el comportamiento por defecto en la conversión a saltos de línea DOS. Vea también la opción C<-r>. =item B<-c, --convmode CONVMODE> Establece el modo de conversión, Donde CONVMODE puede ser: I, I<7bit>, I, I siendo ascii el valor por defecto. =item B<-D, --display-enc ENCODING> Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default. This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed. There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages. =over 4 =item B Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page. The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK. =item B The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it. When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font. The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program. When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. =item B The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding. The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed. In a ConEmu console the utf8 encoding method works well. When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. =back The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C. =item B<-f, --force> Fuerza la conversión de archivos binarios. =item B<-gb, --gb18030> En Windows los archivos UTF-16 se convierten por defecto a UTF-8, sin tener en cuenta la configuración local. Use esta opción para convertir archivos UTF-16 a GB18030. Esta opción sólo está disponible en Windows.l Véase también la sección GB18030. =item B<-h, --help> Despiega la ayuda y termina el programa. =item B<-i[MARCAS], --info[= MARCAS] ARCHIVO ...> Muestra la información del archivo. No se realiza ninguna conversión. Se muestra la siguiente información, en este orden: número de saltos de línea DOS, número de saltos de línea Unix, número de saltos de línea Mac, Marca de Orden de Byte, de texto o binario, nombre del archivo. Ejemplo de salida: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>. Se pueden utilizar marcas extras opcionales para modificar la salida. Se pueden añadir una o más marcas. =over 4 =item B Muestra el número de saltos de línea DOS. =item B Muestra el número de saltos de línea Unix. =item B Muestra el número de saltos de línea Mac. =item B Muestra la Marca de Orden de Byte. =item B Muestra si el archivo es de texto o binario. =item B Muestra sólo los archivos que pueden ser convertidos. Con la marca C dos2unix sólo mostrará los archivos que contengan saltos de línea DOS, unix2dos sólo mostrará los nombres de archivo que tengan saltos de línea Unix. =item B Print a header. =item B

Show file names without path. =back Ejemplos: Muestra información para todos los archivos *.txt: dos2unix -i *.txt Muestra sólo el número de saltos de línea de DOS y de Unix: dos2unix -idu *.txt Muestra sólo la Marca de Orden de Byte. dos2unix --info=b *.txt Muestra los archivos que tienen saltos de línea DOS: dos2unix -ic *.txt Muestra los archivos que tienen saltos de línea Unix: unix2dos -ic *.txt Convert only files that have DOS line breaks and leave the other files untouched: dos2unix -ic *.txt | xargs dos2unix Find text files that have DOS line breaks: find -name '*.txt' | xargs dos2unix -ic =item B<-k, --keepdate> Mantiene la fecha del archivo de salida igual a la del archivo de entrada. =item B<-L, --license> Muestra la licencia del programa. =item B<-l, --newline> Añade salto de línea adicional. B: Sólo los saltos de línea DOS son cambiados por dos saltos de línea Unix. En modo Mac sólo los saltos de línea Mac son cambiados por dos saltos de línea Unix. B: Sólo los saltos de línea Unix son cambiados por dos saltos de línea DOS. En modo Mac los saltos de línea Unix son cambiados por dos saltos de línea Mac. =item B<-m, --add-bom> Escribe una Marca de Orden de Bytes (BOM) en el archivo de salida. Por defecto se escribe una BOM UTF-8. Cuando el archivo de entrada es UTF-16 y se usa la opción C<-u>, se escribirá un BOM UTF-16. No utilice esta opción cuando la codificación de salida sea distinta de UTF-8, UTF-16 o GB18030. Véase también la sección UNICODE. =item B<-n, --newfile ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...> Modo de archivo nuevo. Convierte el archivo ARCHIVO_DE_ENTRADA y escribe la salida al archivo ARCHIVO_DE_SALIDA. Los nombres de archivo deben ser dados en pares y los comodines I deben ser usados o I sus archivos. La persona que inicia la conversión en el modo de archivo nuevo (emparejado) será el propietario del archivo convertido. Los permisos de lectura/escritura del archivo nuevo serán los permisos del archivo original menos la umask(1) de la persona que ejecute la conversión. =item B<-o, --oldfile ARCHIVO ...> Modo de archivo antiguo. Convierte el archivo ARCHIVO y lo sobrescribe con la salida. El programa por defecto se ejecuta en este modo. Se pueden emplear comodines. En modo de archivo antiguo (in situ), el archivo convertido tiene el mismo propietario, grupo y permisos de lectura/escritura que el archivo original. Lo mismo aplica cuando el archivo es convertido por otro usuario que tiene permiso de lectura en el archivo (p.e. usuario root). La conversión será abortada cuando no sea posible preservar los valores originales. Cambiar el propietario implicaría que el propietario original ya no podrá leer el archivo. Cambiar el grupo podría ser un riesgo de seguridad, ya que el archivo podría ser accesible a personas inadecuadas. La preservación del propietario, grupo, y permisos de lectura/escritura sólo está soportada bajo Unix. =item B<-q, --quiet> Modo silencioso. Suprime todas las advertencias y mensajes. El valor retornado es cero. Excepto cuando se emplean parámetros incorrectos. =item B<-r, --remove-bom> Elimina la Marca de Orden de Byte (BOM). No escribe el BOM en el archivo de salida. Este es el comportamiento por defecto al convertir a saltos de línea Unix. Vea también la opción C<-b>. =item B<-s, --safe> Ignora los archivos binarios (por defecto). The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file. =item B<-u, --keep-utf16> Mantiene la codificación original UTF-16 en el archivo de entrada. El archivo de salida se escribirá con la misma codificación UTF-16, little o big endian, como el archivo de entrada. Esto impide la transformación a UTF-8. En consecuencia se escribirá un BOM UTF-16. Esta opción se puede desactivar con la opción C<-ascii>. =item B<-ul, --assume-utf16le> Se asume que el formato de archivo de entrada es UTF-16LE. Cuando existe una Marca de Orden de Bytes (BOM) en el archivo de entrada, la BOM tiene prioridad sobre esta opción. Cuando se hace una suposición incorrecta (el archivo de entrada no estaba en formato UTF-16LE) y la conversión tiene éxito, obtendrá un archivo UTF-8 de salida con el texto erróneo. La conversión errónea puede deshacerse con iconv(1) convirtiendo el archivo UTF-8 de salida de vuelta a UTF-16LE. Esto restaurará el archivo original. El supuesto de UTF-16LE funciona como un I. Al cambiar al modo por defecto I el supuesto UTF-16LE es deshabilitado. =item B<-ub, --assume-utf16be> Se asume que el formato del archivo de entrada es UTF-16BE. Esta opción funciona igual que la opción C<-ul>. =item B<-v, --verbose> Mostrar mensajes detallados. Se muestra información extra acerca de Marcas de Orden de Bytes (BOM) y el número de saltos de línea convertidos. =item B<-F, --follow-symlink> Sigue los enlaces simbólicos y convierte los destinos. =item B<-R, --replace-symlink> Reemplaza los enlaces simbólicos con los archivos convertidos (los archivos destino originales no se alteran). =item B<-S, --skip-symlink> No altera los enlaces simbólicos ni sus destinos (por defecto). =item B<-V, --version> Despiega la información de la versión y termina el programa. =back =head1 MODO MAC En modo normal los saltos de línea son convertidos de DOS a Unix y viceversa. Los saltos de línea Mac no son convertidos. En modo Mac los saltos de línea son convertidos de Mac a Unix y viceversa. Los saltos de línea DOS no son modificados. Para ejecutar en modo Mac use el modificador C<-c mac> o use los comandos C o C. =head1 MODOS DE CONVERSIÓN =over 4 =item B En modo C sólo los saltos de línea son convertidos. Éste es el modo de conversión por defecto. Aunque el nombre de este modo es ASCII, que es un estándar de 7 bits, éste emplea 8 bits. Siempre use este modo cuando convierta archivos Unicode UTF-8. =item B<7bit> En este modo todos los caracteres no ASCII de 8 bits (con valores de 128 a 255) son convertidos al espacio de 7 bits. =item B Los caracteres son convertidos entre un conjunto de caracteres DOS (página de códigos) y el conjunto de caracteres ISO-8859-1 (Latín-1) de Unix. Los caracteres DOS sin equivalente ISO-8859-1, para los cuales la conversión es imposible, son convertidos en un punto. Lo mismo se aplica para caracteres ISO-8859-1 sin contraparte DOS. Cuando sólo se emplea el parámetro C<-iso>, dos2unix intentará determinar la página de códigos activa. Cuando esto no sea posible, dos2unix utilizará la página de códigos 437 por defecto, la cual es empleada principalmente en EE. UU. Para forzar una página de códigos específica emplee los parámetros C<-437> (EE. UU.), C<-850> (Europa Occidental), C<-860> (Portugués), C<-863> (Francocanadiense), o C<-865> (Nórdico). La página de códigos Windows 1252 (Europa Occidental) también está soportada con el parámetro C<-1252>. Para acceder a otras páginas de códigos use dos2unix en combinación con iconv(1). Iconv puede convertir entre una larga lista de codificaciones de caracteres. No use la conversión ISO en archivos de texto Unicode. Esto corrompería los archivos codificados como UTF-8. Algunos ejemplos: Convierte de la página de códigos por defecto de DOS a Latín-1 de Unix: dos2unix -iso -n in.txt out.txt Convierte de DOS CP850 a Unix Latín-1: dos2unix -850 -n in.txt out.txt Convierte de Windows CP1252 a Unix Latin-1: dos2unix -1252 -n in.txt out.txt Convierte de Windows CP1252 a Unix UTF-8 (Unicode). iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Convierte de Unix Latin-1 a la página de códigos por defecto de DOS: unix2dos -iso -n in.txt out.txt Convierte de Unix Latin-1 a DOS CP850: unix2dos -850 -n in.txt out.txt Convierte de Unix Latin-1 a Windows CP1252. unix2dos -1252 -n in.txt out.txt Convierte de Unix UTF-8 (Unicode) a Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt Véase también L y L. =back =head1 UNICODE =head2 Codificaciones Existen diferentes codificaciones Unicode. En Unix y Linux los archivos Unicode son codificados comúnmente en UTF-8. En Windows los archivos de texto Unicode pueden estar codificados en UTF-8, UTF-16, o UTF-16 big endian, pero en general son codificados en formato UTF-16. =head2 Conversion Los archivos de texto Unicode pueden tener saltos de línea DOS, Unix o Mac, como cualquier archivo de texto. Todas las versiones de dos2unix y unix2dos pueden convertir archivos codificados como UTF-8, debido a que UTF-8 fue diseñado para retro-compatibilidad con ASCII. Dos2unix y unix2dos con soporte Unicode UTF-16, pueden leer archivos de texto codificados como UTF-16 little y big endian. Para ver si dos2unix fue compilado con soporte UTF-16 escriba C. En Unix/Linux los archivos codificados con UTF-16 se convierten a la codificación de caracteres local. Use el comando locale(1) para averiguar la codificación de caracteres local. Cuando no se puede hacer la conversión se obtendrá un error de conversión y se omitirá el archivo. En Windows los archivos UTF-16 se convierten por defecto a UTF-8. Los archivos de texto forrajeados con UTF-8 están soportados tanto en Windows como en Unix/Linux. Las codificaciones UTF-16 y UTF-8 son totalmente compatibles, no se perderá ningún texto en la conversión. Cuando ocurre un error de conversión de UTF-16 a UTF-8, por ejemplo cuando el archivo de entrada UTF-16 contiene un error, se omitirá el archivo. Cuando se usa la opción C<-u>, el archivo de salida se escribirá en la misma codificación UTF-16 que el archivo de entrada. La opción C<-u> previene la conversión a UTF-8. Dos2unix y unix2dos no tienen la opción de convertir archivos UTF-8 a UTF-16. La conversión en modos ISO y 7-bit no funciona en archivos UTF-16. =head2 Marca de orden de bytes En Windows los archivos de texto Unicode típicamente tienen una Marca de Orden de Bytes (BOM), debido a que muchos programas de Windows (incluyendo el Bloc de Notas) añaden una BOM por defecto. Véase también L. En Unix los archivos Unicode no suelen tener BOM. Se supone que los archivos de texto son codificados en la codificación local de caracteres. Dos2unix sólo puede detectar si un archivo está en formato UTF-16 si el archivo tiene una BOM. Cuando un archivo UTF-16 no tiene una BOM, dos2unix tratará el archivo como un archivo binario. Use la opción C<-ul> o C<-ub> para convertir un archivo UTF-16 sin BOM. Dos2Unix, por defecto, no escribe BOM en el archivo de salida. Con la opción C<-b> Dos2unix escribe el BOM cuando el archivo de entrada tiene BOM. Unix2dos escribe BOM en el archivo de salida cuando el archivo de entrada tiene BOM. Use la opción C<-r> para eliminar la BOM. Dos2unix y unix2dos escriben siempre BOM cuando se usa la opción C<-m>. =head2 Unicode file names on Windows Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C. There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name. =head2 Ejemplos Unicode Convertir de Windows UTF-16 (con una BOM) a Unix UTF-8: dos2unix -n in.txt out.txt Convertir de Windows UTF-16LE (sin una BOM) a Unix UTF-8: dos2unix -ul -n in.txt out.txt Convertir de Unix UTF-8 a Windows UTF-8 sin una BOM: unix2dos -m -n in.txt out.txt Convertir de Unix UTF-8 a Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt =head1 GB18030 GB18030 es un estándar del gobierno chino. Todo producto software vendido en China está obligado por ley a contener un subconjunto del GB18030 estándar. Véase L. GB18030 es totalmente compatible con Unicode y puede considerarse como formato de transformación Unicode. Como ocurre con UTF-8, GB18030 es compatible con ASCII. GB18030 también es compatible con la página de códigos de Windows 936, también conocida como GBK. En Unix/Linux los archivos UTF-16 se convierten a GB18030 cuando la codificación local se establece en GB18030. Tenga en cuenta que esto sólo funcionará si la configuración local es soportada por el sistema. Utilice C para obtener el listado de configuraciones regionales admitidas. Use la opción C<-ul> o C<-ub> para convertir un archivo UTF-16 sin BOM. Los archivos codificados como GB18030 pueden tener una Marca de Orden de Bytes, como ocurre con los archivos Unicode. =head1 EJEMPLOS Lee la entrada desde 'stdin' y escribe la salida a 'stdout': dos2unix < a.txt cat a.txt | dos2unix Convierte y reemplaza a.txt. Convierte y reemplaza b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Convierte y reemplaza a.txt empleando modo de conversión ascii: dos2unix a.txt Convierte y reemplaza a.txt empleando modo de conversión ascii, convierte y reemplaza b.txt empleando modo de conversión de 7bits: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Convierte a.txt del formato de Mac a Unix: dos2unix -c mac a.txt mac2unix a.txt Convierte a.txt del formato de Unix a Mac: unix2dos -c mac a.txt unix2mac a.txt Convierte y reemplaza a.txt manteniendo la fecha del archivo original: dos2unix -k a.txt dos2unix -k -o a.txt Convierte a.txt y escribe la salida en e.txt: dos2unix -n a.txt e.txt Convierte a.txt y escribe la salida en e.txt, manteniendo la fecha de e.txt igual a la de a.txt: dos2unix -k -n a.txt e.txt Convierte y reemplaza a.txt, convierte b.txt y escribe en e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Convierte c.txt y escribe en e.txt, convierte y reemplaza a.txt, convierte y reemplaza b.txt, convierte d.txt y escribe en f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 CONVERSIÓN RECURSIVA Use dos2unix en combinación con los comandos find(1) y xargs(1) para convertir recursivamente archivos de texto contenidos en un árbol de directorios. Por ejemplo para convertir todos los archivos .txt en el árbol de directorios debajo del directorio actual escriba: find . -name '*.txt' |xargs dos2unix In a Windows Command Prompt the following command can be used: for /R %G in (*.txt) do dos2unix "%G" PowerShell users can use the following command in Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} =head1 INTERNACIONALIZACIÓN =over 4 =item B El idioma principal se selecciona con la variable de entorno LANG. La variable LANG consiste de varias partes. La primer parte es el código del idioma en minúsculas. La segunda es opcional y es el código del país en mayúsculas, precedido por un guión bajo. Existe también una tercera parte opcional: la codificación de caracteres, precedida por un punto. Unos cuantos ejemplos para intérpretes de comandos tipo POSIX estándar: export LANG=nl Neerlandés export LANG=nl_NL Neerlandés, Países Bajos export LANG=nl_BE Neerlandés, Bélgica export LANG=es_ES Español, España export LANG=es_MX Español, México export LANG=en_US.iso88591 Ingles, EE. UU., codificación Latín-1 export LANG=en_GB.UTF-8 Ingles, Reino Unido, codificación UTF-8 Para obtener una lista completa de códigos de idioma y país véase el manual de gettext: L En sistemas Unix puede emplear el comando locale(1) para obtener información específica de locale. =item B Con la variable de entorno LANGUAGE puede especificar una lista de prioridad de los idiomas, separados por dos puntos. Dos2unix da preferencia a LANGUAGE sobre LANG. Por ejemplo, primero neerlandés y entonces alemán: C. Para usar una lista de prioridad de idiomas a través de la variable LANGUAGE tiene que habilitar antes la internacionalización, asignando un valor distinto de "C" a LANG (o LC_ALL). Véase también el manual de gettext: L Si selecciona un idioma que no está disponible el programa funcionará en ingles. =item B Con la variable de entorno DOS2UNIX_LOCALEDIR el LOCALEDIR asignado durante la compilación puede ser modificado. LOCALEDIR es usado para encontrar los archivos de idioma. El valor por defecto de GNU es C. El parámetro B<--version> mostrará el LOCALEDIR en uso. Ejemplo (intérprete de comandos POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 VALOR DE RETORNO Se regresa cero cuando el programa termina exitosamente. Cuando ocurre un error del sistema se regresará el último número de error del sistema. Para otros errores se regresa 1. El valor de retorno es siempre cero en modo silencioso, excepto cuando se emplean parámetros incorrectos. =head1 ESTÁNDARES L L L L =head1 AUTORES Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer) Página del proyecto: L Página de SourceForge: L =head1 VÉASE TAMBIÉN file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/es/man1/dos2unix.txt0000644000175500010010000007204312721132571017110 0ustar waterlanGeenNOMBRE dos2unix - Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa SINOPSIS dos2unix [parámetros] [ARCHIVO ...] [-n ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...] unix2dos [parámetros] [ARCHIVO ...] [-n ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...] DESCRIPCIÓN El paquete Dos2unix incluye las herramientas "dos2unix" y "unix2dos" para convertir archivos de texto plano en formato DOS o Mac a formato Unix y viceversa. En archivos de texto DOS/Windows, un salto de línea, también conocido como nueva línea, es una combinación de dos caracteres: un retorno de carro (CR) seguido por un salto de línea (LF). En archivos de texto Unix, un salto de línea es solamente un carácter: el salto de línea (LF). En archivos de texto Mac, antes de Mac OS X, un salto de línea era sólo un carácter retorno de carro (CR). Actualmente, Mac OS usa el estilo Unix de saltos de línea (LF). Además de saltos de línea, Dos2unix puede también convertir la codificación de archivos. Unas cuantas páginas de códigos DOS pueden ser convertidas a Unix Latin-1. Y archivos Unicode de Windows (UTF-16) pueden ser convertidos a archivos Unicode de Unix (UTF-8). Los archivos binarios son ignorados automáticamente, a menos que se fuerce su conversión. Los archivos no regulares, tales como directorios y FIFO, son ignorados automáticamente. Los enlaces simbólicos y sus destinos no son modificados por defecto. Los enlaces simbólicos pueden opcionalmente ser reemplazados, o la salida puede ser escrita al destino simbólico del enlace. En Windows no está soportada la escritura a enlaces simbólicos. Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options "-o" and "-n". Another difference is that the SunOS/Solaris version uses by default *iso* mode conversion while this version uses by default *ascii* mode conversion. PARÁMETROS -- Todos los parámetros siguientes son tratados como nombres de archivo. Use este parámetro si desea convertir archivos cuyos nombres inician con un guión. Por ejemplo para convertir un archivoo llamado "-foo", use este comando: dos2unix -- -foo O en modo de archivo nuevo: dos2unix -n -- -foo out.txt -ascii Sólo convierte los salto de línea. Éste es el modo de conversión por defecto. -iso Conversión entre el conjunto de caracteres DOS e ISO-8859-1. Véase también la sección MODOS DE CONVERSIÓN. -1252 Usa la página de códigos Windows 1252 (Europa Occidental). -437 Usa la página de códigos DOS 437 (EE. UU.). Está es la página de códigos usada por defecto para conversión ISO. -850 Usa la página de códigos DOS 850 (Europa Occidental). -860 Usa la página de códigos DOS 860 (Portugués). -863 Usa la página de códigos DOS 863 (Francocanadiense). -865 Usa la página de códigos DOS 865 (Nórdico). -7 Convierte caracteres de 8 bits al espacio de 7 bits. -b, --keep-bom Mantiene la Marca de Orden de Byte (BOM). Cuando el archivo de entrada tiene BOM, escribe BOM en el archivo de salida. Este es el comportamiento por defecto en la conversión a saltos de línea DOS. Vea también la opción "-r". -c, --convmode CONVMODE Establece el modo de conversión, Donde CONVMODE puede ser: *ascii*, *7bit*, *iso*, *mac* siendo ascii el valor por defecto. -D, --display-enc ENCODING Set encoding of displayed text. Where ENCODING is one of: *ansi*, *unicode*, *unicodebom*, *utf8*, *utf8bom* with ansi being the default. This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed. There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages. ansi Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the "chcp" command, because dos2unix uses the Windows system code page. The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK. unicode, unicodebom The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it. When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font. The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program. When method "unicodebom" is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. utf8, utf8bom The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the "unicode" encoding. The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed. In a ConEmu console the utf8 encoding method works well. When method "utf8bom" is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to "unicode", "unicodebom", "utf8", or "utf8bom". -f, --force Fuerza la conversión de archivos binarios. -gb, --gb18030 En Windows los archivos UTF-16 se convierten por defecto a UTF-8, sin tener en cuenta la configuración local. Use esta opción para convertir archivos UTF-16 a GB18030. Esta opción sólo está disponible en Windows.l Véase también la sección GB18030. -h, --help Despiega la ayuda y termina el programa. -i[MARCAS], --info[= MARCAS] ARCHIVO ... Muestra la información del archivo. No se realiza ninguna conversión. Se muestra la siguiente información, en este orden: número de saltos de línea DOS, número de saltos de línea Unix, número de saltos de línea Mac, Marca de Orden de Byte, de texto o binario, nombre del archivo. Ejemplo de salida: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Note that sometimes a binary file can be mistaken for a text file. See also option "-s". Se pueden utilizar marcas extras opcionales para modificar la salida. Se pueden añadir una o más marcas. d Muestra el número de saltos de línea DOS. u Muestra el número de saltos de línea Unix. m Muestra el número de saltos de línea Mac. b Muestra la Marca de Orden de Byte. t Muestra si el archivo es de texto o binario. c Muestra sólo los archivos que pueden ser convertidos. Con la marca "c" dos2unix sólo mostrará los archivos que contengan saltos de línea DOS, unix2dos sólo mostrará los nombres de archivo que tengan saltos de línea Unix. h Print a header. p Show file names without path. Ejemplos: Muestra información para todos los archivos *.txt: dos2unix -i *.txt Muestra sólo el número de saltos de línea de DOS y de Unix: dos2unix -idu *.txt Muestra sólo la Marca de Orden de Byte. dos2unix --info=b *.txt Muestra los archivos que tienen saltos de línea DOS: dos2unix -ic *.txt Muestra los archivos que tienen saltos de línea Unix: unix2dos -ic *.txt Convert only files that have DOS line breaks and leave the other files untouched: dos2unix -ic *.txt | xargs dos2unix Find text files that have DOS line breaks: find -name '*.txt' | xargs dos2unix -ic -k, --keepdate Mantiene la fecha del archivo de salida igual a la del archivo de entrada. -L, --license Muestra la licencia del programa. -l, --newline Añade salto de línea adicional. dos2unix: Sólo los saltos de línea DOS son cambiados por dos saltos de línea Unix. En modo Mac sólo los saltos de línea Mac son cambiados por dos saltos de línea Unix. unix2dos: Sólo los saltos de línea Unix son cambiados por dos saltos de línea DOS. En modo Mac los saltos de línea Unix son cambiados por dos saltos de línea Mac. -m, --add-bom Escribe una Marca de Orden de Bytes (BOM) en el archivo de salida. Por defecto se escribe una BOM UTF-8. Cuando el archivo de entrada es UTF-16 y se usa la opción "-u", se escribirá un BOM UTF-16. No utilice esta opción cuando la codificación de salida sea distinta de UTF-8, UTF-16 o GB18030. Véase también la sección UNICODE. -n, --newfile ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ... Modo de archivo nuevo. Convierte el archivo ARCHIVO_DE_ENTRADA y escribe la salida al archivo ARCHIVO_DE_SALIDA. Los nombres de archivo deben ser dados en pares y los comodines *no* deben ser usados o *perderá* sus archivos. La persona que inicia la conversión en el modo de archivo nuevo (emparejado) será el propietario del archivo convertido. Los permisos de lectura/escritura del archivo nuevo serán los permisos del archivo original menos la umask(1) de la persona que ejecute la conversión. -o, --oldfile ARCHIVO ... Modo de archivo antiguo. Convierte el archivo ARCHIVO y lo sobrescribe con la salida. El programa por defecto se ejecuta en este modo. Se pueden emplear comodines. En modo de archivo antiguo (in situ), el archivo convertido tiene el mismo propietario, grupo y permisos de lectura/escritura que el archivo original. Lo mismo aplica cuando el archivo es convertido por otro usuario que tiene permiso de lectura en el archivo (p.e. usuario root). La conversión será abortada cuando no sea posible preservar los valores originales. Cambiar el propietario implicaría que el propietario original ya no podrá leer el archivo. Cambiar el grupo podría ser un riesgo de seguridad, ya que el archivo podría ser accesible a personas inadecuadas. La preservación del propietario, grupo, y permisos de lectura/escritura sólo está soportada bajo Unix. -q, --quiet Modo silencioso. Suprime todas las advertencias y mensajes. El valor retornado es cero. Excepto cuando se emplean parámetros incorrectos. -r, --remove-bom Elimina la Marca de Orden de Byte (BOM). No escribe el BOM en el archivo de salida. Este es el comportamiento por defecto al convertir a saltos de línea Unix. Vea también la opción "-b". -s, --safe Ignora los archivos binarios (por defecto). The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file. -u, --keep-utf16 Mantiene la codificación original UTF-16 en el archivo de entrada. El archivo de salida se escribirá con la misma codificación UTF-16, little o big endian, como el archivo de entrada. Esto impide la transformación a UTF-8. En consecuencia se escribirá un BOM UTF-16. Esta opción se puede desactivar con la opción "-ascii". -ul, --assume-utf16le Se asume que el formato de archivo de entrada es UTF-16LE. Cuando existe una Marca de Orden de Bytes (BOM) en el archivo de entrada, la BOM tiene prioridad sobre esta opción. Cuando se hace una suposición incorrecta (el archivo de entrada no estaba en formato UTF-16LE) y la conversión tiene éxito, obtendrá un archivo UTF-8 de salida con el texto erróneo. La conversión errónea puede deshacerse con iconv(1) convirtiendo el archivo UTF-8 de salida de vuelta a UTF-16LE. Esto restaurará el archivo original. El supuesto de UTF-16LE funciona como un *modo de conversión*. Al cambiar al modo por defecto *ascii* el supuesto UTF-16LE es deshabilitado. -ub, --assume-utf16be Se asume que el formato del archivo de entrada es UTF-16BE. Esta opción funciona igual que la opción "-ul". -v, --verbose Mostrar mensajes detallados. Se muestra información extra acerca de Marcas de Orden de Bytes (BOM) y el número de saltos de línea convertidos. -F, --follow-symlink Sigue los enlaces simbólicos y convierte los destinos. -R, --replace-symlink Reemplaza los enlaces simbólicos con los archivos convertidos (los archivos destino originales no se alteran). -S, --skip-symlink No altera los enlaces simbólicos ni sus destinos (por defecto). -V, --version Despiega la información de la versión y termina el programa. MODO MAC En modo normal los saltos de línea son convertidos de DOS a Unix y viceversa. Los saltos de línea Mac no son convertidos. En modo Mac los saltos de línea son convertidos de Mac a Unix y viceversa. Los saltos de línea DOS no son modificados. Para ejecutar en modo Mac use el modificador "-c mac" o use los comandos "mac2unix" o "unix2mac". MODOS DE CONVERSIÓN ascii En modo "ascii" sólo los saltos de línea son convertidos. Éste es el modo de conversión por defecto. Aunque el nombre de este modo es ASCII, que es un estándar de 7 bits, éste emplea 8 bits. Siempre use este modo cuando convierta archivos Unicode UTF-8. 7bit En este modo todos los caracteres no ASCII de 8 bits (con valores de 128 a 255) son convertidos al espacio de 7 bits. iso Los caracteres son convertidos entre un conjunto de caracteres DOS (página de códigos) y el conjunto de caracteres ISO-8859-1 (Latín-1) de Unix. Los caracteres DOS sin equivalente ISO-8859-1, para los cuales la conversión es imposible, son convertidos en un punto. Lo mismo se aplica para caracteres ISO-8859-1 sin contraparte DOS. Cuando sólo se emplea el parámetro "-iso", dos2unix intentará determinar la página de códigos activa. Cuando esto no sea posible, dos2unix utilizará la página de códigos 437 por defecto, la cual es empleada principalmente en EE. UU. Para forzar una página de códigos específica emplee los parámetros -437 (EE. UU.), -850 (Europa Occidental), -860 (Portugués), -863 (Francocanadiense), o -865 (Nórdico). La página de códigos Windows 1252 (Europa Occidental) también está soportada con el parámetro -1252. Para acceder a otras páginas de códigos use dos2unix en combinación con iconv(1). Iconv puede convertir entre una larga lista de codificaciones de caracteres. No use la conversión ISO en archivos de texto Unicode. Esto corrompería los archivos codificados como UTF-8. Algunos ejemplos: Convierte de la página de códigos por defecto de DOS a Latín-1 de Unix: dos2unix -iso -n in.txt out.txt Convierte de DOS CP850 a Unix Latín-1: dos2unix -850 -n in.txt out.txt Convierte de Windows CP1252 a Unix Latin-1: dos2unix -1252 -n in.txt out.txt Convierte de Windows CP1252 a Unix UTF-8 (Unicode). iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Convierte de Unix Latin-1 a la página de códigos por defecto de DOS: unix2dos -iso -n in.txt out.txt Convierte de Unix Latin-1 a DOS CP850: unix2dos -850 -n in.txt out.txt Convierte de Unix Latin-1 a Windows CP1252. unix2dos -1252 -n in.txt out.txt Convierte de Unix UTF-8 (Unicode) a Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt Véase también y . UNICODE Codificaciones Existen diferentes codificaciones Unicode. En Unix y Linux los archivos Unicode son codificados comúnmente en UTF-8. En Windows los archivos de texto Unicode pueden estar codificados en UTF-8, UTF-16, o UTF-16 big endian, pero en general son codificados en formato UTF-16. Conversion Los archivos de texto Unicode pueden tener saltos de línea DOS, Unix o Mac, como cualquier archivo de texto. Todas las versiones de dos2unix y unix2dos pueden convertir archivos codificados como UTF-8, debido a que UTF-8 fue diseñado para retro-compatibilidad con ASCII. Dos2unix y unix2dos con soporte Unicode UTF-16, pueden leer archivos de texto codificados como UTF-16 little y big endian. Para ver si dos2unix fue compilado con soporte UTF-16 escriba "dos2unix -V". En Unix/Linux los archivos codificados con UTF-16 se convierten a la codificación de caracteres local. Use el comando locale(1) para averiguar la codificación de caracteres local. Cuando no se puede hacer la conversión se obtendrá un error de conversión y se omitirá el archivo. En Windows los archivos UTF-16 se convierten por defecto a UTF-8. Los archivos de texto forrajeados con UTF-8 están soportados tanto en Windows como en Unix/Linux. Las codificaciones UTF-16 y UTF-8 son totalmente compatibles, no se perderá ningún texto en la conversión. Cuando ocurre un error de conversión de UTF-16 a UTF-8, por ejemplo cuando el archivo de entrada UTF-16 contiene un error, se omitirá el archivo. Cuando se usa la opción "-u", el archivo de salida se escribirá en la misma codificación UTF-16 que el archivo de entrada. La opción "-u" previene la conversión a UTF-8. Dos2unix y unix2dos no tienen la opción de convertir archivos UTF-8 a UTF-16. La conversión en modos ISO y 7-bit no funciona en archivos UTF-16. Marca de orden de bytes En Windows los archivos de texto Unicode típicamente tienen una Marca de Orden de Bytes (BOM), debido a que muchos programas de Windows (incluyendo el Bloc de Notas) añaden una BOM por defecto. Véase también . En Unix los archivos Unicode no suelen tener BOM. Se supone que los archivos de texto son codificados en la codificación local de caracteres. Dos2unix sólo puede detectar si un archivo está en formato UTF-16 si el archivo tiene una BOM. Cuando un archivo UTF-16 no tiene una BOM, dos2unix tratará el archivo como un archivo binario. Use la opción "-ul" o "-ub" para convertir un archivo UTF-16 sin BOM. Dos2Unix, por defecto, no escribe BOM en el archivo de salida. Con la opción "-b" Dos2unix escribe el BOM cuando el archivo de entrada tiene BOM. Unix2dos escribe BOM en el archivo de salida cuando el archivo de entrada tiene BOM. Use la opción "-r" para eliminar la BOM. Dos2unix y unix2dos escriben siempre BOM cuando se usa la opción "-m". Unicode file names on Windows Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type "dos2unix -V". There are some issues with displaying Unicode file names in a Windows console. See option "-D", "--display-enc". The file names may be displayed wrongly in the console, but the files will be written with the correct name. Ejemplos Unicode Convertir de Windows UTF-16 (con una BOM) a Unix UTF-8: dos2unix -n in.txt out.txt Convertir de Windows UTF-16LE (sin una BOM) a Unix UTF-8: dos2unix -ul -n in.txt out.txt Convertir de Unix UTF-8 a Windows UTF-8 sin una BOM: unix2dos -m -n in.txt out.txt Convertir de Unix UTF-8 a Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt GB18030 GB18030 es un estándar del gobierno chino. Todo producto software vendido en China está obligado por ley a contener un subconjunto del GB18030 estándar. Véase . GB18030 es totalmente compatible con Unicode y puede considerarse como formato de transformación Unicode. Como ocurre con UTF-8, GB18030 es compatible con ASCII. GB18030 también es compatible con la página de códigos de Windows 936, también conocida como GBK. En Unix/Linux los archivos UTF-16 se convierten a GB18030 cuando la codificación local se establece en GB18030. Tenga en cuenta que esto sólo funcionará si la configuración local es soportada por el sistema. Utilice "locale -a" para obtener el listado de configuraciones regionales admitidas. Use la opción "-ul" o "-ub" para convertir un archivo UTF-16 sin BOM. Los archivos codificados como GB18030 pueden tener una Marca de Orden de Bytes, como ocurre con los archivos Unicode. EJEMPLOS Lee la entrada desde 'stdin' y escribe la salida a 'stdout': dos2unix < a.txt cat a.txt | dos2unix Convierte y reemplaza a.txt. Convierte y reemplaza b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Convierte y reemplaza a.txt empleando modo de conversión ascii: dos2unix a.txt Convierte y reemplaza a.txt empleando modo de conversión ascii, convierte y reemplaza b.txt empleando modo de conversión de 7bits: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Convierte a.txt del formato de Mac a Unix: dos2unix -c mac a.txt mac2unix a.txt Convierte a.txt del formato de Unix a Mac: unix2dos -c mac a.txt unix2mac a.txt Convierte y reemplaza a.txt manteniendo la fecha del archivo original: dos2unix -k a.txt dos2unix -k -o a.txt Convierte a.txt y escribe la salida en e.txt: dos2unix -n a.txt e.txt Convierte a.txt y escribe la salida en e.txt, manteniendo la fecha de e.txt igual a la de a.txt: dos2unix -k -n a.txt e.txt Convierte y reemplaza a.txt, convierte b.txt y escribe en e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Convierte c.txt y escribe en e.txt, convierte y reemplaza a.txt, convierte y reemplaza b.txt, convierte d.txt y escribe en f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt CONVERSIÓN RECURSIVA Use dos2unix en combinación con los comandos find(1) y xargs(1) para convertir recursivamente archivos de texto contenidos en un árbol de directorios. Por ejemplo para convertir todos los archivos .txt en el árbol de directorios debajo del directorio actual escriba: find . -name '*.txt' |xargs dos2unix In a Windows Command Prompt the following command can be used: for /R %G in (*.txt) do dos2unix "%G" PowerShell users can use the following command in Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} INTERNACIONALIZACIÓN LANG El idioma principal se selecciona con la variable de entorno LANG. La variable LANG consiste de varias partes. La primer parte es el código del idioma en minúsculas. La segunda es opcional y es el código del país en mayúsculas, precedido por un guión bajo. Existe también una tercera parte opcional: la codificación de caracteres, precedida por un punto. Unos cuantos ejemplos para intérpretes de comandos tipo POSIX estándar: export LANG=nl Neerlandés export LANG=nl_NL Neerlandés, Países Bajos export LANG=nl_BE Neerlandés, Bélgica export LANG=es_ES Español, España export LANG=es_MX Español, México export LANG=en_US.iso88591 Ingles, EE. UU., codificación Latín-1 export LANG=en_GB.UTF-8 Ingles, Reino Unido, codificación UTF-8 Para obtener una lista completa de códigos de idioma y país véase el manual de gettext: En sistemas Unix puede emplear el comando locale(1) para obtener información específica de locale. LANGUAGE Con la variable de entorno LANGUAGE puede especificar una lista de prioridad de los idiomas, separados por dos puntos. Dos2unix da preferencia a LANGUAGE sobre LANG. Por ejemplo, primero neerlandés y entonces alemán: "LANGUAGE=nl:de". Para usar una lista de prioridad de idiomas a través de la variable LANGUAGE tiene que habilitar antes la internacionalización, asignando un valor distinto de "C" a LANG (o LC_ALL). Véase también el manual de gettext: Si selecciona un idioma que no está disponible el programa funcionará en ingles. DOS2UNIX_LOCALEDIR Con la variable de entorno DOS2UNIX_LOCALEDIR el LOCALEDIR asignado durante la compilación puede ser modificado. LOCALEDIR es usado para encontrar los archivos de idioma. El valor por defecto de GNU es "/usr/local/share/locale". El parámetro --version mostrará el LOCALEDIR en uso. Ejemplo (intérprete de comandos POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale VALOR DE RETORNO Se regresa cero cuando el programa termina exitosamente. Cuando ocurre un error del sistema se regresará el último número de error del sistema. Para otros errores se regresa 1. El valor de retorno es siempre cero en modo silencioso, excepto cuando se emplean parámetros incorrectos. ESTÁNDARES AUTORES Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer) Página del proyecto: Página de SourceForge: VÉASE TAMBIÉN file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/fr/0000755000175500010010000000000012721132563013733 5ustar waterlanGeendos2unix-7.3.4/man/fr/man1/0000755000175500010010000000000012721132613014563 5ustar waterlanGeendos2unix-7.3.4/man/fr/man1/dos2unix.10000644000175500010010000010657612721132564016444 0ustar waterlanGeen.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dos2unix 1" .TH dos2unix 1 "2016-05-24" "dos2unix" "2016-05-24" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NOM" .IX Header "NOM" dos2unix \- Convertit les fichiers textes du format DOS/Mac vers Unix et inversement .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& dos2unix [options] [FICHIER …] [\-n FICHIER_ENTRÉE FICHIER_SORTIE …] \& unix2dos [options] [FICHIER …] [\-n FICHIER_ENTRÉE FICHIER_SORTIE …] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Le package Dos2unix inclut les utilitaires \f(CW\*(C`dos2unix\*(C'\fR et \f(CW\*(C`unix2dos\*(C'\fR pour convertir des fichiers textes au format \s-1DOS\s0 ou Mac vers le format Unix et inversement. .PP Dans les fichiers textes DOS/Windows, un saut de ligne est une combinaison de deux caractères: un retour de chariot (\s-1CR\s0) suivi d'un saut de ligne (\s-1LF\s0). Dans les fichiers textes Unix, le saut de ligne est un seul caractère: le saut de ligne (\s-1LF\s0). Les fichiers textes Mac, avant Mac \s-1OS X,\s0 utilisaient le retour chariot (\s-1CR\s0) comme seul caractère. De nos jours, Mac \s-1OS\s0 utilise le même style de saut de ligne que Unix (\s-1LF\s0). .PP Outre les sauts de lignes, Dos2unix convertit aussi le codage des fichiers. Quelques codes page \s-1DOS\s0 peuvent être convertis en Latin\-1 sous Unix. L'Unicode des fichiers Windows (\s-1UTF\-16\s0) peut être converti en Unicode Unix (\s-1UTF\-8\s0). .PP Les fichiers binaires sont automatiquement ignorés à moins que la conversion soit forcée. .PP Les fichiers non réguliers tels que les répertoires et les FIFOs sont automatiquement ignorés. .PP Les liens symboliques et leur cible sont, par défaut, inchangés. En option, les liens symboliques peuvent être remplacés ou, au choix, la sortie peut être écrite dans la cible du lien symbolique. Écrire dans la cible d'un lien symbolique n'est pas supporté sous Windows. .PP Dos2unix a été conçu comme dos2unix sous SunOS/Solaris. Il y a une différence importante avec la version originale de SunOS/Solaris. Cette version effectue les conversions en place (ancien mode de fichier) tandis que la version originale de SunOS/Solaris ne supporte que la conversion par paire (nouveau mode de fichier). Voyez aussi les options \f(CW\*(C`\-o\*(C'\fR et \f(CW\*(C`\-n\*(C'\fR. Une autre différence est que SunOS/Solaris utilise par défaut le mode de conversion \fIiso\fR tandis que cette version utilise par défaut le mode de conversion \fIascii\fR. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-\fR" 4 .IX Item "--" Traites toutes les options à sa suite comme étant des noms de fichiers. Utilisez cette option si vous voulez convertir des fichiers dont le nom commence par un tiret. Par exemple, pour convertir un fichier nommé « \-foo », vous pouvez utiliser cette commande: .Sp .Vb 1 \& dos2unix \-\- \-foo .Ve .Sp Ou dans le style des nouveaux fichiers: .Sp .Vb 1 \& dos2unix \-n \-\- \-foo sortie.txt .Ve .IP "\fB\-ascii\fR" 4 .IX Item "-ascii" Convertit uniquement les sauts de lignes. C'est le mode de conversion par défaut. .IP "\fB\-iso\fR" 4 .IX Item "-iso" Convertit le jeu de caractères du \s-1DOS\s0 vers \s-1ISO\-8859\-1.\s0 Voyez aussi la section des \s-1MODES DE CONVERSION.\s0 .IP "\fB\-1252\fR" 4 .IX Item "-1252" Utilise le code page 1252 de Windows (Europe de l'ouest). .IP "\fB\-437\fR" 4 .IX Item "-437" Utilise le code page 437 du \s-1DOS \s0(\s-1US\s0). C'est le code page par défaut pour les conversions \s-1ISO.\s0 .IP "\fB\-850\fR" 4 .IX Item "-850" Utilise le code page 850 du \s-1DOS \s0(Europe de l'ouest). .IP "\fB\-860\fR" 4 .IX Item "-860" Utilise le code page 860 du \s-1DOS \s0(portugais). .IP "\fB\-863\fR" 4 .IX Item "-863" Utilise le code page 863 du \s-1DOS \s0(français canadien). .IP "\fB\-865\fR" 4 .IX Item "-865" Utilise le code page 865 du \s-1DOS \s0(nordique). .IP "\fB\-7\fR" 4 .IX Item "-7" Convertit les caractères 8 bits vers l'espace 7 bits. .IP "\fB\-b, \-\-keep\-bom\fR" 4 .IX Item "-b, --keep-bom" Conserve la marque d'ordre des octets (\s-1BOM\s0). Si le fichier d'entrée a une \&\s-1BOM,\s0 elle est écrite dans le fichier de sortie. C'est le comportement par défaut quand les sauts de lignes sont convertis au format \s-1DOS.\s0 Consultez aussi l'option \f(CW\*(C`\-r\*(C'\fR. .IP "\fB\-c, \-\-convmode \s-1MODE_CONV\s0\fR" 4 .IX Item "-c, --convmode MODE_CONV" Change le mode de conversion. \s-1MODE_CONV\s0 prend l'une des valeurs: \fIascii\fR, \&\fI7bit\fR, \fIiso\fR, \fImac\fR. Ascii est la valeur par défaut. .IP "\fB\-D, \-\-display\-enc \s-1ENCODAGE\s0\fR" 4 .IX Item "-D, --display-enc ENCODAGE" Choisi l'encodage des textes affichés. L'\s-1ENCODAGE\s0 peut être : \fIansi\fR, \&\fIunicode\fR, \fIunicodebom\fR, \fIutf8\fR, \fIutf8bom\fR. La valeur par défaut est ansi. .Sp Cette option est uniquement disponible dans dos2unix pour Windows avec support pour les noms de fichiers Unicode. Cette option n'a aucun effet sur les noms de fichiers lus et écrits. Son effet se limite à leur affichage. .Sp Il existe plusieurs méthodes pour afficher du texte dans une console Windows selon l'encodage du texte. Elles ont toutes leurs propres avantages et désavantages. .RS 4 .IP "\fBansi\fR" 4 .IX Item "ansi" La méthode par défaut de dos2unix est d'utiliser du texte encodé en \&\s-1ANSI.\s0 Elle a l'avantage d'être rétro compatible. Elle fonctionne avec des polices raster ou TrueType. Dans certaines régions, vous pouvez avoir besoin d'utiliser la commande \f(CW\*(C`chcp\*(C'\fR pour remplacer le code page \s-1DOS OEM\s0 actif par le code \s-1ANSI\s0 système de Windows car dos2unix utilise le code page système de Windows. .Sp Le désavantage de ansi est que les noms de fichiers internationaux avec des caractères en dehors du code page système par défaut ne sont pas affichés correctement. Vous verrez un point d'interrogation ou un mauvais symbole à leur place. Cette méthode est acceptable si vous ne travaillez pas avec des noms de fichiers étrangers. .IP "\fBunicode, unicodebom\fR" 4 .IX Item "unicode, unicodebom" L'avantage de l'encodage unicode (le nom de Windows pour \s-1UTF\-16\s0) est que le texte est habituellement affiché correctement. Il n'est pas nécessaire de changer le code page actif. Vous pouvez avoir besoin de remplacer la police de la console par une police TrueType pour afficher les caractères internationaux correctement. Lorsqu'un caractère n'est pas inclus dans la police TrueType, il sera généralement remplacé par un petit carré, parfois avec un point d'interrogation à l'intérieur. .Sp Lorsque vous utilisez la console ConEmu, les textes sont affichés correctement car ConEmu sélectionne automatiquement une bonne police. .Sp Le désavantage de unicode est qu'il n'est pas compatible avec \s-1ASCII.\s0 La sortie n'est pas facile à gérer quand vous la redirigez vers un autre programme. .Sp Quand la méthode \f(CW\*(C`unicodebom\*(C'\fR est utilisée, le texte Unicode est précédé d'une \s-1BOM \s0(Byte Order Mark=marque d'ordre des octets). Une \s-1BOM\s0 est nécessaire pour la redirection correcte ou le pipelining dans PowerShell. .IP "\fButf8, utf8bom\fR" 4 .IX Item "utf8, utf8bom" L'avantage de utf8 est qu'il est compatible avec \s-1ASCII.\s0 Vous devez utiliser une police TrueType dans la console. Avec une police TrueType, le texte est affiché comme avec un encodage \f(CW\*(C`unicode\*(C'\fR. .Sp Le désavantage est que, si vous utilisez la police raster par défaut, tous les caractères non \s-1ASCII\s0 sont mal affichés. Pas uniquement les noms de fichiers unicode ! Les messages traduits deviennent inintelligibles. Sous Windows configuré pour une région de l'est de l'Asie, vous pouvez observer énormément de scintillements dans la console quand des messages sont affichés. .Sp Dans une console ConEmu, l'encodage utf8 fonctionne bien. .Sp Quand la méthode \f(CW\*(C`utf8bom\*(C'\fR est utilisée, le texte \s-1UTF\-8\s0 est précédé d'une \&\s-1BOM \s0(Byte Order Mark=marque d'ordre des octets). Une \s-1BOM\s0 est nécessaire pour la redirection correcte ou le pipelining dans PowerShell. .RE .RS 4 .Sp L'encodage par défaut peut être changé en assignant la valeur \f(CW\*(C`unicode\*(C'\fR, \&\f(CW\*(C`unicodebom\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR ou \f(CW\*(C`utf8bom\*(C'\fR à la variable d'environnement \&\s-1DOS2UNIX_DISPLAY_ENC.\s0 .RE .IP "\fB\-f, \-\-force\fR" 4 .IX Item "-f, --force" Force la conversion de fichiers binaires. .IP "\fB\-gb, \-\-gb18030\fR" 4 .IX Item "-gb, --gb18030" Sous Windows, les fichiers \s-1UTF\-16\s0 sont convertis en \s-1UTF\-8\s0 par défaut sans considération pour les paramètres de la localisation. Utilisez cette option pour convertir \s-1UTF\-16\s0 en \s-1GB18030.\s0 Cette option n'est disponible que sous Windows. Consultez aussi la section \s-1GB18030.\s0 .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Affiche l'aide et s'arrête. .IP "\fB\-i[\s-1FANIONS\s0], \-\-info[=FANIONS] \s-1FICHIER\s0 …\fR" 4 .IX Item "-i[FANIONS], --info[=FANIONS] FICHIER …" Affiche les informations du fichier. Aucune conversion n'est réalisée. .Sp Les informations suivantes sont affichées dans cet ordre: le nombre de sauts de ligne \s-1DOS,\s0 le nombre de sauts de ligne Unix, le nombre de sauts de ligne Mac, la marque d'ordre des octets, texte ou binaire, nom du fichier. .Sp Exemple de sortie : .Sp .Vb 8 \& 6 0 0 no_bom text dos.txt \& 0 6 0 no_bom text unix.txt \& 0 0 6 no_bom text mac.txt \& 6 6 6 no_bom text mixed.txt \& 50 0 0 UTF\-16LE text utf16le.txt \& 0 50 0 no_bom text utf8unix.txt \& 50 0 0 UTF\-8 text utf8dos.txt \& 2 418 219 no_bom binary dos2unix.exe .Ve .Sp Notez qu'un fichier binaire peut parfois être considéré à tord comme un fichier texte. Voyez aussi l'option \f(CW\*(C`\-s\*(C'\fR. .Sp Des fanions facultatifs peuvent être ajoutés pour changer la sortie. Un ou plusieurs fanions peuvent être ajoutés. .RS 4 .IP "\fBd\fR" 4 .IX Item "d" Affiche le nombre de sauts de ligne \s-1DOS.\s0 .IP "\fBu\fR" 4 .IX Item "u" Affiche le nombre de sauts de ligne Unix. .IP "\fBm\fR" 4 .IX Item "m" Affiche le nombre de sauts de ligne Mac. .IP "\fBb\fR" 4 .IX Item "b" Afficher la marque d'ordre des octets. .IP "\fBt\fR" 4 .IX Item "t" Affiche si le fichier est texte ou binaire. .IP "\fBc\fR" 4 .IX Item "c" Affiche uniquement les fichiers qui seraient convertis. .Sp Avec le fanion \f(CW\*(C`c\*(C'\fR, dos2unix n'affichera que les fichiers contenant des sauts de ligne \s-1DOS\s0 alors que unix2dos n'affichera que les noms des fichiers aillant des sauts de ligne Unix. .IP "\fBh\fR" 4 .IX Item "h" Afficher un en\-tête. .IP "\fBp\fR" 4 .IX Item "p" Montrer les noms des fichiers sans le chemin. .RE .RS 4 .Sp Exemples: .Sp Afficher les informations pour tous les fichier *.txt : .Sp .Vb 1 \& dos2unix \-i *.txt .Ve .Sp Afficher uniquement le nombre de sauts de ligne \s-1DOS\s0 et Unix : .Sp .Vb 1 \& dos2unix \-idu *.txt .Ve .Sp Montrer uniquement la marque d'ordre des octets : .Sp .Vb 1 \& dos2unix \-\-info=b *.txt .Ve .Sp Liste les fichiers qui ont des sauts de ligne \s-1DOS :\s0 .Sp .Vb 1 \& dos2unix \-ic *.txt .Ve .Sp Liste les fichiers qui ont des sauts de ligne Unix : .Sp .Vb 1 \& unix2dos \-ic *.txt .Ve .Sp Ne converti que les fichiers qui ont des sauts de lignes \s-1DOS\s0 et laisse les autres fichiers inchangés: .Sp .Vb 1 \& dos2unix \-ic *.txt | xargs dos2unix .Ve .Sp Trouve les fichiers texte qui ont des sauts de ligne \s-1DOS :\s0 .Sp .Vb 1 \& find \-name \*(Aq*.txt\*(Aq | xargs dos2unix \-ic .Ve .RE .IP "\fB\-k, \-\-keepdate\fR" 4 .IX Item "-k, --keepdate" La date du fichier de sortie est la même que celle du fichier d'entrée. .IP "\fB\-L, \-\-license\fR" 4 .IX Item "-L, --license" Affiche la licence du programme. .IP "\fB\-l, \-\-newline\fR" 4 .IX Item "-l, --newline" Ajoute des sauts de lignes additionnels. .Sp \&\fBdos2unix\fR: Seuls les sauts de lignes du \s-1DOS\s0 sont changés en deux sauts de lignes de Unix. En mode Mac, seuls les sauts de lignes Mac sont changés en deux sauts de lignes Unix. .Sp \&\fBunix2dos\fR: Seuls les sauts de lignes Unix sont changés en deux sauts de lignes du \s-1DOS.\s0 En mode Mac, les sauts de lignes Unix sont remplacés par deux sauts de lignes Mac. .IP "\fB\-m, \-\-add\-bom\fR" 4 .IX Item "-m, --add-bom" Écrit une marque d'ordre des octets (\s-1BOM\s0) dans le fichier de sortie. Par défaut une \s-1BOM UTF\-8\s0 est écrite. .Sp Lorsque le fichier d'entrée est en \s-1UTF\-16\s0 et que l'option \f(CW\*(C`\-u\*(C'\fR est utilisée, une \s-1BOM UTF\-16\s0 est écrite. .Sp N'utilisez jamais cette option quand l'encodage du fichier de sortie n'est ni \s-1UTF\-8\s0 ni \s-1UTF\-16\s0 ni \s-1GB18030.\s0 Consultez également la section \s-1UNICODE.\s0 .IP "\fB\-n, \-\-newfile FICHIER_ENTRÉE \s-1FICHIER_SORTIE\s0 …\fR" 4 .IX Item "-n, --newfile FICHIER_ENTRÉE FICHIER_SORTIE …" Nouveau mode de fichiers. Convertit le fichier FICHER_ENTRÉE et écrit la sortie dans le fichier \s-1FICHIER_SORTIE.\s0 Les noms des fichiers doivent être indiqués par paires. Les jokers \fIne\fR doivent \fIpas\fR être utilisés ou vous \&\fIperdrez\fR vos fichiers. .Sp La personne qui démarre la conversion dans le nouveau mode (pairé) des fichiers sera le propriétaire du fichier converti. Les permissions de lecture/écriture du nouveau fichier seront les permissions du fichier original moins le \fIumask\fR\|(1) de la personne qui exécute la conversion. .IP "\fB\-o, \-\-oldfile \s-1FICHIER\s0 …\fR" 4 .IX Item "-o, --oldfile FICHIER …" Ancien mode de fichiers. Convertit le fichier \s-1FICHIER\s0 et écrit la sortie dedans. Le programme fonctionne dans ce mode par défaut. Les jokers peuvent être utilisés. .Sp Dans l'ancien mode (en place) des fichiers, les fichiers convertis ont le même propriétaire, groupe et permissions lecture/écriture que le fichier original. Idem quand le fichier est converti par un utilisateur qui a la permission d'écrire dans le fichier (par exemple, root). La conversion est interrompue si il n'est pas possible de conserver les valeurs d'origine. Le changement de propriétaire pourrait signifier que le propriétaire original n'est plus en mesure de lire le fichier. Le changement de groupe pourrait être un risque pour la sécurité. Le fichier pourrait être rendu accessible en lecture par des personnes à qui il n'est pas destiné. La conservation du propriétaire, du groupe et des permissions de lecture/écriture n'est supportée que sous Unix. .IP "\fB\-q, \-\-quiet\fR" 4 .IX Item "-q, --quiet" Mode silencieux. Supprime les avertissements et les messages. La valeur de sortie est zéro sauf quand de mauvaises options sont utilisées sur la ligne de commande. .IP "\fB\-r, \-\-remove\-bom\fR" 4 .IX Item "-r, --remove-bom" Supprime la marque d'ordre des octets (\s-1BOM\s0). N'écrit pas la \s-1BOM\s0 dans le fichier de sortie. Ceci est le comportement par défaut lorsque les sauts de lignes sont convertis au format Unix. Consultez aussi l'option \f(CW\*(C`\-b\*(C'\fR. .IP "\fB\-s, \-\-safe\fR" 4 .IX Item "-s, --safe" Ignore les fichiers binaires (par défaut). .Sp Ignorer les fichiers binaires sert à éviter les erreurs accidentelles. Attention que la détection de fichiers binaires n'est pas fiable à 100%. Les fichiers en entrée sont analysés pour y trouver des symboles binaires qui ne sont habituellement pas rencontrés dans des fichiers textes. Il est cependant possible qu'un fichier binaire ne contienne que des caractères textes normaux. Un tel fichier serait erronément traité comme un fichier texte. .IP "\fB\-u, \-\-keep\-utf16\fR" 4 .IX Item "-u, --keep-utf16" Conserve l'encodage \s-1UTF\-16\s0 original du fichier d'entrée. Le fichier de sortie sera écrit dans le même encodage \s-1UTF\-16 \s0(petit ou grand boutien) que le fichier d'entrée. Ceci évite la transformation en \s-1UTF\-8.\s0 Une \s-1BOM UTF\-16\s0 sera écrite en conséquent. Cette option peut être désactivée avec l'option \&\f(CW\*(C`\-ascii\*(C'\fR. .IP "\fB\-ul, \-\-assume\-utf16le\fR" 4 .IX Item "-ul, --assume-utf16le" Suppose que le fichier d'entrée est au format \s-1UTF\-16LE.\s0 .Sp Quand il y a un indicateur d'ordre des octets dans le fichier d'entrée, l'indicateur a priorité sur cette option. .Sp Si vous vous êtes trompé sur le format du fichier d'entrée (par exemple, ce n'était pas un fichier \s-1UTF16\-LE\s0) et que la conversion réussi, vous obtiendrez un fichier \s-1UTF\-8\s0 contenant le mauvais texte. Vous pouvez récupérer le fichier original avec \fIiconv\fR\|(1) en convertissant le fichier de sortie \s-1UTF\-8\s0 vers du \s-1UTF\-16LE.\s0 .Sp La présupposition de l'\s-1UTF\-16LE\s0 fonctionne comme un \fImode de conversion\fR. En utilisant le mode \fIascii\fR par défaut, \s-1UTF\-16LE\s0 n'est plus présupposé. .IP "\fB\-ub, \-\-assume\-utf16be\fR" 4 .IX Item "-ub, --assume-utf16be" Suppose que le fichier d'entrée est au format \s-1UTF\-16BE.\s0 .Sp Cette option fonctionne comme l'option \f(CW\*(C`\-ul\*(C'\fR. .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Affiche des messages verbeux. Des informations supplémentaires sont affichées à propos des marques d'ordre des octets et du nombre de sauts de lignes convertis. .IP "\fB\-F, \-\-follow\-symlink\fR" 4 .IX Item "-F, --follow-symlink" Suit les liens symboliques et convertit les cibles. .IP "\fB\-R, \-\-replace\-symlink\fR" 4 .IX Item "-R, --replace-symlink" Remplace les liens symboliques par les fichiers convertis (les fichiers cibles originaux restent inchangés). .IP "\fB\-S, \-\-skip\-symlink\fR" 4 .IX Item "-S, --skip-symlink" Ne change pas les liens symboliques ni les cibles (par défaut). .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" Affiche les informations de version puis arrête. .SH "MODE MAC" .IX Header "MODE MAC" En mode normal, les sauts de lignes sont convertis du \s-1DOS\s0 vers Unix et inversement. Les sauts de lignes Mac ne sont pas convertis. .PP En mode Mac, les sauts de lignes sont convertis du format Mac au format Unix et inversement. Les sauts de lignes \s-1DOS\s0 ne sont pas changés. .PP Pour fonctionner en mode Mac, utilisez l'option en ligne de commande \f(CW\*(C`\-c mac\*(C'\fR ou utilisez les commandes \f(CW\*(C`mac2unix\*(C'\fR ou \f(CW\*(C`unix2mac\*(C'\fR. .SH "MODES DE CONVERSION" .IX Header "MODES DE CONVERSION" .IP "\fBascii\fR" 4 .IX Item "ascii" En mode \f(CW\*(C`ascii\*(C'\fR, seuls les sauts de lignes sont convertis. Ceci est le mode de conversion par défaut. .Sp Bien que le nom de ce mode soit \s-1ASCII,\s0 qui est un standard 7 bits, ce mode travail en réalité sur 8 bits. Utilisez toujours ce mode lorsque vous convertissez des fichiers Unicode \s-1UTF\-8.\s0 .IP "\fB7bit\fR" 4 .IX Item "7bit" Dans ce mode, tous les caractères 8 bits non \s-1ASCII \s0(avec des valeurs entre 128 et 255) sont remplacés par une espace 7 bits. .IP "\fBiso\fR" 4 .IX Item "iso" Les caractères sont convertis entre un jeu de caractères \s-1DOS \s0(code page) et le jeu de caractères \s-1ISO\-8859\-1 \s0(Latin\-1) de Unix. Les caractères \s-1DOS\s0 sans équivalent \s-1ISO\-8859\-1,\s0 pour lesquels la conversion n'est pas possible, sont remplacés par un point. La même chose est valable pour les caractères \&\s-1ISO\-8859\-1\s0 sans équivalent \s-1DOS.\s0 .Sp Quand seule l'option \f(CW\*(C`\-iso\*(C'\fR est utilisée, dos2unix essaie de déterminer le code page actif. Quand ce n'est pas possible, dos2unix utilise le code page \&\s-1CP437\s0 par défaut qui est surtout utilisé aux \s-1USA.\s0 Pour forcer l'utilisation d'un code page spécifique, utilisez les options \f(CW\*(C`\-437\*(C'\fR (\s-1US\s0), \f(CW\*(C`\-850\*(C'\fR (Europe de l'ouest), \f(CW\*(C`\-860\*(C'\fR (portugais), \f(CW\*(C`\-863\*(C'\fR (français canadien) ou \&\f(CW\*(C`\-865\*(C'\fR (nordique). Le code page \s-1CP1252\s0 de Windows (Europe de l'ouest) est également supporté avec l'option \f(CW\*(C`\-1252\*(C'\fR. Pour d'autres codes pages, utilisez dos2unix avec \fIiconv\fR\|(1). Iconv supporte une longue liste de codages de caractères. .Sp N'utilisez jamais la conversion \s-1ISO\s0 sur des fichiers textes Unicode. Cela va corrompre les fichiers encodés en \s-1UTF\-8.\s0 .Sp Quelques exemples: .Sp Convertir du code page par défaut du \s-1DOS\s0 au Latin\-1 Unix : .Sp .Vb 1 \& dos2unix \-iso \-n entrée.txt sortie.txt .Ve .Sp Convertir du \s-1CP850\s0 du \s-1DOS\s0 au Latin\-1 Unix : .Sp .Vb 1 \& dos2unix \-850 \-n entrée.txt sortie.txt .Ve .Sp Convertir du \s-1CP1252\s0 de Windows au Latin\-1 de Unix : .Sp .Vb 1 \& dos2unix \-1252 \-n entrée.txt sortie.txt .Ve .Sp Convertir le \s-1CP1252\s0 de Windows en \s-1UTF\-8\s0 de Unix (Unicode) : .Sp .Vb 1 \& iconv \-f CP1252 \-t UTF\-8 entrée.txt | dos2unix > sortie.txt .Ve .Sp Convertir du Latin\-1 de Unix au code page par défaut de \s-1DOS :\s0 .Sp .Vb 1 \& unix2dos \-iso \-n entrée.txt sortie.txt .Ve .Sp Convertir le Latin\-1 de Unix en \s-1CP850\s0 du \s-1DOS :\s0 .Sp .Vb 1 \& unix2dos \-850 \-n entrée.txt sortie.txt .Ve .Sp Convertir le Latin\-1 de Unix en \s-1CP1252\s0 de Windows : .Sp .Vb 1 \& unix2dos \-1252 \-n entrée.txt sortie.txt .Ve .Sp Convertir le \s-1UTF\-8\s0 de Unix (Unicode) en \s-1CP1252\s0 de Windows : .Sp .Vb 1 \& unix2dos < entrée.txt | iconv \-f UTF\-8 \-t CP1252 > sortie.txt .Ve .Sp Consultez aussi et . .SH "UNICODE" .IX Header "UNICODE" .SS "Codages" .IX Subsection "Codages" Il existe plusieurs codages Unicode. Sous Unix et Linux, les fichiers sont généralement codés en \s-1UTF\-8.\s0 Sous Windows, les fichiers textes Unicode peuvent être codés en \s-1UTF\-8, UTF\-16\s0 ou \s-1UTF\-16\s0 gros boutien mais ils sont majoritairement codés au format \s-1UTF\-16.\s0 .SS "Conversion" .IX Subsection "Conversion" Les fichiers textes Unicode peuvent avoir des sauts de lignes \s-1DOS,\s0 Unix ou Mac, tout comme les fichiers textes normaux. .PP Toutes les versions de dos2unix et unix2dos peuvent convertir des fichiers codés en \s-1UTF\-8\s0 car \s-1UTF\-8\s0 a été conçu pour être rétro\-compatible avec l'\s-1ASCII.\s0 .PP Dos2unix et unix2dos, avec le support pour l'Unicode \s-1UTF\-16,\s0 peuvent lire les fichiers textes codés sous forme petit boutien ou gros boutien. Pour savoir si dos2unix a été compilé avec le support \s-1UTF\-16\s0 tapez \f(CW\*(C`dos2unix \&\-V\*(C'\fR. .PP Sous Unix/Linux, les fichiers encodés en \s-1UTF\-16\s0 sont convertis vers l'encodage des caractères de la localisation. Utilisez \fIlocale\fR\|(1) pour découvrir quel encodage de caractères est utilisé. Lorsque la conversion n'est pas possible, une erreur de conversion est produite et le fichier est abandonné. .PP Sous Windows, les fichiers \s-1UTF\-16\s0 sont convertis par défaut en \s-1UTF\-8.\s0 Les fichiers textes formatés en \s-1UTF\-8\s0 sont bien supportés sous Windows et Unix/Linux. .PP Les codages \s-1UTF\-16\s0 et \s-1UTF\-8\s0 sont parfaitement compatibles. Il n'y a pas de pertes lors de la conversion. Lorsqu'une erreur de conversion \s-1UTF\-16\s0 vers \&\s-1UTF\-8\s0 survient, par exemple, quand le fichier d'entrée \s-1UTF\-16\s0 contient une erreur, le fichier est ignoré. .PP Quand l'option \f(CW\*(C`\-u\*(C'\fR est utilisée, le fichier de sortie est écrit dans le même encodage \s-1UTF\-16\s0 que le fichier d'entrée. L'option \f(CW\*(C`\-u\*(C'\fR empêche la conversion en \s-1UTF\-8.\s0 .PP Dos2unix et unix2dos n'ont pas d'option pour convertir des fichiers \s-1UTF\-8\s0 en \&\s-1UTF\-16.\s0 .PP Les modes de conversion \s-1ISO\s0 et 7 bits ne fonctionnent pas sur des fichiers \&\s-1UTF\-16.\s0 .SS "Marque d'ordre des octets" .IX Subsection "Marque d'ordre des octets" Les fichiers textes Unicode sous Windows on généralement un indicateur d'ordre des octets (\s-1BOM\s0) car de nombreux programmes Windows (y compris Notepad) ajoutent cet indicateur par défaut. Consultez aussi . .PP Sous Unix, les fichiers Unicodes n'ont habituellement pas de \s-1BOM.\s0 Il est supposé que les fichiers textes sont codés selon le codage de l'environnement linguistique. .PP Dos2unix ne peut détecter que le fichier est au format \s-1UTF\-16\s0 si le fichier n'a pas de \s-1BOM.\s0 Quand le fichier \s-1UTF\-16\s0 n'a pas cet indicateur, dos2unix voit le fichier comme un fichier binaire. .PP Utilisez l'option \f(CW\*(C`\-ul\*(C'\fR ou \f(CW\*(C`\-ub\*(C'\fR pour convertir un fichier \s-1UTF\-16\s0 sans \&\s-1BOM.\s0 .PP Dos2unix, par défaut, n'écrit pas de \s-1BOM\s0 dans le fichier de sortie. Avec l'option \f(CW\*(C`\-b\*(C'\fR, Dos2unix écrit une \s-1BOM\s0 quand le fichier d'entrée a une \s-1BOM.\s0 .PP Unix2dos écrit par défaut une \s-1BOM\s0 dans le fichier de sortie quand le fichier d'entrée a une \s-1BOM.\s0 Utilisez l'option \f(CW\*(C`\-r\*(C'\fR pour supprimer la \s-1BOM.\s0 .PP Dos2unix et unix2dos écrivent toujours une \s-1BOM\s0 quand l'option \f(CW\*(C`\-m\*(C'\fR est utilisée. .SS "Noms de fichiers unicode sous Windows" .IX Subsection "Noms de fichiers unicode sous Windows" Dos2unix supporte, en option, la lecture et l'écriture de noms de fichiers Unicode dans la ligne de commande de Windows. Cela signifie que dos2unix peut ouvrir des fichiers qui ont, dans leur nom, des caractères n'appartenant pas au code page système \s-1ANSI\s0 par défaut. Pour voir si dos2unix pour Windows a été compilé avec le support des noms de fichiers Unicode, tapez \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP Il y a quelques soucis avec l'affichage de noms de fichiers Unicode dans une console Windows. Voyez l'option \f(CW\*(C`\-D\*(C'\fR, \f(CW\*(C`\-\-display\-enc\*(C'\fR. Les noms de fichiers peuvent être mal affichés dans la console mais les fichiers seront écrits avec les bons noms. .SS "Exemples Unicode" .IX Subsection "Exemples Unicode" Convertir de l'\s-1UTF\-16\s0 Windows (avec \s-1BOM\s0) vers l'\s-1UTF\-8\s0 de Unix : .PP .Vb 1 \& dos2unix \-n entrée.txt sortie.txt .Ve .PP Convertir de l'\s-1UTF\-16LE\s0 de Windows (sans \s-1BOM\s0) vers l'\s-1UTF\-8\s0 de Unix : .PP .Vb 1 \& dos2unix \-ul \-n entrée.txt sortie.txt .Ve .PP Convertir de l'\s-1UTF\-8\s0 de Unix vers l'\s-1UTF\-8\s0 de Windows avec \s-1BOM :\s0 .PP .Vb 1 \& unix2dos \-m \-n entrée.txt sortie.txt .Ve .PP Convertir de l'\s-1UTF\-8\s0 de Unix vers l'\s-1UTF\-16\s0 de Windows : .PP .Vb 1 \& unix2dos < entrée.txt | iconv \-f UTF\-8 \-t UTF\-16 > sortie.txt .Ve .SH "GB18030" .IX Header "GB18030" \&\s-1GB18030\s0 est un standard du gouvernement chinois. Tout logiciel vendu en Chine doit officiellement supporter un sous ensemble obligatoire du standard \&\s-1GB18030.\s0 Consultez . .PP \&\s-1GB18030\s0 est entièrement compatible avec Unicode et peut être considéré comme étant un format de transformation unicode. Comme \s-1UTF\-8, GB18030\s0 est compatible avec \s-1ASCII. GB18030\s0 est aussi compatible avec le code page 936 de Windows aussi connu comme \s-1GBK.\s0 .PP Sous Unix/Linux, les fichiers \s-1UTF\-16\s0 sont convertis en \s-1GB18030\s0 quand l'encodage de l'environnement linguistique est \s-1GB18030.\s0 Notez que cela ne fonctionnera que si l'environnement linguistique est supporté par le système. Utilisez la commande \f(CW\*(C`locale \-a\*(C'\fR pour obtenir la liste des environnements linguistiques supportés. .PP Sous Windows, vous avez besoin de l'option \f(CW\*(C`\-gb\*(C'\fR pour convertir \s-1UTF\-16\s0 en \&\s-1GB18030.\s0 .PP Les fichiers encodés en \s-1GB18030\s0 peuvent avoir une marque d'ordre des octets, comme les fichiers Unicode. .SH "EXEMPLES" .IX Header "EXEMPLES" Lire l'entrée depuis « stdin » et écrire la sortie vers « stdout » : .PP .Vb 2 \& dos2unix < a.txt \& cat a.txt | dos2unix .Ve .PP Convertir et remplacer a.txt. Convertir et remplace b.txt : .PP .Vb 2 \& dos2unix a.txt b.txt \& dos2unix \-o a.txt b.txt .Ve .PP Convertir et remplacer a.txt en mode de conversion ascii : .PP .Vb 1 \& dos2unix a.txt .Ve .PP Convertir et remplacer a.txt en mode de conversion ascii. Convertir et remplacer b.txt en mode de conversion 7 bits : .PP .Vb 3 \& dos2unix a.txt \-c 7bit b.txt \& dos2unix \-c ascii a.txt \-c 7bit b.txt \& dos2unix \-ascii a.txt \-7 b.txt .Ve .PP Convertir a.txt depuis le format Mac vers le format Unix : .PP .Vb 2 \& dos2unix \-c mac a.txt \& mac2unix a.txt .Ve .PP Convertir a.txt du format Unix au format Mac : .PP .Vb 2 \& unix2dos \-c mac a.txt \& unix2mac a.txt .Ve .PP Convertir et remplacer a.txt tout en conservant la date originale : .PP .Vb 2 \& dos2unix \-k a.txt \& dos2unix \-k \-o a.txt .Ve .PP Convertir a.txt et écrire dans e.txt : .PP .Vb 1 \& dos2unix \-n a.txt e.txt .Ve .PP Convertir a.txt et écrire dans e.txt. La date de e.txt est la même que celle de a.txt : .PP .Vb 1 \& dos2unix \-k \-n a.txt e.txt .Ve .PP Convertir et remplacer a.txt. Convertir b.txt et écrire dans e.txt : .PP .Vb 2 \& dos2unix a.txt \-n b.txt e.txt \& dos2unix \-o a.txt \-n b.txt e.txt .Ve .PP Convertir c.txt et écrire dans e.txt. Convertir et remplacer a.txt. Convertir et remplacer b.txt. Convertir d.txt et écrire dans f.txt : .PP .Vb 1 \& dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt .Ve .SH "CONVERSIONS RÉCURSIVES" .IX Header "CONVERSIONS RÉCURSIVES" Utilisez dos2unix avec les commandes \fIfind\fR\|(1) et \fIxargs\fR\|(1) pour convertir récursivement des fichiers textes dans une arborescence de répertoires. Par exemple, pour convertir tous les fichiers .txt dans les répertoires sous le répertoire courant, tapez: .PP .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .PP En ligne de commande sous Windows, la commande suivante peut être utilisée : .PP .Vb 2 \& for /R %G in (*.txt) do dos2unix "%G" \& find /R %G in .Ve .PP Les utilisateurs de PowerShell peuvent utiliser la commande suivante dans le PowerShell de Windows : .PP .Vb 1 \& get\-childitem \-path . \-filter \*(Aq*.txt\*(Aq \-recurse | foreach\-object {dos2unix $_.Fullname} .Ve .SH "PARAMÈTRES LINGUISTIQUES" .IX Header "PARAMÈTRES LINGUISTIQUES" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" La langue principale est sélectionnée par la variable d'environnement \&\s-1LANG.\s0 La variable \s-1LANG\s0 est composée de plusieurs parties. La première partie est le code de la langue en minuscules. La deuxième partie est le code du pays en majuscules précédé d'un souligné. Elle est facultative. Il y a aussi une troisième partie facultative qui est le codage des caractères précédé par un point. Voici quelques exemples pour un shell au standard \s-1POSIX:\s0 .Sp .Vb 7 \& export LANG=fr Français \& export LANG=fr_CA Français, Canada \& export LANG=fr_BE Français, Belgique \& export LANG=es_ES Espagnol, Espagne \& export LANG=es_MX Espagnol, Mexique \& export LANG=en_US.iso88591 Anglais, USA, codage Latin\-1 \& export LANG=en_GB.UTF\-8 Anglais, UK, codage UTF\-8 .Ve .Sp La liste complète des codes de langues et de pays est dans le manuel de gettext: .Sp Sur les systèmes Unix, vous pouvez utiliser la commande \fIlocale\fR\|(1) pour obtenir des informations sur l'environnement linguistique. .IP "\fB\s-1LANGUE\s0\fR" 4 .IX Item "LANGUE" Avec la variable d'environnement \s-1LANGUAGE,\s0 vous pouvez spécifier une liste de langues prioritaires séparées par des deux-points. Dos2unix fait passer \&\s-1LANGUAGE\s0 avant \s-1LANG.\s0 Par exemple, pour utiliser le français avant l'anglais: \&\f(CW\*(C`LANGUAGE=fr:en\*(C'\fR. Vous devez d'abord activer l'environnement linguistique en assignant une valeur autre que « C » à \s-1LANG \s0(ou \s-1LC_ALL\s0). Ensuite, vous pourrez utiliser la liste de priorité avec la variable \s-1LANGUAGE.\s0 Voyez également le manuel de gettext: .Sp Si vous sélectionnez une langue qui n'est pas disponible, vous obtiendrez des messages en anglais standard. .IP "\fB\s-1DOS2UNIX_LOCALEDIR\s0\fR" 4 .IX Item "DOS2UNIX_LOCALEDIR" Grâce à la variable d'environnement \s-1DOS2UNIX_LOCALEDIR,\s0 la variable \&\s-1LOCALEDIR\s0 compilée dans l'application peut être remplacée. \s-1LOCALEDIR\s0 est utilisée pour trouver les fichiers de langue. La valeur par défaut de \s-1GNU\s0 est \f(CW\*(C`/usr/local/share/locale\*(C'\fR. L'option \fB\-\-version\fR affiche la valeur de \&\s-1LOCALEDIR\s0 utilisée. .Sp Exemple (shell \s-1POSIX\s0): .Sp .Vb 1 \& export DOS2UNIX_LOCALEDIR=$HOME/share/locale .Ve .SH "VALEUR DE RETOUR" .IX Header "VALEUR DE RETOUR" Zéro est retourné en cas de succès. Si une erreur système se produit, la dernière erreur système est retournée. Pour les autres erreurs, 1 est renvoyé. .PP La valeur de sortie est toujours zéro en mode silencieux sauf quand de mauvaises options sont utilisées sur la ligne de commande. .SH "STANDARDS" .IX Header "STANDARDS" .PP .PP .PP .SH "AUTEURS" .IX Header "AUTEURS" Benjamin Lin \- , Bernd Johannes Wuebben (mode mac2unix) \- , Christian Wurll (ajout de saut de ligne supplémentaire) \- , Erwin Waterlander \- (Mainteneur) .PP Page du projet: .PP Page SourceForge: .SH "VOIR AUSSI" .IX Header "VOIR AUSSI" \&\fIfile\fR\|(1) \fIfind\fR\|(1) \fIiconv\fR\|(1) \fIlocale\fR\|(1) \fIxargs\fR\|(1) dos2unix-7.3.4/man/fr/man1/dos2unix.htm0000644000175500010010000011444412721132574017066 0ustar waterlanGeen dos2unix 7.3.4 - Convertit les fichiers textes du format DOS/Mac vers Unix et inversement

NOM

dos2unix - Convertit les fichiers textes du format DOS/Mac vers Unix et inversement

SYNOPSIS

    dos2unix [options] [FICHIER …] [-n FICHIER_ENTRÉE FICHIER_SORTIE …]
    unix2dos [options] [FICHIER …] [-n FICHIER_ENTRÉE FICHIER_SORTIE …]

DESCRIPTION

Le package Dos2unix inclut les utilitaires dos2unix et unix2dos pour convertir des fichiers textes au format DOS ou Mac vers le format Unix et inversement.

Dans les fichiers textes DOS/Windows, un saut de ligne est une combinaison de deux caractères: un retour de chariot (CR) suivi d'un saut de ligne (LF). Dans les fichiers textes Unix, le saut de ligne est un seul caractère: le saut de ligne (LF). Les fichiers textes Mac, avant Mac OS X, utilisaient le retour chariot (CR) comme seul caractère. De nos jours, Mac OS utilise le même style de saut de ligne que Unix (LF).

Outre les sauts de lignes, Dos2unix convertit aussi le codage des fichiers. Quelques codes page DOS peuvent être convertis en Latin-1 sous Unix. L'Unicode des fichiers Windows (UTF-16) peut être converti en Unicode Unix (UTF-8).

Les fichiers binaires sont automatiquement ignorés à moins que la conversion soit forcée.

Les fichiers non réguliers tels que les répertoires et les FIFOs sont automatiquement ignorés.

Les liens symboliques et leur cible sont, par défaut, inchangés. En option, les liens symboliques peuvent être remplacés ou, au choix, la sortie peut être écrite dans la cible du lien symbolique. Écrire dans la cible d'un lien symbolique n'est pas supporté sous Windows.

Dos2unix a été conçu comme dos2unix sous SunOS/Solaris. Il y a une différence importante avec la version originale de SunOS/Solaris. Cette version effectue les conversions en place (ancien mode de fichier) tandis que la version originale de SunOS/Solaris ne supporte que la conversion par paire (nouveau mode de fichier). Voyez aussi les options -o et -n. Une autre différence est que SunOS/Solaris utilise par défaut le mode de conversion iso tandis que cette version utilise par défaut le mode de conversion ascii.

OPTIONS

--

Traites toutes les options à sa suite comme étant des noms de fichiers. Utilisez cette option si vous voulez convertir des fichiers dont le nom commence par un tiret. Par exemple, pour convertir un fichier nommé « -foo », vous pouvez utiliser cette commande:

    dos2unix -- -foo

Ou dans le style des nouveaux fichiers:

    dos2unix -n -- -foo sortie.txt
-ascii

Convertit uniquement les sauts de lignes. C'est le mode de conversion par défaut.

-iso

Convertit le jeu de caractères du DOS vers ISO-8859-1. Voyez aussi la section des MODES DE CONVERSION.

-1252

Utilise le code page 1252 de Windows (Europe de l'ouest).

-437

Utilise le code page 437 du DOS (US). C'est le code page par défaut pour les conversions ISO.

-850

Utilise le code page 850 du DOS (Europe de l'ouest).

-860

Utilise le code page 860 du DOS (portugais).

-863

Utilise le code page 863 du DOS (français canadien).

-865

Utilise le code page 865 du DOS (nordique).

-7

Convertit les caractères 8 bits vers l'espace 7 bits.

-b, --keep-bom

Conserve la marque d'ordre des octets (BOM). Si le fichier d'entrée a une BOM, elle est écrite dans le fichier de sortie. C'est le comportement par défaut quand les sauts de lignes sont convertis au format DOS. Consultez aussi l'option -r.

-c, --convmode MODE_CONV

Change le mode de conversion. MODE_CONV prend l'une des valeurs: ascii, 7bit, iso, mac. Ascii est la valeur par défaut.

-D, --display-enc ENCODAGE

Choisi l'encodage des textes affichés. L'ENCODAGE peut être : ansi, unicode, unicodebom, utf8, utf8bom. La valeur par défaut est ansi.

Cette option est uniquement disponible dans dos2unix pour Windows avec support pour les noms de fichiers Unicode. Cette option n'a aucun effet sur les noms de fichiers lus et écrits. Son effet se limite à leur affichage.

Il existe plusieurs méthodes pour afficher du texte dans une console Windows selon l'encodage du texte. Elles ont toutes leurs propres avantages et désavantages.

ansi

La méthode par défaut de dos2unix est d'utiliser du texte encodé en ANSI. Elle a l'avantage d'être rétro compatible. Elle fonctionne avec des polices raster ou TrueType. Dans certaines régions, vous pouvez avoir besoin d'utiliser la commande chcp pour remplacer le code page DOS OEM actif par le code ANSI système de Windows car dos2unix utilise le code page système de Windows.

Le désavantage de ansi est que les noms de fichiers internationaux avec des caractères en dehors du code page système par défaut ne sont pas affichés correctement. Vous verrez un point d'interrogation ou un mauvais symbole à leur place. Cette méthode est acceptable si vous ne travaillez pas avec des noms de fichiers étrangers.

unicode, unicodebom

L'avantage de l'encodage unicode (le nom de Windows pour UTF-16) est que le texte est habituellement affiché correctement. Il n'est pas nécessaire de changer le code page actif. Vous pouvez avoir besoin de remplacer la police de la console par une police TrueType pour afficher les caractères internationaux correctement. Lorsqu'un caractère n'est pas inclus dans la police TrueType, il sera généralement remplacé par un petit carré, parfois avec un point d'interrogation à l'intérieur.

Lorsque vous utilisez la console ConEmu, les textes sont affichés correctement car ConEmu sélectionne automatiquement une bonne police.

Le désavantage de unicode est qu'il n'est pas compatible avec ASCII. La sortie n'est pas facile à gérer quand vous la redirigez vers un autre programme.

Quand la méthode unicodebom est utilisée, le texte Unicode est précédé d'une BOM (Byte Order Mark=marque d'ordre des octets). Une BOM est nécessaire pour la redirection correcte ou le pipelining dans PowerShell.

utf8, utf8bom

L'avantage de utf8 est qu'il est compatible avec ASCII. Vous devez utiliser une police TrueType dans la console. Avec une police TrueType, le texte est affiché comme avec un encodage unicode.

Le désavantage est que, si vous utilisez la police raster par défaut, tous les caractères non ASCII sont mal affichés. Pas uniquement les noms de fichiers unicode ! Les messages traduits deviennent inintelligibles. Sous Windows configuré pour une région de l'est de l'Asie, vous pouvez observer énormément de scintillements dans la console quand des messages sont affichés.

Dans une console ConEmu, l'encodage utf8 fonctionne bien.

Quand la méthode utf8bom est utilisée, le texte UTF-8 est précédé d'une BOM (Byte Order Mark=marque d'ordre des octets). Une BOM est nécessaire pour la redirection correcte ou le pipelining dans PowerShell.

L'encodage par défaut peut être changé en assignant la valeur unicode, unicodebom, utf8 ou utf8bom à la variable d'environnement DOS2UNIX_DISPLAY_ENC.

-f, --force

Force la conversion de fichiers binaires.

-gb, --gb18030

Sous Windows, les fichiers UTF-16 sont convertis en UTF-8 par défaut sans considération pour les paramètres de la localisation. Utilisez cette option pour convertir UTF-16 en GB18030. Cette option n'est disponible que sous Windows. Consultez aussi la section GB18030.

-h, --help

Affiche l'aide et s'arrête.

-i[FANIONS], --info[=FANIONS] FICHIER …

Affiche les informations du fichier. Aucune conversion n'est réalisée.

Les informations suivantes sont affichées dans cet ordre: le nombre de sauts de ligne DOS, le nombre de sauts de ligne Unix, le nombre de sauts de ligne Mac, la marque d'ordre des octets, texte ou binaire, nom du fichier.

Exemple de sortie :

     6       0       0  no_bom    text    dos.txt
     0       6       0  no_bom    text    unix.txt
     0       0       6  no_bom    text    mac.txt
     6       6       6  no_bom    text    mixed.txt
    50       0       0  UTF-16LE  text    utf16le.txt
     0      50       0  no_bom    text    utf8unix.txt
    50       0       0  UTF-8     text    utf8dos.txt
     2     418     219  no_bom    binary  dos2unix.exe

Notez qu'un fichier binaire peut parfois être considéré à tord comme un fichier texte. Voyez aussi l'option -s.

Des fanions facultatifs peuvent être ajoutés pour changer la sortie. Un ou plusieurs fanions peuvent être ajoutés.

d

Affiche le nombre de sauts de ligne DOS.

u

Affiche le nombre de sauts de ligne Unix.

m

Affiche le nombre de sauts de ligne Mac.

b

Afficher la marque d'ordre des octets.

t

Affiche si le fichier est texte ou binaire.

c

Affiche uniquement les fichiers qui seraient convertis.

Avec le fanion c, dos2unix n'affichera que les fichiers contenant des sauts de ligne DOS alors que unix2dos n'affichera que les noms des fichiers aillant des sauts de ligne Unix.

h

Afficher un en-tête.

p

Montrer les noms des fichiers sans le chemin.

Exemples:

Afficher les informations pour tous les fichier *.txt :

    dos2unix -i *.txt

Afficher uniquement le nombre de sauts de ligne DOS et Unix :

    dos2unix -idu *.txt

Montrer uniquement la marque d'ordre des octets :

    dos2unix --info=b *.txt

Liste les fichiers qui ont des sauts de ligne DOS :

    dos2unix -ic *.txt

Liste les fichiers qui ont des sauts de ligne Unix :

    unix2dos -ic *.txt

Ne converti que les fichiers qui ont des sauts de lignes DOS et laisse les autres fichiers inchangés:

    dos2unix -ic *.txt | xargs dos2unix

Trouve les fichiers texte qui ont des sauts de ligne DOS :

    find -name '*.txt' | xargs dos2unix -ic
-k, --keepdate

La date du fichier de sortie est la même que celle du fichier d'entrée.

-L, --license

Affiche la licence du programme.

-l, --newline

Ajoute des sauts de lignes additionnels.

dos2unix: Seuls les sauts de lignes du DOS sont changés en deux sauts de lignes de Unix. En mode Mac, seuls les sauts de lignes Mac sont changés en deux sauts de lignes Unix.

unix2dos: Seuls les sauts de lignes Unix sont changés en deux sauts de lignes du DOS. En mode Mac, les sauts de lignes Unix sont remplacés par deux sauts de lignes Mac.

-m, --add-bom

Écrit une marque d'ordre des octets (BOM) dans le fichier de sortie. Par défaut une BOM UTF-8 est écrite.

Lorsque le fichier d'entrée est en UTF-16 et que l'option -u est utilisée, une BOM UTF-16 est écrite.

N'utilisez jamais cette option quand l'encodage du fichier de sortie n'est ni UTF-8 ni UTF-16 ni GB18030. Consultez également la section UNICODE.

-n, --newfile FICHIER_ENTRÉE FICHIER_SORTIE …

Nouveau mode de fichiers. Convertit le fichier FICHER_ENTRÉE et écrit la sortie dans le fichier FICHIER_SORTIE. Les noms des fichiers doivent être indiqués par paires. Les jokers ne doivent pas être utilisés ou vous perdrez vos fichiers.

La personne qui démarre la conversion dans le nouveau mode (pairé) des fichiers sera le propriétaire du fichier converti. Les permissions de lecture/écriture du nouveau fichier seront les permissions du fichier original moins le umask(1) de la personne qui exécute la conversion.

-o, --oldfile FICHIER …

Ancien mode de fichiers. Convertit le fichier FICHIER et écrit la sortie dedans. Le programme fonctionne dans ce mode par défaut. Les jokers peuvent être utilisés.

Dans l'ancien mode (en place) des fichiers, les fichiers convertis ont le même propriétaire, groupe et permissions lecture/écriture que le fichier original. Idem quand le fichier est converti par un utilisateur qui a la permission d'écrire dans le fichier (par exemple, root). La conversion est interrompue si il n'est pas possible de conserver les valeurs d'origine. Le changement de propriétaire pourrait signifier que le propriétaire original n'est plus en mesure de lire le fichier. Le changement de groupe pourrait être un risque pour la sécurité. Le fichier pourrait être rendu accessible en lecture par des personnes à qui il n'est pas destiné. La conservation du propriétaire, du groupe et des permissions de lecture/écriture n'est supportée que sous Unix.

-q, --quiet

Mode silencieux. Supprime les avertissements et les messages. La valeur de sortie est zéro sauf quand de mauvaises options sont utilisées sur la ligne de commande.

-r, --remove-bom

Supprime la marque d'ordre des octets (BOM). N'écrit pas la BOM dans le fichier de sortie. Ceci est le comportement par défaut lorsque les sauts de lignes sont convertis au format Unix. Consultez aussi l'option -b.

-s, --safe

Ignore les fichiers binaires (par défaut).

Ignorer les fichiers binaires sert à éviter les erreurs accidentelles. Attention que la détection de fichiers binaires n'est pas fiable à 100%. Les fichiers en entrée sont analysés pour y trouver des symboles binaires qui ne sont habituellement pas rencontrés dans des fichiers textes. Il est cependant possible qu'un fichier binaire ne contienne que des caractères textes normaux. Un tel fichier serait erronément traité comme un fichier texte.

-u, --keep-utf16

Conserve l'encodage UTF-16 original du fichier d'entrée. Le fichier de sortie sera écrit dans le même encodage UTF-16 (petit ou grand boutien) que le fichier d'entrée. Ceci évite la transformation en UTF-8. Une BOM UTF-16 sera écrite en conséquent. Cette option peut être désactivée avec l'option -ascii.

-ul, --assume-utf16le

Suppose que le fichier d'entrée est au format UTF-16LE.

Quand il y a un indicateur d'ordre des octets dans le fichier d'entrée, l'indicateur a priorité sur cette option.

Si vous vous êtes trompé sur le format du fichier d'entrée (par exemple, ce n'était pas un fichier UTF16-LE) et que la conversion réussi, vous obtiendrez un fichier UTF-8 contenant le mauvais texte. Vous pouvez récupérer le fichier original avec iconv(1) en convertissant le fichier de sortie UTF-8 vers du UTF-16LE.

La présupposition de l'UTF-16LE fonctionne comme un mode de conversion. En utilisant le mode ascii par défaut, UTF-16LE n'est plus présupposé.

-ub, --assume-utf16be

Suppose que le fichier d'entrée est au format UTF-16BE.

Cette option fonctionne comme l'option -ul.

-v, --verbose

Affiche des messages verbeux. Des informations supplémentaires sont affichées à propos des marques d'ordre des octets et du nombre de sauts de lignes convertis.

Suit les liens symboliques et convertit les cibles.

Remplace les liens symboliques par les fichiers convertis (les fichiers cibles originaux restent inchangés).

Ne change pas les liens symboliques ni les cibles (par défaut).

-V, --version

Affiche les informations de version puis arrête.

MODE MAC

En mode normal, les sauts de lignes sont convertis du DOS vers Unix et inversement. Les sauts de lignes Mac ne sont pas convertis.

En mode Mac, les sauts de lignes sont convertis du format Mac au format Unix et inversement. Les sauts de lignes DOS ne sont pas changés.

Pour fonctionner en mode Mac, utilisez l'option en ligne de commande -c mac ou utilisez les commandes mac2unix ou unix2mac.

MODES DE CONVERSION

ascii

En mode ascii, seuls les sauts de lignes sont convertis. Ceci est le mode de conversion par défaut.

Bien que le nom de ce mode soit ASCII, qui est un standard 7 bits, ce mode travail en réalité sur 8 bits. Utilisez toujours ce mode lorsque vous convertissez des fichiers Unicode UTF-8.

7bit

Dans ce mode, tous les caractères 8 bits non ASCII (avec des valeurs entre 128 et 255) sont remplacés par une espace 7 bits.

iso

Les caractères sont convertis entre un jeu de caractères DOS (code page) et le jeu de caractères ISO-8859-1 (Latin-1) de Unix. Les caractères DOS sans équivalent ISO-8859-1, pour lesquels la conversion n'est pas possible, sont remplacés par un point. La même chose est valable pour les caractères ISO-8859-1 sans équivalent DOS.

Quand seule l'option -iso est utilisée, dos2unix essaie de déterminer le code page actif. Quand ce n'est pas possible, dos2unix utilise le code page CP437 par défaut qui est surtout utilisé aux USA. Pour forcer l'utilisation d'un code page spécifique, utilisez les options -437 (US), -850 (Europe de l'ouest), -860 (portugais), -863 (français canadien) ou -865 (nordique). Le code page CP1252 de Windows (Europe de l'ouest) est également supporté avec l'option -1252. Pour d'autres codes pages, utilisez dos2unix avec iconv(1). Iconv supporte une longue liste de codages de caractères.

N'utilisez jamais la conversion ISO sur des fichiers textes Unicode. Cela va corrompre les fichiers encodés en UTF-8.

Quelques exemples:

Convertir du code page par défaut du DOS au Latin-1 Unix :

    dos2unix -iso -n entrée.txt sortie.txt

Convertir du CP850 du DOS au Latin-1 Unix :

    dos2unix -850 -n entrée.txt sortie.txt

Convertir du CP1252 de Windows au Latin-1 de Unix :

    dos2unix -1252 -n entrée.txt sortie.txt

Convertir le CP1252 de Windows en UTF-8 de Unix (Unicode) :

    iconv -f CP1252 -t UTF-8 entrée.txt | dos2unix > sortie.txt

Convertir du Latin-1 de Unix au code page par défaut de DOS :

    unix2dos -iso -n entrée.txt sortie.txt

Convertir le Latin-1 de Unix en CP850 du DOS :

    unix2dos -850 -n entrée.txt sortie.txt

Convertir le Latin-1 de Unix en CP1252 de Windows :

    unix2dos -1252 -n entrée.txt sortie.txt

Convertir le UTF-8 de Unix (Unicode) en CP1252 de Windows :

    unix2dos < entrée.txt | iconv -f UTF-8 -t CP1252 > sortie.txt

Consultez aussi http://czyborra.com/charsets/codepages.html et http://czyborra.com/charsets/iso8859.html.

UNICODE

Codages

Il existe plusieurs codages Unicode. Sous Unix et Linux, les fichiers sont généralement codés en UTF-8. Sous Windows, les fichiers textes Unicode peuvent être codés en UTF-8, UTF-16 ou UTF-16 gros boutien mais ils sont majoritairement codés au format UTF-16.

Conversion

Les fichiers textes Unicode peuvent avoir des sauts de lignes DOS, Unix ou Mac, tout comme les fichiers textes normaux.

Toutes les versions de dos2unix et unix2dos peuvent convertir des fichiers codés en UTF-8 car UTF-8 a été conçu pour être rétro-compatible avec l'ASCII.

Dos2unix et unix2dos, avec le support pour l'Unicode UTF-16, peuvent lire les fichiers textes codés sous forme petit boutien ou gros boutien. Pour savoir si dos2unix a été compilé avec le support UTF-16 tapez dos2unix -V.

Sous Unix/Linux, les fichiers encodés en UTF-16 sont convertis vers l'encodage des caractères de la localisation. Utilisez locale(1) pour découvrir quel encodage de caractères est utilisé. Lorsque la conversion n'est pas possible, une erreur de conversion est produite et le fichier est abandonné.

Sous Windows, les fichiers UTF-16 sont convertis par défaut en UTF-8. Les fichiers textes formatés en UTF-8 sont bien supportés sous Windows et Unix/Linux.

Les codages UTF-16 et UTF-8 sont parfaitement compatibles. Il n'y a pas de pertes lors de la conversion. Lorsqu'une erreur de conversion UTF-16 vers UTF-8 survient, par exemple, quand le fichier d'entrée UTF-16 contient une erreur, le fichier est ignoré.

Quand l'option -u est utilisée, le fichier de sortie est écrit dans le même encodage UTF-16 que le fichier d'entrée. L'option -u empêche la conversion en UTF-8.

Dos2unix et unix2dos n'ont pas d'option pour convertir des fichiers UTF-8 en UTF-16.

Les modes de conversion ISO et 7 bits ne fonctionnent pas sur des fichiers UTF-16.

Marque d'ordre des octets

Les fichiers textes Unicode sous Windows on généralement un indicateur d'ordre des octets (BOM) car de nombreux programmes Windows (y compris Notepad) ajoutent cet indicateur par défaut. Consultez aussi http://fr.wikipedia.org/wiki/Indicateur_d%27ordre_des_octets.

Sous Unix, les fichiers Unicodes n'ont habituellement pas de BOM. Il est supposé que les fichiers textes sont codés selon le codage de l'environnement linguistique.

Dos2unix ne peut détecter que le fichier est au format UTF-16 si le fichier n'a pas de BOM. Quand le fichier UTF-16 n'a pas cet indicateur, dos2unix voit le fichier comme un fichier binaire.

Utilisez l'option -ul ou -ub pour convertir un fichier UTF-16 sans BOM.

Dos2unix, par défaut, n'écrit pas de BOM dans le fichier de sortie. Avec l'option -b, Dos2unix écrit une BOM quand le fichier d'entrée a une BOM.

Unix2dos écrit par défaut une BOM dans le fichier de sortie quand le fichier d'entrée a une BOM. Utilisez l'option -r pour supprimer la BOM.

Dos2unix et unix2dos écrivent toujours une BOM quand l'option -m est utilisée.

Noms de fichiers unicode sous Windows

Dos2unix supporte, en option, la lecture et l'écriture de noms de fichiers Unicode dans la ligne de commande de Windows. Cela signifie que dos2unix peut ouvrir des fichiers qui ont, dans leur nom, des caractères n'appartenant pas au code page système ANSI par défaut. Pour voir si dos2unix pour Windows a été compilé avec le support des noms de fichiers Unicode, tapez dos2unix -V.

Il y a quelques soucis avec l'affichage de noms de fichiers Unicode dans une console Windows. Voyez l'option -D, --display-enc. Les noms de fichiers peuvent être mal affichés dans la console mais les fichiers seront écrits avec les bons noms.

Exemples Unicode

Convertir de l'UTF-16 Windows (avec BOM) vers l'UTF-8 de Unix :

    dos2unix -n entrée.txt sortie.txt

Convertir de l'UTF-16LE de Windows (sans BOM) vers l'UTF-8 de Unix :

    dos2unix -ul -n entrée.txt sortie.txt

Convertir de l'UTF-8 de Unix vers l'UTF-8 de Windows avec BOM :

    unix2dos -m -n entrée.txt sortie.txt

Convertir de l'UTF-8 de Unix vers l'UTF-16 de Windows :

    unix2dos < entrée.txt | iconv -f UTF-8 -t UTF-16 > sortie.txt

GB18030

GB18030 est un standard du gouvernement chinois. Tout logiciel vendu en Chine doit officiellement supporter un sous ensemble obligatoire du standard GB18030. Consultez http://fr.wikipedia.org/wiki/GB_18030.

GB18030 est entièrement compatible avec Unicode et peut être considéré comme étant un format de transformation unicode. Comme UTF-8, GB18030 est compatible avec ASCII. GB18030 est aussi compatible avec le code page 936 de Windows aussi connu comme GBK.

Sous Unix/Linux, les fichiers UTF-16 sont convertis en GB18030 quand l'encodage de l'environnement linguistique est GB18030. Notez que cela ne fonctionnera que si l'environnement linguistique est supporté par le système. Utilisez la commande locale -a pour obtenir la liste des environnements linguistiques supportés.

Sous Windows, vous avez besoin de l'option -gb pour convertir UTF-16 en GB18030.

Les fichiers encodés en GB18030 peuvent avoir une marque d'ordre des octets, comme les fichiers Unicode.

EXEMPLES

Lire l'entrée depuis « stdin » et écrire la sortie vers « stdout » :

    dos2unix < a.txt
    cat a.txt | dos2unix

Convertir et remplacer a.txt. Convertir et remplace b.txt :

    dos2unix a.txt b.txt
    dos2unix -o a.txt b.txt

Convertir et remplacer a.txt en mode de conversion ascii :

    dos2unix a.txt

Convertir et remplacer a.txt en mode de conversion ascii. Convertir et remplacer b.txt en mode de conversion 7 bits :

    dos2unix a.txt -c 7bit b.txt
    dos2unix -c ascii a.txt -c 7bit b.txt
    dos2unix -ascii a.txt -7 b.txt

Convertir a.txt depuis le format Mac vers le format Unix :

    dos2unix -c mac a.txt
    mac2unix a.txt

Convertir a.txt du format Unix au format Mac :

    unix2dos -c mac a.txt
    unix2mac a.txt

Convertir et remplacer a.txt tout en conservant la date originale :

    dos2unix -k a.txt
    dos2unix -k -o a.txt

Convertir a.txt et écrire dans e.txt :

    dos2unix -n a.txt e.txt

Convertir a.txt et écrire dans e.txt. La date de e.txt est la même que celle de a.txt :

    dos2unix -k -n a.txt e.txt

Convertir et remplacer a.txt. Convertir b.txt et écrire dans e.txt :

    dos2unix a.txt -n b.txt e.txt
    dos2unix -o a.txt -n b.txt e.txt

Convertir c.txt et écrire dans e.txt. Convertir et remplacer a.txt. Convertir et remplacer b.txt. Convertir d.txt et écrire dans f.txt :

    dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt

CONVERSIONS RÉCURSIVES

Utilisez dos2unix avec les commandes find(1) et xargs(1) pour convertir récursivement des fichiers textes dans une arborescence de répertoires. Par exemple, pour convertir tous les fichiers .txt dans les répertoires sous le répertoire courant, tapez:

    find . -name '*.txt' |xargs dos2unix

En ligne de commande sous Windows, la commande suivante peut être utilisée :

    for /R %G in (*.txt) do dos2unix "%G"
    find /R %G in 

Les utilisateurs de PowerShell peuvent utiliser la commande suivante dans le PowerShell de Windows :

    get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}

PARAMÈTRES LINGUISTIQUES

LANG

La langue principale est sélectionnée par la variable d'environnement LANG. La variable LANG est composée de plusieurs parties. La première partie est le code de la langue en minuscules. La deuxième partie est le code du pays en majuscules précédé d'un souligné. Elle est facultative. Il y a aussi une troisième partie facultative qui est le codage des caractères précédé par un point. Voici quelques exemples pour un shell au standard POSIX:

    export LANG=fr               Français
    export LANG=fr_CA            Français, Canada
    export LANG=fr_BE            Français, Belgique
    export LANG=es_ES            Espagnol, Espagne
    export LANG=es_MX            Espagnol, Mexique
    export LANG=en_US.iso88591   Anglais, USA, codage Latin-1
    export LANG=en_GB.UTF-8      Anglais, UK, codage UTF-8

La liste complète des codes de langues et de pays est dans le manuel de gettext: http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

Sur les systèmes Unix, vous pouvez utiliser la commande locale(1) pour obtenir des informations sur l'environnement linguistique.

LANGUE

Avec la variable d'environnement LANGUAGE, vous pouvez spécifier une liste de langues prioritaires séparées par des deux-points. Dos2unix fait passer LANGUAGE avant LANG. Par exemple, pour utiliser le français avant l'anglais: LANGUAGE=fr:en. Vous devez d'abord activer l'environnement linguistique en assignant une valeur autre que « C » à LANG (ou LC_ALL). Ensuite, vous pourrez utiliser la liste de priorité avec la variable LANGUAGE. Voyez également le manuel de gettext: http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

Si vous sélectionnez une langue qui n'est pas disponible, vous obtiendrez des messages en anglais standard.

DOS2UNIX_LOCALEDIR

Grâce à la variable d'environnement DOS2UNIX_LOCALEDIR, la variable LOCALEDIR compilée dans l'application peut être remplacée. LOCALEDIR est utilisée pour trouver les fichiers de langue. La valeur par défaut de GNU est /usr/local/share/locale. L'option --version affiche la valeur de LOCALEDIR utilisée.

Exemple (shell POSIX):

    export DOS2UNIX_LOCALEDIR=$HOME/share/locale

VALEUR DE RETOUR

Zéro est retourné en cas de succès. Si une erreur système se produit, la dernière erreur système est retournée. Pour les autres erreurs, 1 est renvoyé.

La valeur de sortie est toujours zéro en mode silencieux sauf quand de mauvaises options sont utilisées sur la ligne de commande.

STANDARDS

http://fr.wikipedia.org/wiki/Fichier_texte

http://fr.wikipedia.org/wiki/Retour_chariot

http://fr.wikipedia.org/wiki/Fin_de_ligne

http://fr.wikipedia.org/wiki/Unicode

AUTEURS

Benjamin Lin - <blin@socs.uts.edu.au>, Bernd Johannes Wuebben (mode mac2unix) - <wuebben@kde.org>, Christian Wurll (ajout de saut de ligne supplémentaire) - <wurll@ira.uka.de>, Erwin Waterlander - <waterlan@xs4all.nl> (Mainteneur)

Page du projet: http://waterlan.home.xs4all.nl/dos2unix.html

Page SourceForge: http://sourceforge.net/projects/dos2unix/

VOIR AUSSI

file(1) find(1) iconv(1) locale(1) xargs(1)

dos2unix-7.3.4/man/fr/man1/dos2unix.pod0000644000175500010010000007127212721132564017060 0ustar waterlanGeen ***************************************************** * GENERATED FILE, DO NOT EDIT * * THIS IS NO SOURCE FILE, BUT RESULT OF COMPILATION * ***************************************************** This file was generated by po4a(7). Do not store it (in VCS, for example), but store the PO file used as source file by po4a-translate. In fact, consider this as a binary, and the PO file as a regular .c file: If the PO get lost, keeping this translation up-to-date will be harder. =pod =encoding UTF-8 =head1 NOM dos2unix - Convertit les fichiers textes du format DOS/Mac vers Unix et inversement =head1 SYNOPSIS dos2unix [options] [FICHIER …] [-n FICHIER_ENTRÉE FICHIER_SORTIE …] unix2dos [options] [FICHIER …] [-n FICHIER_ENTRÉE FICHIER_SORTIE …] =head1 DESCRIPTION Le package Dos2unix inclut les utilitaires C et C pour convertir des fichiers textes au format DOS ou Mac vers le format Unix et inversement. Dans les fichiers textes DOS/Windows, un saut de ligne est une combinaison de deux caractères: un retour de chariot (CR) suivi d'un saut de ligne (LF). Dans les fichiers textes Unix, le saut de ligne est un seul caractère: le saut de ligne (LF). Les fichiers textes Mac, avant Mac OS X, utilisaient le retour chariot (CR) comme seul caractère. De nos jours, Mac OS utilise le même style de saut de ligne que Unix (LF). Outre les sauts de lignes, Dos2unix convertit aussi le codage des fichiers. Quelques codes page DOS peuvent être convertis en Latin-1 sous Unix. L'Unicode des fichiers Windows (UTF-16) peut être converti en Unicode Unix (UTF-8). Les fichiers binaires sont automatiquement ignorés à moins que la conversion soit forcée. Les fichiers non réguliers tels que les répertoires et les FIFOs sont automatiquement ignorés. Les liens symboliques et leur cible sont, par défaut, inchangés. En option, les liens symboliques peuvent être remplacés ou, au choix, la sortie peut être écrite dans la cible du lien symbolique. Écrire dans la cible d'un lien symbolique n'est pas supporté sous Windows. Dos2unix a été conçu comme dos2unix sous SunOS/Solaris. Il y a une différence importante avec la version originale de SunOS/Solaris. Cette version effectue les conversions en place (ancien mode de fichier) tandis que la version originale de SunOS/Solaris ne supporte que la conversion par paire (nouveau mode de fichier). Voyez aussi les options C<-o> et C<-n>. Une autre différence est que SunOS/Solaris utilise par défaut le mode de conversion I tandis que cette version utilise par défaut le mode de conversion I. =head1 OPTIONS =over 4 =item B<--> Traites toutes les options à sa suite comme étant des noms de fichiers. Utilisez cette option si vous voulez convertir des fichiers dont le nom commence par un tiret. Par exemple, pour convertir un fichier nommé S<« -foo »,> vous pouvez utiliser cette commande: dos2unix -- -foo Ou dans le style des nouveaux fichiers: dos2unix -n -- -foo sortie.txt =item B<-ascii> Convertit uniquement les sauts de lignes. C'est le mode de conversion par défaut. =item B<-iso> Convertit le jeu de caractères du DOS vers ISO-8859-1. Voyez aussi la section des MODES DE CONVERSION. =item B<-1252> Utilise le code page 1252 de Windows (Europe de l'ouest). =item B<-437> Utilise le code page 437 du DOS (US). C'est le code page par défaut pour les conversions ISO. =item B<-850> Utilise le code page 850 du DOS (Europe de l'ouest). =item B<-860> Utilise le code page 860 du DOS (portugais). =item B<-863> Utilise le code page 863 du DOS (français canadien). =item B<-865> Utilise le code page 865 du DOS (nordique). =item B<-7> Convertit les caractères 8 bits vers l'espace 7 bits. =item B<-b, --keep-bom> Conserve la marque d'ordre des octets (BOM). Si le fichier d'entrée a une BOM, elle est écrite dans le fichier de sortie. C'est le comportement par défaut quand les sauts de lignes sont convertis au format DOS. Consultez aussi l'option C<-r>. =item B<-c, --convmode MODE_CONV> Change le mode de conversion. MODE_CONV prend l'une des valeurs: I, I<7bit>, I, I. Ascii est la valeur par défaut. =item B<-D, --display-enc ENCODAGE> Choisi l'encodage des textes affichés. L'ENCODAGE peut être : I, I, I, I, I. La valeur par défaut est ansi. Cette option est uniquement disponible dans dos2unix pour Windows avec support pour les noms de fichiers Unicode. Cette option n'a aucun effet sur les noms de fichiers lus et écrits. Son effet se limite à leur affichage. Il existe plusieurs méthodes pour afficher du texte dans une console Windows selon l'encodage du texte. Elles ont toutes leurs propres avantages et désavantages. =over 4 =item B La méthode par défaut de dos2unix est d'utiliser du texte encodé en ANSI. Elle a l'avantage d'être rétro compatible. Elle fonctionne avec des polices raster ou TrueType. Dans certaines régions, vous pouvez avoir besoin d'utiliser la commande C pour remplacer le code page DOS OEM actif par le code ANSI système de Windows car dos2unix utilise le code page système de Windows. Le désavantage de ansi est que les noms de fichiers internationaux avec des caractères en dehors du code page système par défaut ne sont pas affichés correctement. Vous verrez un point d'interrogation ou un mauvais symbole à leur place. Cette méthode est acceptable si vous ne travaillez pas avec des noms de fichiers étrangers. =item B L'avantage de l'encodage unicode (le nom de Windows pour UTF-16) est que le texte est habituellement affiché correctement. Il n'est pas nécessaire de changer le code page actif. Vous pouvez avoir besoin de remplacer la police de la console par une police TrueType pour afficher les caractères internationaux correctement. Lorsqu'un caractère n'est pas inclus dans la police TrueType, il sera généralement remplacé par un petit carré, parfois avec un point d'interrogation à l'intérieur. Lorsque vous utilisez la console ConEmu, les textes sont affichés correctement car ConEmu sélectionne automatiquement une bonne police. Le désavantage de unicode est qu'il n'est pas compatible avec ASCII. La sortie n'est pas facile à gérer quand vous la redirigez vers un autre programme. Quand la méthode C est utilisée, le texte Unicode est précédé d'une BOM (Byte Order Mark=marque d'ordre des octets). Une BOM est nécessaire pour la redirection correcte ou le pipelining dans PowerShell. =item B L'avantage de utf8 est qu'il est compatible avec ASCII. Vous devez utiliser une police TrueType dans la console. Avec une police TrueType, le texte est affiché comme avec un encodage C. Le désavantage est que, si vous utilisez la police raster par défaut, tous les caractères non ASCII sont mal affichés. Pas uniquement les noms de fichiers S Les messages traduits deviennent inintelligibles. Sous Windows configuré pour une région de l'est de l'Asie, vous pouvez observer énormément de scintillements dans la console quand des messages sont affichés. Dans une console ConEmu, l'encodage utf8 fonctionne bien. Quand la méthode C est utilisée, le texte UTF-8 est précédé d'une BOM (Byte Order Mark=marque d'ordre des octets). Une BOM est nécessaire pour la redirection correcte ou le pipelining dans PowerShell. =back L'encodage par défaut peut être changé en assignant la valeur C, C, C ou C à la variable d'environnement DOS2UNIX_DISPLAY_ENC. =item B<-f, --force> Force la conversion de fichiers binaires. =item B<-gb, --gb18030> Sous Windows, les fichiers UTF-16 sont convertis en UTF-8 par défaut sans considération pour les paramètres de la localisation. Utilisez cette option pour convertir UTF-16 en GB18030. Cette option n'est disponible que sous Windows. Consultez aussi la section GB18030. =item B<-h, --help> Affiche l'aide et s'arrête. =item B<-i[FANIONS], --info[=FANIONS] FICHIER …> Affiche les informations du fichier. Aucune conversion n'est réalisée. Les informations suivantes sont affichées dans cet ordre: le nombre de sauts de ligne DOS, le nombre de sauts de ligne Unix, le nombre de sauts de ligne Mac, la marque d'ordre des octets, texte ou binaire, nom du fichier. Exemple de S 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Notez qu'un fichier binaire peut parfois être considéré à tord comme un fichier texte. Voyez aussi l'option C<-s>. Des fanions facultatifs peuvent être ajoutés pour changer la sortie. Un ou plusieurs fanions peuvent être ajoutés. =over 4 =item B Affiche le nombre de sauts de ligne DOS. =item B Affiche le nombre de sauts de ligne Unix. =item B Affiche le nombre de sauts de ligne Mac. =item B Afficher la marque d'ordre des octets. =item B Affiche si le fichier est texte ou binaire. =item B Affiche uniquement les fichiers qui seraient convertis. Avec le fanion C, dos2unix n'affichera que les fichiers contenant des sauts de ligne DOS alors que unix2dos n'affichera que les noms des fichiers aillant des sauts de ligne Unix. =item B Afficher un en-tête. =item B

Montrer les noms des fichiers sans le chemin. =back Exemples: Afficher les informations pour tous les fichier S<*.txt :> dos2unix -i *.txt Afficher uniquement le nombre de sauts de ligne DOS et S dos2unix -idu *.txt Montrer uniquement la marque d'ordre des S dos2unix --info=b *.txt Liste les fichiers qui ont des sauts de ligne DOS : dos2unix -ic *.txt Liste les fichiers qui ont des sauts de ligne Unix : unix2dos -ic *.txt Ne converti que les fichiers qui ont des sauts de lignes DOS et laisse les autres fichiers inchangés: dos2unix -ic *.txt | xargs dos2unix Trouve les fichiers texte qui ont des sauts de ligne DOS : find -name '*.txt' | xargs dos2unix -ic =item B<-k, --keepdate> La date du fichier de sortie est la même que celle du fichier d'entrée. =item B<-L, --license> Affiche la licence du programme. =item B<-l, --newline> Ajoute des sauts de lignes additionnels. B: Seuls les sauts de lignes du DOS sont changés en deux sauts de lignes de Unix. En mode Mac, seuls les sauts de lignes Mac sont changés en deux sauts de lignes Unix. B: Seuls les sauts de lignes Unix sont changés en deux sauts de lignes du DOS. En mode Mac, les sauts de lignes Unix sont remplacés par deux sauts de lignes Mac. =item B<-m, --add-bom> Écrit une marque d'ordre des octets (BOM) dans le fichier de sortie. Par défaut une BOM UTF-8 est écrite. Lorsque le fichier d'entrée est en UTF-16 et que l'option C<-u> est utilisée, une BOM UTF-16 est écrite. N'utilisez jamais cette option quand l'encodage du fichier de sortie n'est ni UTF-8 ni UTF-16 ni GB18030. Consultez également la section UNICODE. =item B<-n, --newfile FICHIER_ENTRÉE FICHIER_SORTIE …> Nouveau mode de fichiers. Convertit le fichier FICHER_ENTRÉE et écrit la sortie dans le fichier FICHIER_SORTIE. Les noms des fichiers doivent être indiqués par paires. Les jokers I doivent I être utilisés ou vous I vos fichiers. La personne qui démarre la conversion dans le nouveau mode (pairé) des fichiers sera le propriétaire du fichier converti. Les permissions de lecture/écriture du nouveau fichier seront les permissions du fichier original moins le umask(1) de la personne qui exécute la conversion. =item B<-o, --oldfile FICHIER …> Ancien mode de fichiers. Convertit le fichier FICHIER et écrit la sortie dedans. Le programme fonctionne dans ce mode par défaut. Les jokers peuvent être utilisés. Dans l'ancien mode (en place) des fichiers, les fichiers convertis ont le même propriétaire, groupe et permissions lecture/écriture que le fichier original. Idem quand le fichier est converti par un utilisateur qui a la permission d'écrire dans le fichier (par exemple, root). La conversion est interrompue si il n'est pas possible de conserver les valeurs d'origine. Le changement de propriétaire pourrait signifier que le propriétaire original n'est plus en mesure de lire le fichier. Le changement de groupe pourrait être un risque pour la sécurité. Le fichier pourrait être rendu accessible en lecture par des personnes à qui il n'est pas destiné. La conservation du propriétaire, du groupe et des permissions de lecture/écriture n'est supportée que sous Unix. =item B<-q, --quiet> Mode silencieux. Supprime les avertissements et les messages. La valeur de sortie est zéro sauf quand de mauvaises options sont utilisées sur la ligne de commande. =item B<-r, --remove-bom> Supprime la marque d'ordre des octets (BOM). N'écrit pas la BOM dans le fichier de sortie. Ceci est le comportement par défaut lorsque les sauts de lignes sont convertis au format Unix. Consultez aussi l'option C<-b>. =item B<-s, --safe> Ignore les fichiers binaires (par défaut). Ignorer les fichiers binaires sert à éviter les erreurs accidentelles. Attention que la détection de fichiers binaires n'est pas fiable à 100%. Les fichiers en entrée sont analysés pour y trouver des symboles binaires qui ne sont habituellement pas rencontrés dans des fichiers textes. Il est cependant possible qu'un fichier binaire ne contienne que des caractères textes normaux. Un tel fichier serait erronément traité comme un fichier texte. =item B<-u, --keep-utf16> Conserve l'encodage UTF-16 original du fichier d'entrée. Le fichier de sortie sera écrit dans le même encodage UTF-16 (petit ou grand boutien) que le fichier d'entrée. Ceci évite la transformation en UTF-8. Une BOM UTF-16 sera écrite en conséquent. Cette option peut être désactivée avec l'option C<-ascii>. =item B<-ul, --assume-utf16le> Suppose que le fichier d'entrée est au format UTF-16LE. Quand il y a un indicateur d'ordre des octets dans le fichier d'entrée, l'indicateur a priorité sur cette option. Si vous vous êtes trompé sur le format du fichier d'entrée (par exemple, ce n'était pas un fichier UTF16-LE) et que la conversion réussi, vous obtiendrez un fichier UTF-8 contenant le mauvais texte. Vous pouvez récupérer le fichier original avec iconv(1) en convertissant le fichier de sortie UTF-8 vers du UTF-16LE. La présupposition de l'UTF-16LE fonctionne comme un I. En utilisant le mode I par défaut, UTF-16LE n'est plus présupposé. =item B<-ub, --assume-utf16be> Suppose que le fichier d'entrée est au format UTF-16BE. Cette option fonctionne comme l'option C<-ul>. =item B<-v, --verbose> Affiche des messages verbeux. Des informations supplémentaires sont affichées à propos des marques d'ordre des octets et du nombre de sauts de lignes convertis. =item B<-F, --follow-symlink> Suit les liens symboliques et convertit les cibles. =item B<-R, --replace-symlink> Remplace les liens symboliques par les fichiers convertis (les fichiers cibles originaux restent inchangés). =item B<-S, --skip-symlink> Ne change pas les liens symboliques ni les cibles (par défaut). =item B<-V, --version> Affiche les informations de version puis arrête. =back =head1 MODE MAC En mode normal, les sauts de lignes sont convertis du DOS vers Unix et inversement. Les sauts de lignes Mac ne sont pas convertis. En mode Mac, les sauts de lignes sont convertis du format Mac au format Unix et inversement. Les sauts de lignes DOS ne sont pas changés. Pour fonctionner en mode Mac, utilisez l'option en ligne de commande C<-c mac> ou utilisez les commandes C ou C. =head1 MODES DE CONVERSION =over 4 =item B En mode C, seuls les sauts de lignes sont convertis. Ceci est le mode de conversion par défaut. Bien que le nom de ce mode soit ASCII, qui est un standard 7 bits, ce mode travail en réalité sur 8 bits. Utilisez toujours ce mode lorsque vous convertissez des fichiers Unicode UTF-8. =item B<7bit> Dans ce mode, tous les caractères 8 bits non ASCII (avec des valeurs entre 128 et 255) sont remplacés par une espace 7 bits. =item B Les caractères sont convertis entre un jeu de caractères DOS (code page) et le jeu de caractères ISO-8859-1 (Latin-1) de Unix. Les caractères DOS sans équivalent ISO-8859-1, pour lesquels la conversion n'est pas possible, sont remplacés par un point. La même chose est valable pour les caractères ISO-8859-1 sans équivalent DOS. Quand seule l'option C<-iso> est utilisée, dos2unix essaie de déterminer le code page actif. Quand ce n'est pas possible, dos2unix utilise le code page CP437 par défaut qui est surtout utilisé aux USA. Pour forcer l'utilisation d'un code page spécifique, utilisez les options C<-437> (US), C<-850> (Europe de l'ouest), C<-860> (portugais), C<-863> (français canadien) ou C<-865> (nordique). Le code page CP1252 de Windows (Europe de l'ouest) est également supporté avec l'option C<-1252>. Pour d'autres codes pages, utilisez dos2unix avec iconv(1). Iconv supporte une longue liste de codages de caractères. N'utilisez jamais la conversion ISO sur des fichiers textes Unicode. Cela va corrompre les fichiers encodés en UTF-8. Quelques exemples: Convertir du code page par défaut du DOS au Latin-1 Unix : dos2unix -iso -n entrée.txt sortie.txt Convertir du CP850 du DOS au Latin-1 Unix : dos2unix -850 -n entrée.txt sortie.txt Convertir du CP1252 de Windows au Latin-1 de Unix : dos2unix -1252 -n entrée.txt sortie.txt Convertir le CP1252 de Windows en UTF-8 de Unix (Unicode) : iconv -f CP1252 -t UTF-8 entrée.txt | dos2unix > sortie.txt Convertir du Latin-1 de Unix au code page par défaut de DOS : unix2dos -iso -n entrée.txt sortie.txt Convertir le Latin-1 de Unix en CP850 du DOS : unix2dos -850 -n entrée.txt sortie.txt Convertir le Latin-1 de Unix en CP1252 de Windows : unix2dos -1252 -n entrée.txt sortie.txt Convertir le UTF-8 de Unix (Unicode) en CP1252 de Windows : unix2dos < entrée.txt | iconv -f UTF-8 -t CP1252 > sortie.txt Consultez aussi L et L. =back =head1 UNICODE =head2 Codages Il existe plusieurs codages Unicode. Sous Unix et Linux, les fichiers sont généralement codés en UTF-8. Sous Windows, les fichiers textes Unicode peuvent être codés en UTF-8, UTF-16 ou UTF-16 gros boutien mais ils sont majoritairement codés au format UTF-16. =head2 Conversion Les fichiers textes Unicode peuvent avoir des sauts de lignes DOS, Unix ou Mac, tout comme les fichiers textes normaux. Toutes les versions de dos2unix et unix2dos peuvent convertir des fichiers codés en UTF-8 car UTF-8 a été conçu pour être rétro-compatible avec l'ASCII. Dos2unix et unix2dos, avec le support pour l'Unicode UTF-16, peuvent lire les fichiers textes codés sous forme petit boutien ou gros boutien. Pour savoir si dos2unix a été compilé avec le support UTF-16 tapez C. Sous Unix/Linux, les fichiers encodés en UTF-16 sont convertis vers l'encodage des caractères de la localisation. Utilisez locale(1) pour découvrir quel encodage de caractères est utilisé. Lorsque la conversion n'est pas possible, une erreur de conversion est produite et le fichier est abandonné. Sous Windows, les fichiers UTF-16 sont convertis par défaut en UTF-8. Les fichiers textes formatés en UTF-8 sont bien supportés sous Windows et Unix/Linux. Les codages UTF-16 et UTF-8 sont parfaitement compatibles. Il n'y a pas de pertes lors de la conversion. Lorsqu'une erreur de conversion UTF-16 vers UTF-8 survient, par exemple, quand le fichier d'entrée UTF-16 contient une erreur, le fichier est ignoré. Quand l'option C<-u> est utilisée, le fichier de sortie est écrit dans le même encodage UTF-16 que le fichier d'entrée. L'option C<-u> empêche la conversion en UTF-8. Dos2unix et unix2dos n'ont pas d'option pour convertir des fichiers UTF-8 en UTF-16. Les modes de conversion ISO et 7 bits ne fonctionnent pas sur des fichiers UTF-16. =head2 Marque d'ordre des octets Les fichiers textes Unicode sous Windows on généralement un indicateur d'ordre des octets (BOM) car de nombreux programmes Windows (y compris Notepad) ajoutent cet indicateur par défaut. Consultez aussi L. Sous Unix, les fichiers Unicodes n'ont habituellement pas de BOM. Il est supposé que les fichiers textes sont codés selon le codage de l'environnement linguistique. Dos2unix ne peut détecter que le fichier est au format UTF-16 si le fichier n'a pas de BOM. Quand le fichier UTF-16 n'a pas cet indicateur, dos2unix voit le fichier comme un fichier binaire. Utilisez l'option C<-ul> ou C<-ub> pour convertir un fichier UTF-16 sans BOM. Dos2unix, par défaut, n'écrit pas de BOM dans le fichier de sortie. Avec l'option C<-b>, Dos2unix écrit une BOM quand le fichier d'entrée a une BOM. Unix2dos écrit par défaut une BOM dans le fichier de sortie quand le fichier d'entrée a une BOM. Utilisez l'option C<-r> pour supprimer la BOM. Dos2unix et unix2dos écrivent toujours une BOM quand l'option C<-m> est utilisée. =head2 Noms de fichiers unicode sous Windows Dos2unix supporte, en option, la lecture et l'écriture de noms de fichiers Unicode dans la ligne de commande de Windows. Cela signifie que dos2unix peut ouvrir des fichiers qui ont, dans leur nom, des caractères n'appartenant pas au code page système ANSI par défaut. Pour voir si dos2unix pour Windows a été compilé avec le support des noms de fichiers Unicode, tapez C. Il y a quelques soucis avec l'affichage de noms de fichiers Unicode dans une console Windows. Voyez l'option C<-D>, C<--display-enc>. Les noms de fichiers peuvent être mal affichés dans la console mais les fichiers seront écrits avec les bons noms. =head2 Exemples Unicode Convertir de l'UTF-16 Windows (avec BOM) vers l'UTF-8 de Unix : dos2unix -n entrée.txt sortie.txt Convertir de l'UTF-16LE de Windows (sans BOM) vers l'UTF-8 de Unix : dos2unix -ul -n entrée.txt sortie.txt Convertir de l'UTF-8 de Unix vers l'UTF-8 de Windows avec BOM : unix2dos -m -n entrée.txt sortie.txt Convertir de l'UTF-8 de Unix vers l'UTF-16 de Windows : unix2dos < entrée.txt | iconv -f UTF-8 -t UTF-16 > sortie.txt =head1 GB18030 GB18030 est un standard du gouvernement chinois. Tout logiciel vendu en Chine doit officiellement supporter un sous ensemble obligatoire du standard GB18030. Consultez L. GB18030 est entièrement compatible avec Unicode et peut être considéré comme étant un format de transformation unicode. Comme UTF-8, GB18030 est compatible avec ASCII. GB18030 est aussi compatible avec le code page 936 de Windows aussi connu comme GBK. Sous Unix/Linux, les fichiers UTF-16 sont convertis en GB18030 quand l'encodage de l'environnement linguistique est GB18030. Notez que cela ne fonctionnera que si l'environnement linguistique est supporté par le système. Utilisez la commande C pour obtenir la liste des environnements linguistiques supportés. Sous Windows, vous avez besoin de l'option C<-gb> pour convertir UTF-16 en GB18030. Les fichiers encodés en GB18030 peuvent avoir une marque d'ordre des octets, comme les fichiers Unicode. =head1 EXEMPLES Lire l'entrée depuis S<« stdin »> et écrire la sortie vers S<« stdout » :> dos2unix < a.txt cat a.txt | dos2unix Convertir et remplacer a.txt. Convertir et remplace b.txt : dos2unix a.txt b.txt dos2unix -o a.txt b.txt Convertir et remplacer a.txt en mode de conversion ascii : dos2unix a.txt Convertir et remplacer a.txt en mode de conversion ascii. Convertir et remplacer b.txt en mode de conversion 7 bits : dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Convertir a.txt depuis le format Mac vers le format Unix : dos2unix -c mac a.txt mac2unix a.txt Convertir a.txt du format Unix au format Mac : unix2dos -c mac a.txt unix2mac a.txt Convertir et remplacer a.txt tout en conservant la date originale : dos2unix -k a.txt dos2unix -k -o a.txt Convertir a.txt et écrire dans e.txt : dos2unix -n a.txt e.txt Convertir a.txt et écrire dans e.txt. La date de e.txt est la même que celle de a.txt : dos2unix -k -n a.txt e.txt Convertir et remplacer a.txt. Convertir b.txt et écrire dans e.txt : dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Convertir c.txt et écrire dans e.txt. Convertir et remplacer a.txt. Convertir et remplacer b.txt. Convertir d.txt et écrire dans f.txt : dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 CONVERSIONS RÉCURSIVES Utilisez dos2unix avec les commandes find(1) et xargs(1) pour convertir récursivement des fichiers textes dans une arborescence de répertoires. Par exemple, pour convertir tous les fichiers .txt dans les répertoires sous le répertoire courant, tapez: find . -name '*.txt' |xargs dos2unix En ligne de commande sous Windows, la commande suivante peut être utilisée : for /R %G in (*.txt) do dos2unix "%G" find /R %G in Les utilisateurs de PowerShell peuvent utiliser la commande suivante dans le PowerShell de Windows : get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} =head1 PARAMÈTRES LINGUISTIQUES =over 4 =item B La langue principale est sélectionnée par la variable d'environnement LANG. La variable LANG est composée de plusieurs parties. La première partie est le code de la langue en minuscules. La deuxième partie est le code du pays en majuscules précédé d'un souligné. Elle est facultative. Il y a aussi une troisième partie facultative qui est le codage des caractères précédé par un point. Voici quelques exemples pour un shell au standard POSIX: export LANG=fr Français export LANG=fr_CA Français, Canada export LANG=fr_BE Français, Belgique export LANG=es_ES Espagnol, Espagne export LANG=es_MX Espagnol, Mexique export LANG=en_US.iso88591 Anglais, USA, codage Latin-1 export LANG=en_GB.UTF-8 Anglais, UK, codage UTF-8 La liste complète des codes de langues et de pays est dans le manuel de gettext: L Sur les systèmes Unix, vous pouvez utiliser la commande locale(1) pour obtenir des informations sur l'environnement linguistique. =item B Avec la variable d'environnement LANGUAGE, vous pouvez spécifier une liste de langues prioritaires séparées par des deux-points. Dos2unix fait passer LANGUAGE avant LANG. Par exemple, pour utiliser le français avant l'anglais: C. Vous devez d'abord activer l'environnement linguistique en assignant une valeur autre que S<« C »> à LANG (ou LC_ALL). Ensuite, vous pourrez utiliser la liste de priorité avec la variable LANGUAGE. Voyez également le manuel de gettext: L Si vous sélectionnez une langue qui n'est pas disponible, vous obtiendrez des messages en anglais standard. =item B Grâce à la variable d'environnement DOS2UNIX_LOCALEDIR, la variable LOCALEDIR compilée dans l'application peut être remplacée. LOCALEDIR est utilisée pour trouver les fichiers de langue. La valeur par défaut de GNU est C. L'option B<--version> affiche la valeur de LOCALEDIR utilisée. Exemple (shell POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 VALEUR DE RETOUR Zéro est retourné en cas de succès. Si une erreur système se produit, la dernière erreur système est retournée. Pour les autres erreurs, 1 est renvoyé. La valeur de sortie est toujours zéro en mode silencieux sauf quand de mauvaises options sont utilisées sur la ligne de commande. =head1 STANDARDS L L L L =head1 AUTEURS Benjamin Lin - , Bernd Johannes Wuebben (mode mac2unix) - , Christian Wurll (ajout de saut de ligne supplémentaire) - , Erwin Waterlander - (Mainteneur) Page du projet: L Page SourceForge: L =head1 VOIR AUSSI file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/fr/man1/dos2unix.txt0000644000175500010010000007524612721132571017120 0ustar waterlanGeenNOM dos2unix - Convertit les fichiers textes du format DOS/Mac vers Unix et inversement SYNOPSIS dos2unix [options] [FICHIER …] [-n FICHIER_ENTRÉE FICHIER_SORTIE …] unix2dos [options] [FICHIER …] [-n FICHIER_ENTRÉE FICHIER_SORTIE …] DESCRIPTION Le package Dos2unix inclut les utilitaires "dos2unix" et "unix2dos" pour convertir des fichiers textes au format DOS ou Mac vers le format Unix et inversement. Dans les fichiers textes DOS/Windows, un saut de ligne est une combinaison de deux caractères: un retour de chariot (CR) suivi d'un saut de ligne (LF). Dans les fichiers textes Unix, le saut de ligne est un seul caractère: le saut de ligne (LF). Les fichiers textes Mac, avant Mac OS X, utilisaient le retour chariot (CR) comme seul caractère. De nos jours, Mac OS utilise le même style de saut de ligne que Unix (LF). Outre les sauts de lignes, Dos2unix convertit aussi le codage des fichiers. Quelques codes page DOS peuvent être convertis en Latin-1 sous Unix. L'Unicode des fichiers Windows (UTF-16) peut être converti en Unicode Unix (UTF-8). Les fichiers binaires sont automatiquement ignorés à moins que la conversion soit forcée. Les fichiers non réguliers tels que les répertoires et les FIFOs sont automatiquement ignorés. Les liens symboliques et leur cible sont, par défaut, inchangés. En option, les liens symboliques peuvent être remplacés ou, au choix, la sortie peut être écrite dans la cible du lien symbolique. Écrire dans la cible d'un lien symbolique n'est pas supporté sous Windows. Dos2unix a été conçu comme dos2unix sous SunOS/Solaris. Il y a une différence importante avec la version originale de SunOS/Solaris. Cette version effectue les conversions en place (ancien mode de fichier) tandis que la version originale de SunOS/Solaris ne supporte que la conversion par paire (nouveau mode de fichier). Voyez aussi les options "-o" et "-n". Une autre différence est que SunOS/Solaris utilise par défaut le mode de conversion *iso* tandis que cette version utilise par défaut le mode de conversion *ascii*. OPTIONS -- Traites toutes les options à sa suite comme étant des noms de fichiers. Utilisez cette option si vous voulez convertir des fichiers dont le nom commence par un tiret. Par exemple, pour convertir un fichier nommé « -foo », vous pouvez utiliser cette commande: dos2unix -- -foo Ou dans le style des nouveaux fichiers: dos2unix -n -- -foo sortie.txt -ascii Convertit uniquement les sauts de lignes. C'est le mode de conversion par défaut. -iso Convertit le jeu de caractères du DOS vers ISO-8859-1. Voyez aussi la section des MODES DE CONVERSION. -1252 Utilise le code page 1252 de Windows (Europe de l'ouest). -437 Utilise le code page 437 du DOS (US). C'est le code page par défaut pour les conversions ISO. -850 Utilise le code page 850 du DOS (Europe de l'ouest). -860 Utilise le code page 860 du DOS (portugais). -863 Utilise le code page 863 du DOS (français canadien). -865 Utilise le code page 865 du DOS (nordique). -7 Convertit les caractères 8 bits vers l'espace 7 bits. -b, --keep-bom Conserve la marque d'ordre des octets (BOM). Si le fichier d'entrée a une BOM, elle est écrite dans le fichier de sortie. C'est le comportement par défaut quand les sauts de lignes sont convertis au format DOS. Consultez aussi l'option "-r". -c, --convmode MODE_CONV Change le mode de conversion. MODE_CONV prend l'une des valeurs: *ascii*, *7bit*, *iso*, *mac*. Ascii est la valeur par défaut. -D, --display-enc ENCODAGE Choisi l'encodage des textes affichés. L'ENCODAGE peut être : *ansi*, *unicode*, *unicodebom*, *utf8*, *utf8bom*. La valeur par défaut est ansi. Cette option est uniquement disponible dans dos2unix pour Windows avec support pour les noms de fichiers Unicode. Cette option n'a aucun effet sur les noms de fichiers lus et écrits. Son effet se limite à leur affichage. Il existe plusieurs méthodes pour afficher du texte dans une console Windows selon l'encodage du texte. Elles ont toutes leurs propres avantages et désavantages. ansi La méthode par défaut de dos2unix est d'utiliser du texte encodé en ANSI. Elle a l'avantage d'être rétro compatible. Elle fonctionne avec des polices raster ou TrueType. Dans certaines régions, vous pouvez avoir besoin d'utiliser la commande "chcp" pour remplacer le code page DOS OEM actif par le code ANSI système de Windows car dos2unix utilise le code page système de Windows. Le désavantage de ansi est que les noms de fichiers internationaux avec des caractères en dehors du code page système par défaut ne sont pas affichés correctement. Vous verrez un point d'interrogation ou un mauvais symbole à leur place. Cette méthode est acceptable si vous ne travaillez pas avec des noms de fichiers étrangers. unicode, unicodebom L'avantage de l'encodage unicode (le nom de Windows pour UTF-16) est que le texte est habituellement affiché correctement. Il n'est pas nécessaire de changer le code page actif. Vous pouvez avoir besoin de remplacer la police de la console par une police TrueType pour afficher les caractères internationaux correctement. Lorsqu'un caractère n'est pas inclus dans la police TrueType, il sera généralement remplacé par un petit carré, parfois avec un point d'interrogation à l'intérieur. Lorsque vous utilisez la console ConEmu, les textes sont affichés correctement car ConEmu sélectionne automatiquement une bonne police. Le désavantage de unicode est qu'il n'est pas compatible avec ASCII. La sortie n'est pas facile à gérer quand vous la redirigez vers un autre programme. Quand la méthode "unicodebom" est utilisée, le texte Unicode est précédé d'une BOM (Byte Order Mark=marque d'ordre des octets). Une BOM est nécessaire pour la redirection correcte ou le pipelining dans PowerShell. utf8, utf8bom L'avantage de utf8 est qu'il est compatible avec ASCII. Vous devez utiliser une police TrueType dans la console. Avec une police TrueType, le texte est affiché comme avec un encodage "unicode". Le désavantage est que, si vous utilisez la police raster par défaut, tous les caractères non ASCII sont mal affichés. Pas uniquement les noms de fichiers unicode ! Les messages traduits deviennent inintelligibles. Sous Windows configuré pour une région de l'est de l'Asie, vous pouvez observer énormément de scintillements dans la console quand des messages sont affichés. Dans une console ConEmu, l'encodage utf8 fonctionne bien. Quand la méthode "utf8bom" est utilisée, le texte UTF-8 est précédé d'une BOM (Byte Order Mark=marque d'ordre des octets). Une BOM est nécessaire pour la redirection correcte ou le pipelining dans PowerShell. L'encodage par défaut peut être changé en assignant la valeur "unicode", "unicodebom", "utf8" ou "utf8bom" à la variable d'environnement DOS2UNIX_DISPLAY_ENC. -f, --force Force la conversion de fichiers binaires. -gb, --gb18030 Sous Windows, les fichiers UTF-16 sont convertis en UTF-8 par défaut sans considération pour les paramètres de la localisation. Utilisez cette option pour convertir UTF-16 en GB18030. Cette option n'est disponible que sous Windows. Consultez aussi la section GB18030. -h, --help Affiche l'aide et s'arrête. -i[FANIONS], --info[=FANIONS] FICHIER … Affiche les informations du fichier. Aucune conversion n'est réalisée. Les informations suivantes sont affichées dans cet ordre: le nombre de sauts de ligne DOS, le nombre de sauts de ligne Unix, le nombre de sauts de ligne Mac, la marque d'ordre des octets, texte ou binaire, nom du fichier. Exemple de sortie : 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Notez qu'un fichier binaire peut parfois être considéré à tord comme un fichier texte. Voyez aussi l'option "-s". Des fanions facultatifs peuvent être ajoutés pour changer la sortie. Un ou plusieurs fanions peuvent être ajoutés. d Affiche le nombre de sauts de ligne DOS. u Affiche le nombre de sauts de ligne Unix. m Affiche le nombre de sauts de ligne Mac. b Afficher la marque d'ordre des octets. t Affiche si le fichier est texte ou binaire. c Affiche uniquement les fichiers qui seraient convertis. Avec le fanion "c", dos2unix n'affichera que les fichiers contenant des sauts de ligne DOS alors que unix2dos n'affichera que les noms des fichiers aillant des sauts de ligne Unix. h Afficher un en-tête. p Montrer les noms des fichiers sans le chemin. Exemples: Afficher les informations pour tous les fichier *.txt : dos2unix -i *.txt Afficher uniquement le nombre de sauts de ligne DOS et Unix : dos2unix -idu *.txt Montrer uniquement la marque d'ordre des octets : dos2unix --info=b *.txt Liste les fichiers qui ont des sauts de ligne DOS : dos2unix -ic *.txt Liste les fichiers qui ont des sauts de ligne Unix : unix2dos -ic *.txt Ne converti que les fichiers qui ont des sauts de lignes DOS et laisse les autres fichiers inchangés: dos2unix -ic *.txt | xargs dos2unix Trouve les fichiers texte qui ont des sauts de ligne DOS : find -name '*.txt' | xargs dos2unix -ic -k, --keepdate La date du fichier de sortie est la même que celle du fichier d'entrée. -L, --license Affiche la licence du programme. -l, --newline Ajoute des sauts de lignes additionnels. dos2unix: Seuls les sauts de lignes du DOS sont changés en deux sauts de lignes de Unix. En mode Mac, seuls les sauts de lignes Mac sont changés en deux sauts de lignes Unix. unix2dos: Seuls les sauts de lignes Unix sont changés en deux sauts de lignes du DOS. En mode Mac, les sauts de lignes Unix sont remplacés par deux sauts de lignes Mac. -m, --add-bom Écrit une marque d'ordre des octets (BOM) dans le fichier de sortie. Par défaut une BOM UTF-8 est écrite. Lorsque le fichier d'entrée est en UTF-16 et que l'option "-u" est utilisée, une BOM UTF-16 est écrite. N'utilisez jamais cette option quand l'encodage du fichier de sortie n'est ni UTF-8 ni UTF-16 ni GB18030. Consultez également la section UNICODE. -n, --newfile FICHIER_ENTRÉE FICHIER_SORTIE … Nouveau mode de fichiers. Convertit le fichier FICHER_ENTRÉE et écrit la sortie dans le fichier FICHIER_SORTIE. Les noms des fichiers doivent être indiqués par paires. Les jokers *ne* doivent *pas* être utilisés ou vous *perdrez* vos fichiers. La personne qui démarre la conversion dans le nouveau mode (pairé) des fichiers sera le propriétaire du fichier converti. Les permissions de lecture/écriture du nouveau fichier seront les permissions du fichier original moins le umask(1) de la personne qui exécute la conversion. -o, --oldfile FICHIER … Ancien mode de fichiers. Convertit le fichier FICHIER et écrit la sortie dedans. Le programme fonctionne dans ce mode par défaut. Les jokers peuvent être utilisés. Dans l'ancien mode (en place) des fichiers, les fichiers convertis ont le même propriétaire, groupe et permissions lecture/écriture que le fichier original. Idem quand le fichier est converti par un utilisateur qui a la permission d'écrire dans le fichier (par exemple, root). La conversion est interrompue si il n'est pas possible de conserver les valeurs d'origine. Le changement de propriétaire pourrait signifier que le propriétaire original n'est plus en mesure de lire le fichier. Le changement de groupe pourrait être un risque pour la sécurité. Le fichier pourrait être rendu accessible en lecture par des personnes à qui il n'est pas destiné. La conservation du propriétaire, du groupe et des permissions de lecture/écriture n'est supportée que sous Unix. -q, --quiet Mode silencieux. Supprime les avertissements et les messages. La valeur de sortie est zéro sauf quand de mauvaises options sont utilisées sur la ligne de commande. -r, --remove-bom Supprime la marque d'ordre des octets (BOM). N'écrit pas la BOM dans le fichier de sortie. Ceci est le comportement par défaut lorsque les sauts de lignes sont convertis au format Unix. Consultez aussi l'option "-b". -s, --safe Ignore les fichiers binaires (par défaut). Ignorer les fichiers binaires sert à éviter les erreurs accidentelles. Attention que la détection de fichiers binaires n'est pas fiable à 100%. Les fichiers en entrée sont analysés pour y trouver des symboles binaires qui ne sont habituellement pas rencontrés dans des fichiers textes. Il est cependant possible qu'un fichier binaire ne contienne que des caractères textes normaux. Un tel fichier serait erronément traité comme un fichier texte. -u, --keep-utf16 Conserve l'encodage UTF-16 original du fichier d'entrée. Le fichier de sortie sera écrit dans le même encodage UTF-16 (petit ou grand boutien) que le fichier d'entrée. Ceci évite la transformation en UTF-8. Une BOM UTF-16 sera écrite en conséquent. Cette option peut être désactivée avec l'option "-ascii". -ul, --assume-utf16le Suppose que le fichier d'entrée est au format UTF-16LE. Quand il y a un indicateur d'ordre des octets dans le fichier d'entrée, l'indicateur a priorité sur cette option. Si vous vous êtes trompé sur le format du fichier d'entrée (par exemple, ce n'était pas un fichier UTF16-LE) et que la conversion réussi, vous obtiendrez un fichier UTF-8 contenant le mauvais texte. Vous pouvez récupérer le fichier original avec iconv(1) en convertissant le fichier de sortie UTF-8 vers du UTF-16LE. La présupposition de l'UTF-16LE fonctionne comme un *mode de conversion*. En utilisant le mode *ascii* par défaut, UTF-16LE n'est plus présupposé. -ub, --assume-utf16be Suppose que le fichier d'entrée est au format UTF-16BE. Cette option fonctionne comme l'option "-ul". -v, --verbose Affiche des messages verbeux. Des informations supplémentaires sont affichées à propos des marques d'ordre des octets et du nombre de sauts de lignes convertis. -F, --follow-symlink Suit les liens symboliques et convertit les cibles. -R, --replace-symlink Remplace les liens symboliques par les fichiers convertis (les fichiers cibles originaux restent inchangés). -S, --skip-symlink Ne change pas les liens symboliques ni les cibles (par défaut). -V, --version Affiche les informations de version puis arrête. MODE MAC En mode normal, les sauts de lignes sont convertis du DOS vers Unix et inversement. Les sauts de lignes Mac ne sont pas convertis. En mode Mac, les sauts de lignes sont convertis du format Mac au format Unix et inversement. Les sauts de lignes DOS ne sont pas changés. Pour fonctionner en mode Mac, utilisez l'option en ligne de commande "-c mac" ou utilisez les commandes "mac2unix" ou "unix2mac". MODES DE CONVERSION ascii En mode "ascii", seuls les sauts de lignes sont convertis. Ceci est le mode de conversion par défaut. Bien que le nom de ce mode soit ASCII, qui est un standard 7 bits, ce mode travail en réalité sur 8 bits. Utilisez toujours ce mode lorsque vous convertissez des fichiers Unicode UTF-8. 7bit Dans ce mode, tous les caractères 8 bits non ASCII (avec des valeurs entre 128 et 255) sont remplacés par une espace 7 bits. iso Les caractères sont convertis entre un jeu de caractères DOS (code page) et le jeu de caractères ISO-8859-1 (Latin-1) de Unix. Les caractères DOS sans équivalent ISO-8859-1, pour lesquels la conversion n'est pas possible, sont remplacés par un point. La même chose est valable pour les caractères ISO-8859-1 sans équivalent DOS. Quand seule l'option "-iso" est utilisée, dos2unix essaie de déterminer le code page actif. Quand ce n'est pas possible, dos2unix utilise le code page CP437 par défaut qui est surtout utilisé aux USA. Pour forcer l'utilisation d'un code page spécifique, utilisez les options -437 (US), -850 (Europe de l'ouest), -860 (portugais), -863 (français canadien) ou -865 (nordique). Le code page CP1252 de Windows (Europe de l'ouest) est également supporté avec l'option -1252. Pour d'autres codes pages, utilisez dos2unix avec iconv(1). Iconv supporte une longue liste de codages de caractères. N'utilisez jamais la conversion ISO sur des fichiers textes Unicode. Cela va corrompre les fichiers encodés en UTF-8. Quelques exemples: Convertir du code page par défaut du DOS au Latin-1 Unix : dos2unix -iso -n entrée.txt sortie.txt Convertir du CP850 du DOS au Latin-1 Unix : dos2unix -850 -n entrée.txt sortie.txt Convertir du CP1252 de Windows au Latin-1 de Unix : dos2unix -1252 -n entrée.txt sortie.txt Convertir le CP1252 de Windows en UTF-8 de Unix (Unicode) : iconv -f CP1252 -t UTF-8 entrée.txt | dos2unix > sortie.txt Convertir du Latin-1 de Unix au code page par défaut de DOS : unix2dos -iso -n entrée.txt sortie.txt Convertir le Latin-1 de Unix en CP850 du DOS : unix2dos -850 -n entrée.txt sortie.txt Convertir le Latin-1 de Unix en CP1252 de Windows : unix2dos -1252 -n entrée.txt sortie.txt Convertir le UTF-8 de Unix (Unicode) en CP1252 de Windows : unix2dos < entrée.txt | iconv -f UTF-8 -t CP1252 > sortie.txt Consultez aussi et . UNICODE Codages Il existe plusieurs codages Unicode. Sous Unix et Linux, les fichiers sont généralement codés en UTF-8. Sous Windows, les fichiers textes Unicode peuvent être codés en UTF-8, UTF-16 ou UTF-16 gros boutien mais ils sont majoritairement codés au format UTF-16. Conversion Les fichiers textes Unicode peuvent avoir des sauts de lignes DOS, Unix ou Mac, tout comme les fichiers textes normaux. Toutes les versions de dos2unix et unix2dos peuvent convertir des fichiers codés en UTF-8 car UTF-8 a été conçu pour être rétro-compatible avec l'ASCII. Dos2unix et unix2dos, avec le support pour l'Unicode UTF-16, peuvent lire les fichiers textes codés sous forme petit boutien ou gros boutien. Pour savoir si dos2unix a été compilé avec le support UTF-16 tapez "dos2unix -V". Sous Unix/Linux, les fichiers encodés en UTF-16 sont convertis vers l'encodage des caractères de la localisation. Utilisez locale(1) pour découvrir quel encodage de caractères est utilisé. Lorsque la conversion n'est pas possible, une erreur de conversion est produite et le fichier est abandonné. Sous Windows, les fichiers UTF-16 sont convertis par défaut en UTF-8. Les fichiers textes formatés en UTF-8 sont bien supportés sous Windows et Unix/Linux. Les codages UTF-16 et UTF-8 sont parfaitement compatibles. Il n'y a pas de pertes lors de la conversion. Lorsqu'une erreur de conversion UTF-16 vers UTF-8 survient, par exemple, quand le fichier d'entrée UTF-16 contient une erreur, le fichier est ignoré. Quand l'option "-u" est utilisée, le fichier de sortie est écrit dans le même encodage UTF-16 que le fichier d'entrée. L'option "-u" empêche la conversion en UTF-8. Dos2unix et unix2dos n'ont pas d'option pour convertir des fichiers UTF-8 en UTF-16. Les modes de conversion ISO et 7 bits ne fonctionnent pas sur des fichiers UTF-16. Marque d'ordre des octets Les fichiers textes Unicode sous Windows on généralement un indicateur d'ordre des octets (BOM) car de nombreux programmes Windows (y compris Notepad) ajoutent cet indicateur par défaut. Consultez aussi . Sous Unix, les fichiers Unicodes n'ont habituellement pas de BOM. Il est supposé que les fichiers textes sont codés selon le codage de l'environnement linguistique. Dos2unix ne peut détecter que le fichier est au format UTF-16 si le fichier n'a pas de BOM. Quand le fichier UTF-16 n'a pas cet indicateur, dos2unix voit le fichier comme un fichier binaire. Utilisez l'option "-ul" ou "-ub" pour convertir un fichier UTF-16 sans BOM. Dos2unix, par défaut, n'écrit pas de BOM dans le fichier de sortie. Avec l'option "-b", Dos2unix écrit une BOM quand le fichier d'entrée a une BOM. Unix2dos écrit par défaut une BOM dans le fichier de sortie quand le fichier d'entrée a une BOM. Utilisez l'option "-r" pour supprimer la BOM. Dos2unix et unix2dos écrivent toujours une BOM quand l'option "-m" est utilisée. Noms de fichiers unicode sous Windows Dos2unix supporte, en option, la lecture et l'écriture de noms de fichiers Unicode dans la ligne de commande de Windows. Cela signifie que dos2unix peut ouvrir des fichiers qui ont, dans leur nom, des caractères n'appartenant pas au code page système ANSI par défaut. Pour voir si dos2unix pour Windows a été compilé avec le support des noms de fichiers Unicode, tapez "dos2unix -V". Il y a quelques soucis avec l'affichage de noms de fichiers Unicode dans une console Windows. Voyez l'option "-D", "--display-enc". Les noms de fichiers peuvent être mal affichés dans la console mais les fichiers seront écrits avec les bons noms. Exemples Unicode Convertir de l'UTF-16 Windows (avec BOM) vers l'UTF-8 de Unix : dos2unix -n entrée.txt sortie.txt Convertir de l'UTF-16LE de Windows (sans BOM) vers l'UTF-8 de Unix : dos2unix -ul -n entrée.txt sortie.txt Convertir de l'UTF-8 de Unix vers l'UTF-8 de Windows avec BOM : unix2dos -m -n entrée.txt sortie.txt Convertir de l'UTF-8 de Unix vers l'UTF-16 de Windows : unix2dos < entrée.txt | iconv -f UTF-8 -t UTF-16 > sortie.txt GB18030 GB18030 est un standard du gouvernement chinois. Tout logiciel vendu en Chine doit officiellement supporter un sous ensemble obligatoire du standard GB18030. Consultez . GB18030 est entièrement compatible avec Unicode et peut être considéré comme étant un format de transformation unicode. Comme UTF-8, GB18030 est compatible avec ASCII. GB18030 est aussi compatible avec le code page 936 de Windows aussi connu comme GBK. Sous Unix/Linux, les fichiers UTF-16 sont convertis en GB18030 quand l'encodage de l'environnement linguistique est GB18030. Notez que cela ne fonctionnera que si l'environnement linguistique est supporté par le système. Utilisez la commande "locale -a" pour obtenir la liste des environnements linguistiques supportés. Sous Windows, vous avez besoin de l'option "-gb" pour convertir UTF-16 en GB18030. Les fichiers encodés en GB18030 peuvent avoir une marque d'ordre des octets, comme les fichiers Unicode. EXEMPLES Lire l'entrée depuis « stdin » et écrire la sortie vers « stdout » : dos2unix < a.txt cat a.txt | dos2unix Convertir et remplacer a.txt. Convertir et remplace b.txt : dos2unix a.txt b.txt dos2unix -o a.txt b.txt Convertir et remplacer a.txt en mode de conversion ascii : dos2unix a.txt Convertir et remplacer a.txt en mode de conversion ascii. Convertir et remplacer b.txt en mode de conversion 7 bits : dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Convertir a.txt depuis le format Mac vers le format Unix : dos2unix -c mac a.txt mac2unix a.txt Convertir a.txt du format Unix au format Mac : unix2dos -c mac a.txt unix2mac a.txt Convertir et remplacer a.txt tout en conservant la date originale : dos2unix -k a.txt dos2unix -k -o a.txt Convertir a.txt et écrire dans e.txt : dos2unix -n a.txt e.txt Convertir a.txt et écrire dans e.txt. La date de e.txt est la même que celle de a.txt : dos2unix -k -n a.txt e.txt Convertir et remplacer a.txt. Convertir b.txt et écrire dans e.txt : dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Convertir c.txt et écrire dans e.txt. Convertir et remplacer a.txt. Convertir et remplacer b.txt. Convertir d.txt et écrire dans f.txt : dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt CONVERSIONS RÉCURSIVES Utilisez dos2unix avec les commandes find(1) et xargs(1) pour convertir récursivement des fichiers textes dans une arborescence de répertoires. Par exemple, pour convertir tous les fichiers .txt dans les répertoires sous le répertoire courant, tapez: find . -name '*.txt' |xargs dos2unix En ligne de commande sous Windows, la commande suivante peut être utilisée : for /R %G in (*.txt) do dos2unix "%G" find /R %G in Les utilisateurs de PowerShell peuvent utiliser la commande suivante dans le PowerShell de Windows : get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} PARAMÈTRES LINGUISTIQUES LANG La langue principale est sélectionnée par la variable d'environnement LANG. La variable LANG est composée de plusieurs parties. La première partie est le code de la langue en minuscules. La deuxième partie est le code du pays en majuscules précédé d'un souligné. Elle est facultative. Il y a aussi une troisième partie facultative qui est le codage des caractères précédé par un point. Voici quelques exemples pour un shell au standard POSIX: export LANG=fr Français export LANG=fr_CA Français, Canada export LANG=fr_BE Français, Belgique export LANG=es_ES Espagnol, Espagne export LANG=es_MX Espagnol, Mexique export LANG=en_US.iso88591 Anglais, USA, codage Latin-1 export LANG=en_GB.UTF-8 Anglais, UK, codage UTF-8 La liste complète des codes de langues et de pays est dans le manuel de gettext: Sur les systèmes Unix, vous pouvez utiliser la commande locale(1) pour obtenir des informations sur l'environnement linguistique. LANGUE Avec la variable d'environnement LANGUAGE, vous pouvez spécifier une liste de langues prioritaires séparées par des deux-points. Dos2unix fait passer LANGUAGE avant LANG. Par exemple, pour utiliser le français avant l'anglais: "LANGUAGE=fr:en". Vous devez d'abord activer l'environnement linguistique en assignant une valeur autre que « C » à LANG (ou LC_ALL). Ensuite, vous pourrez utiliser la liste de priorité avec la variable LANGUAGE. Voyez également le manuel de gettext: Si vous sélectionnez une langue qui n'est pas disponible, vous obtiendrez des messages en anglais standard. DOS2UNIX_LOCALEDIR Grâce à la variable d'environnement DOS2UNIX_LOCALEDIR, la variable LOCALEDIR compilée dans l'application peut être remplacée. LOCALEDIR est utilisée pour trouver les fichiers de langue. La valeur par défaut de GNU est "/usr/local/share/locale". L'option --version affiche la valeur de LOCALEDIR utilisée. Exemple (shell POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale VALEUR DE RETOUR Zéro est retourné en cas de succès. Si une erreur système se produit, la dernière erreur système est retournée. Pour les autres erreurs, 1 est renvoyé. La valeur de sortie est toujours zéro en mode silencieux sauf quand de mauvaises options sont utilisées sur la ligne de commande. STANDARDS AUTEURS Benjamin Lin - , Bernd Johannes Wuebben (mode mac2unix) - , Christian Wurll (ajout de saut de ligne supplémentaire) - , Erwin Waterlander - (Mainteneur) Page du projet: Page SourceForge: VOIR AUSSI file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/man1/0000755000175500010010000000000012721132571014157 5ustar waterlanGeendos2unix-7.3.4/man/man1/dos2unix.10000644000175500010010000007561312721132553016030 0ustar waterlanGeen.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dos2unix 1" .TH dos2unix 1 "2016-05-24" "dos2unix" "2016-05-24" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" dos2unix \- DOS/Mac to Unix and vice versa text file format converter .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& dos2unix [options] [FILE ...] [\-n INFILE OUTFILE ...] \& unix2dos [options] [FILE ...] [\-n INFILE OUTFILE ...] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The Dos2unix package includes utilities \f(CW\*(C`dos2unix\*(C'\fR and \f(CW\*(C`unix2dos\*(C'\fR to convert plain text files in \s-1DOS\s0 or Mac format to Unix format and vice versa. .PP In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (\s-1CR\s0) followed by a Line Feed (\s-1LF\s0). In Unix text files a line break is a single character: the Line Feed (\s-1LF\s0). In Mac text files, prior to Mac \s-1OS X,\s0 a line break was single Carriage Return (\s-1CR\s0) character. Nowadays Mac \s-1OS\s0 uses Unix style (\s-1LF\s0) line breaks. .PP Besides line breaks Dos2unix can also convert the encoding of files. A few \&\s-1DOS\s0 code pages can be converted to Unix Latin\-1. And Windows Unicode (\s-1UTF\-16\s0) files can be converted to Unix Unicode (\s-1UTF\-8\s0) files. .PP Binary files are automatically skipped, unless conversion is forced. .PP Non-regular files, such as directories and FIFOs, are automatically skipped. .PP Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows. .PP Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options \f(CW\*(C`\-o\*(C'\fR and \f(CW\*(C`\-n\*(C'\fR. Another difference is that the SunOS/Solaris version uses by default \fIiso\fR mode conversion while this version uses by default \fIascii\fR mode conversion. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-\fR" 4 .IX Item "--" Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named \*(L"\-foo\*(R", you can use this command: .Sp .Vb 1 \& dos2unix \-\- \-foo .Ve .Sp Or in new file mode: .Sp .Vb 1 \& dos2unix \-n \-\- \-foo out.txt .Ve .IP "\fB\-ascii\fR" 4 .IX Item "-ascii" Convert only line breaks. This is the default conversion mode. .IP "\fB\-iso\fR" 4 .IX Item "-iso" Conversion between \s-1DOS\s0 and \s-1ISO\-8859\-1\s0 character set. See also section \&\s-1CONVERSION MODES.\s0 .IP "\fB\-1252\fR" 4 .IX Item "-1252" Use Windows code page 1252 (Western European). .IP "\fB\-437\fR" 4 .IX Item "-437" Use \s-1DOS\s0 code page 437 (\s-1US\s0). This is the default code page used for \s-1ISO\s0 conversion. .IP "\fB\-850\fR" 4 .IX Item "-850" Use \s-1DOS\s0 code page 850 (Western European). .IP "\fB\-860\fR" 4 .IX Item "-860" Use \s-1DOS\s0 code page 860 (Portuguese). .IP "\fB\-863\fR" 4 .IX Item "-863" Use \s-1DOS\s0 code page 863 (French Canadian). .IP "\fB\-865\fR" 4 .IX Item "-865" Use \s-1DOS\s0 code page 865 (Nordic). .IP "\fB\-7\fR" 4 .IX Item "-7" Convert 8 bit characters to 7 bit space. .IP "\fB\-b, \-\-keep\-bom\fR" 4 .IX Item "-b, --keep-bom" Keep Byte Order Mark (\s-1BOM\s0). When the input file has a \s-1BOM,\s0 write a \s-1BOM\s0 in the output file. This is the default behavior when converting to \s-1DOS\s0 line breaks. See also option \f(CW\*(C`\-r\*(C'\fR. .IP "\fB\-c, \-\-convmode \s-1CONVMODE\s0\fR" 4 .IX Item "-c, --convmode CONVMODE" Set conversion mode. Where \s-1CONVMODE\s0 is one of: \&\fIascii\fR, \fI7bit\fR, \fIiso\fR, \fImac\fR with ascii being the default. .IP "\fB\-D, \-\-display\-enc \s-1ENCODING\s0\fR" 4 .IX Item "-D, --display-enc ENCODING" Set encoding of displayed text. Where \s-1ENCODING\s0 is one of: \&\fIansi\fR, \fIunicode\fR, \fIunicodebom\fR, \fIutf8\fR, \fIutf8bom\fR with ansi being the default. .Sp This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed. .Sp There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages. .RS 4 .IP "\fBansi\fR" 4 .IX Item "ansi" Dos2unix's default method is to use \s-1ANSI\s0 encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active \s-1DOS OEM\s0 code page to the Windows system \s-1ANSI\s0 code page using the \f(CW\*(C`chcp\*(C'\fR command, because dos2unix uses the Windows system code page. .Sp The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is \s-1OK.\s0 .IP "\fBunicode, unicodebom\fR" 4 .IX Item "unicode, unicodebom" The advantage of unicode (the Windows name for \s-1UTF\-16\s0) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it. .Sp When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font. .Sp The disadvantage of unicode is that it is not compatible with \s-1ASCII.\s0 The output is not easy to handle when you redirect it to another program. .Sp When method \f(CW\*(C`unicodebom\*(C'\fR is used the Unicode text will be preceded with a \s-1BOM \&\s0(Byte Order Mark). A \s-1BOM\s0 is required for correct redirection or piping in PowerShell. .IP "\fButf8, utf8bom\fR" 4 .IX Item "utf8, utf8bom" The advantage of utf8 is that it is compatible with \s-1ASCII.\s0 You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the \f(CW\*(C`unicode\*(C'\fR encoding. .Sp The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed. .Sp In a ConEmu console the utf8 encoding method works well. .Sp When method \f(CW\*(C`utf8bom\*(C'\fR is used the \s-1UTF\-8\s0 text will be preceded with a \s-1BOM \&\s0(Byte Order Mark). A \s-1BOM\s0 is required for correct redirection or piping in PowerShell. .RE .RS 4 .Sp The default encoding can be changed with environment variable \s-1DOS2UNIX_DISPLAY_ENC\s0 by setting it to \f(CW\*(C`unicode\*(C'\fR, \f(CW\*(C`unicodebom\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR, or \f(CW\*(C`utf8bom\*(C'\fR. .RE .IP "\fB\-f, \-\-force\fR" 4 .IX Item "-f, --force" Force conversion of binary files. .IP "\fB\-gb, \-\-gb18030\fR" 4 .IX Item "-gb, --gb18030" On Windows \s-1UTF\-16\s0 files are by default converted to \s-1UTF\-8,\s0 regardless of the locale setting. Use this option to convert \s-1UTF\-16\s0 files to \s-1GB18030.\s0 This option is only available on Windows. See also section \s-1GB18030.\s0 .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Display help and exit. .IP "\fB\-i[\s-1FLAGS\s0], \-\-info[=FLAGS] \s-1FILE ...\s0\fR" 4 .IX Item "-i[FLAGS], --info[=FLAGS] FILE ..." Display file information. No conversion is done. .Sp The following information is printed, in this order: number of \s-1DOS\s0 line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name. .Sp Example output: .Sp .Vb 8 \& 6 0 0 no_bom text dos.txt \& 0 6 0 no_bom text unix.txt \& 0 0 6 no_bom text mac.txt \& 6 6 6 no_bom text mixed.txt \& 50 0 0 UTF\-16LE text utf16le.txt \& 0 50 0 no_bom text utf8unix.txt \& 50 0 0 UTF\-8 text utf8dos.txt \& 2 418 219 no_bom binary dos2unix.exe .Ve .Sp Note that sometimes a binary file can be mistaken for a text file. See also option \f(CW\*(C`\-s\*(C'\fR. .Sp Optionally extra flags can be set to change the output. One or more flags can be added. .RS 4 .IP "\fBd\fR" 4 .IX Item "d" Print number of \s-1DOS\s0 line breaks. .IP "\fBu\fR" 4 .IX Item "u" Print number of Unix line breaks. .IP "\fBm\fR" 4 .IX Item "m" Print number of Mac line breaks. .IP "\fBb\fR" 4 .IX Item "b" Print the byte order mark. .IP "\fBt\fR" 4 .IX Item "t" Print if file is text or binary. .IP "\fBc\fR" 4 .IX Item "c" Print only the files that would be converted. .Sp With the \f(CW\*(C`c\*(C'\fR flag dos2unix will print only the files that contain \s-1DOS\s0 line breaks, unix2dos will print only file names that have Unix line breaks. .IP "\fBh\fR" 4 .IX Item "h" Print a header. .IP "\fBp\fR" 4 .IX Item "p" Show file names without path. .RE .RS 4 .Sp Examples: .Sp Show information for all *.txt files: .Sp .Vb 1 \& dos2unix \-i *.txt .Ve .Sp Show only the number of \s-1DOS\s0 line breaks and Unix line breaks: .Sp .Vb 1 \& dos2unix \-idu *.txt .Ve .Sp Show only the byte order mark: .Sp .Vb 1 \& dos2unix \-\-info=b *.txt .Ve .Sp List the files that have \s-1DOS\s0 line breaks: .Sp .Vb 1 \& dos2unix \-ic *.txt .Ve .Sp List the files that have Unix line breaks: .Sp .Vb 1 \& unix2dos \-ic *.txt .Ve .Sp Convert only files that have \s-1DOS\s0 line breaks and leave the other files untouched: .Sp .Vb 1 \& dos2unix \-ic *.txt | xargs dos2unix .Ve .Sp Find text files that have \s-1DOS\s0 line breaks: .Sp .Vb 1 \& find \-name \*(Aq*.txt\*(Aq | xargs dos2unix \-ic .Ve .RE .IP "\fB\-k, \-\-keepdate\fR" 4 .IX Item "-k, --keepdate" Keep the date stamp of output file same as input file. .IP "\fB\-L, \-\-license\fR" 4 .IX Item "-L, --license" Display program's license. .IP "\fB\-l, \-\-newline\fR" 4 .IX Item "-l, --newline" Add additional newline. .Sp \&\fBdos2unix\fR: Only \s-1DOS\s0 line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks. .Sp \&\fBunix2dos\fR: Only Unix line breaks are changed to two \s-1DOS\s0 line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks. .IP "\fB\-m, \-\-add\-bom\fR" 4 .IX Item "-m, --add-bom" Write a Byte Order Mark (\s-1BOM\s0) in the output file. By default an \s-1UTF\-8 BOM\s0 is written. .Sp When the input file is \s-1UTF\-16,\s0 and the option \f(CW\*(C`\-u\*(C'\fR is used, an \s-1UTF\-16 BOM\s0 will be written. .Sp Never use this option when the output encoding is other than \s-1UTF\-8, UTF\-16,\s0 or \&\s-1GB18030.\s0 See also section \s-1UNICODE.\s0 .IP "\fB\-n, \-\-newfile \s-1INFILE OUTFILE ...\s0\fR" 4 .IX Item "-n, --newfile INFILE OUTFILE ..." New file mode. Convert file \s-1INFILE\s0 and write output to file \s-1OUTFILE.\s0 File names must be given in pairs and wildcard names should \fInot\fR be used or you \fIwill\fR lose your files. .Sp The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the \fIumask\fR\|(1) of the person who runs the conversion. .IP "\fB\-o, \-\-oldfile \s-1FILE ...\s0\fR" 4 .IX Item "-o, --oldfile FILE ..." Old file mode. Convert file \s-1FILE\s0 and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used. .Sp In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix. .IP "\fB\-q, \-\-quiet\fR" 4 .IX Item "-q, --quiet" Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used. .IP "\fB\-r, \-\-remove\-bom\fR" 4 .IX Item "-r, --remove-bom" Remove Byte Order Mark (\s-1BOM\s0). Do not write a \s-1BOM\s0 in the output file. This is the default behavior when converting to Unix line breaks. See also option \f(CW\*(C`\-b\*(C'\fR. .IP "\fB\-s, \-\-safe\fR" 4 .IX Item "-s, --safe" Skip binary files (default). .Sp The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file. .IP "\fB\-u, \-\-keep\-utf16\fR" 4 .IX Item "-u, --keep-utf16" Keep the original \s-1UTF\-16\s0 encoding of the input file. The output file will be written in the same \s-1UTF\-16\s0 encoding, little or big endian, as the input file. This prevents transformation to \s-1UTF\-8.\s0 An \s-1UTF\-16 BOM\s0 will be written accordingly. This option can be disabled with the \f(CW\*(C`\-ascii\*(C'\fR option. .IP "\fB\-ul, \-\-assume\-utf16le\fR" 4 .IX Item "-ul, --assume-utf16le" Assume that the input file format is \s-1UTF\-16LE.\s0 .Sp When there is a Byte Order Mark in the input file the \s-1BOM\s0 has priority over this option. .Sp When you made a wrong assumption (the input file was not in \s-1UTF\-16LE\s0 format) and the conversion succeeded, you will get an \s-1UTF\-8\s0 output file with wrong text. You can undo the wrong conversion with \fIiconv\fR\|(1) by converting the \s-1UTF\-8\s0 output file back to \s-1UTF\-16LE.\s0 This will bring back the original file. .Sp The assumption of \s-1UTF\-16LE\s0 works as a \fIconversion mode\fR. By switching to the default \&\fIascii\fR mode the \s-1UTF\-16LE\s0 assumption is turned off. .IP "\fB\-ub, \-\-assume\-utf16be\fR" 4 .IX Item "-ub, --assume-utf16be" Assume that the input file format is \s-1UTF\-16BE.\s0 .Sp This option works the same as option \f(CW\*(C`\-ul\*(C'\fR. .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks. .IP "\fB\-F, \-\-follow\-symlink\fR" 4 .IX Item "-F, --follow-symlink" Follow symbolic links and convert the targets. .IP "\fB\-R, \-\-replace\-symlink\fR" 4 .IX Item "-R, --replace-symlink" Replace symbolic links with converted files (original target files remain unchanged). .IP "\fB\-S, \-\-skip\-symlink\fR" 4 .IX Item "-S, --skip-symlink" Keep symbolic links and targets unchanged (default). .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" Display version information and exit. .SH "MAC MODE" .IX Header "MAC MODE" In normal mode line breaks are converted from \s-1DOS\s0 to Unix and vice versa. Mac line breaks are not converted. .PP In Mac mode line breaks are converted from Mac to Unix and vice versa. \s-1DOS\s0 line breaks are not changed. .PP To run in Mac mode use the command-line option \f(CW\*(C`\-c mac\*(C'\fR or use the commands \f(CW\*(C`mac2unix\*(C'\fR or \f(CW\*(C`unix2mac\*(C'\fR. .SH "CONVERSION MODES" .IX Header "CONVERSION MODES" .IP "\fBascii\fR" 4 .IX Item "ascii" In mode \f(CW\*(C`ascii\*(C'\fR only line breaks are converted. This is the default conversion mode. .Sp Although the name of this mode is \s-1ASCII,\s0 which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode \s-1UTF\-8\s0 files. .IP "\fB7bit\fR" 4 .IX Item "7bit" In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space. .IP "\fBiso\fR" 4 .IX Item "iso" Characters are converted between a \s-1DOS\s0 character set (code page) and \s-1ISO\s0 character set \s-1ISO\-8859\-1 \s0(Latin\-1) on Unix. \s-1DOS\s0 characters without \s-1ISO\-8859\-1\s0 equivalent, for which conversion is not possible, are converted to a dot. The same counts for \s-1ISO\-8859\-1\s0 characters without \s-1DOS\s0 counterpart. .Sp When only option \f(CW\*(C`\-iso\*(C'\fR is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page \s-1CP437,\s0 which is mainly used in the \s-1USA. \s0 To force a specific code page use options \&\f(CW\*(C`\-437\*(C'\fR (\s-1US\s0), \f(CW\*(C`\-850\*(C'\fR (Western European), \f(CW\*(C`\-860\*(C'\fR (Portuguese), \f(CW\*(C`\-863\*(C'\fR (French Canadian), or \f(CW\*(C`\-865\*(C'\fR (Nordic). Windows code page \s-1CP1252 \s0(Western European) is also supported with option \f(CW\*(C`\-1252\*(C'\fR. For other code pages use dos2unix in combination with \fIiconv\fR\|(1). Iconv can convert between a long list of character encodings. .Sp Never use \s-1ISO\s0 conversion on Unicode text files. It will corrupt \s-1UTF\-8\s0 encoded files. .Sp Some examples: .Sp Convert from \s-1DOS\s0 default code page to Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-iso \-n in.txt out.txt .Ve .Sp Convert from \s-1DOS CP850\s0 to Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-850 \-n in.txt out.txt .Ve .Sp Convert from Windows \s-1CP1252\s0 to Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-1252 \-n in.txt out.txt .Ve .Sp Convert from Windows \s-1CP1252\s0 to Unix \s-1UTF\-8 \s0(Unicode): .Sp .Vb 1 \& iconv \-f CP1252 \-t UTF\-8 in.txt | dos2unix > out.txt .Ve .Sp Convert from Unix Latin\-1 to \s-1DOS\s0 default code page: .Sp .Vb 1 \& unix2dos \-iso \-n in.txt out.txt .Ve .Sp Convert from Unix Latin\-1 to \s-1DOS CP850:\s0 .Sp .Vb 1 \& unix2dos \-850 \-n in.txt out.txt .Ve .Sp Convert from Unix Latin\-1 to Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos \-1252 \-n in.txt out.txt .Ve .Sp Convert from Unix \s-1UTF\-8 \s0(Unicode) to Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t CP1252 > out.txt .Ve .Sp See also and . .SH "UNICODE" .IX Header "UNICODE" .SS "Encodings" .IX Subsection "Encodings" There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in \s-1UTF\-8\s0 encoding. On Windows Unicode text files can be encoded in \s-1UTF\-8, UTF\-16,\s0 or \s-1UTF\-16\s0 big endian, but are mostly encoded in \&\s-1UTF\-16\s0 format. .SS "Conversion" .IX Subsection "Conversion" Unicode text files can have \s-1DOS,\s0 Unix or Mac line breaks, like regular text files. .PP All versions of dos2unix and unix2dos can convert \s-1UTF\-8\s0 encoded files, because \&\s-1UTF\-8\s0 was designed for backward compatibility with \s-1ASCII.\s0 .PP Dos2unix and unix2dos with Unicode \s-1UTF\-16\s0 support, can read little and big endian \s-1UTF\-16\s0 encoded text files. To see if dos2unix was built with \s-1UTF\-16\s0 support type \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP On Unix/Linux \s-1UTF\-16\s0 encoded files are converted to the locale character encoding. Use the \fIlocale\fR\|(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped. .PP On Windows \s-1UTF\-16\s0 files are by default converted to \s-1UTF\-8. UTF\-8\s0 formatted text files are well supported on both Windows and Unix/Linux. .PP \&\s-1UTF\-16\s0 and \s-1UTF\-8\s0 encoding are fully compatible, there will no text be lost in the conversion. When an \s-1UTF\-16\s0 to \s-1UTF\-8\s0 conversion error occurs, for instance when the \s-1UTF\-16\s0 input file contains an error, the file will be skipped. .PP When option \f(CW\*(C`\-u\*(C'\fR is used, the output file will be written in the same \s-1UTF\-16\s0 encoding as the input file. Option \f(CW\*(C`\-u\*(C'\fR prevents conversion to \s-1UTF\-8.\s0 .PP Dos2unix and unix2dos have no option to convert \s-1UTF\-8\s0 files to \s-1UTF\-16.\s0 .PP \&\s-1ISO\s0 and 7\-bit mode conversion do not work on \s-1UTF\-16\s0 files. .SS "Byte Order Mark" .IX Subsection "Byte Order Mark" On Windows Unicode text files typically have a Byte Order Mark (\s-1BOM\s0), because many Windows programs (including Notepad) add BOMs by default. See also . .PP On Unix Unicode files typically don't have a \s-1BOM.\s0 It is assumed that text files are encoded in the locale character encoding. .PP Dos2unix can only detect if a file is in \s-1UTF\-16\s0 format if the file has a \s-1BOM.\s0 When an \s-1UTF\-16\s0 file doesn't have a \s-1BOM,\s0 dos2unix will see the file as a binary file. .PP Use option \f(CW\*(C`\-ul\*(C'\fR or \f(CW\*(C`\-ub\*(C'\fR to convert an \s-1UTF\-16\s0 file without \s-1BOM.\s0 .PP Dos2unix writes by default no \s-1BOM\s0 in the output file. With option \f(CW\*(C`\-b\*(C'\fR Dos2unix writes a \s-1BOM\s0 when the input file has a \s-1BOM.\s0 .PP Unix2dos writes by default a \s-1BOM\s0 in the output file when the input file has a \&\s-1BOM.\s0 Use option \f(CW\*(C`\-r\*(C'\fR to remove the \s-1BOM.\s0 .PP Dos2unix and unix2dos write always a \s-1BOM\s0 when option \f(CW\*(C`\-m\*(C'\fR is used. .SS "Unicode file names on Windows" .IX Subsection "Unicode file names on Windows" Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system \s-1ANSI\s0 code page. To see if dos2unix for Windows was built with Unicode file name support type \&\f(CW\*(C`dos2unix \-V\*(C'\fR. .PP There are some issues with displaying Unicode file names in a Windows console. See option \f(CW\*(C`\-D\*(C'\fR, \f(CW\*(C`\-\-display\-enc\*(C'\fR. The file names may be displayed wrongly in the console, but the files will be written with the correct name. .SS "Unicode examples" .IX Subsection "Unicode examples" Convert from Windows \s-1UTF\-16 \s0(with \s-1BOM\s0) to Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-n in.txt out.txt .Ve .PP Convert from Windows \s-1UTF\-16LE \s0(without \s-1BOM\s0) to Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-ul \-n in.txt out.txt .Ve .PP Convert from Unix \s-1UTF\-8\s0 to Windows \s-1UTF\-8\s0 with \s-1BOM:\s0 .PP .Vb 1 \& unix2dos \-m \-n in.txt out.txt .Ve .PP Convert from Unix \s-1UTF\-8\s0 to Windows \s-1UTF\-16:\s0 .PP .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t UTF\-16 > out.txt .Ve .SH "GB18030" .IX Header "GB18030" \&\s-1GB18030\s0 is a Chinese government standard. A mandatory subset of the \s-1GB18030\s0 standard is officially required for all software products sold in China. See also . .PP \&\s-1GB18030\s0 is fully compatible with Unicode, and can be considered an unicode transformation format. Like \s-1UTF\-8, GB18030\s0 is compatible with \s-1ASCII. GB18030\s0 is also compatible with Windows code page 936, also known as \s-1GBK.\s0 .PP On Unix/Linux \s-1UTF\-16\s0 files are converted to \s-1GB18030\s0 when the locale encoding is set to \s-1GB18030.\s0 Note that this will only work if the locale is supported by the system. Use command \f(CW\*(C`locale \-a\*(C'\fR to get the list of supported locales. .PP On Windows you need to use option \f(CW\*(C`\-gb\*(C'\fR to convert \s-1UTF\-16\s0 files to \s-1GB18030.\s0 .PP \&\s-1GB18030\s0 encoded files can have a Byte Order Mark, like Unicode files. .SH "EXAMPLES" .IX Header "EXAMPLES" Read input from 'stdin' and write output to 'stdout': .PP .Vb 2 \& dos2unix < a.txt \& cat a.txt | dos2unix .Ve .PP Convert and replace a.txt. Convert and replace b.txt: .PP .Vb 2 \& dos2unix a.txt b.txt \& dos2unix \-o a.txt b.txt .Ve .PP Convert and replace a.txt in ascii conversion mode: .PP .Vb 1 \& dos2unix a.txt .Ve .PP Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode: .PP .Vb 3 \& dos2unix a.txt \-c 7bit b.txt \& dos2unix \-c ascii a.txt \-c 7bit b.txt \& dos2unix \-ascii a.txt \-7 b.txt .Ve .PP Convert a.txt from Mac to Unix format: .PP .Vb 2 \& dos2unix \-c mac a.txt \& mac2unix a.txt .Ve .PP Convert a.txt from Unix to Mac format: .PP .Vb 2 \& unix2dos \-c mac a.txt \& unix2mac a.txt .Ve .PP Convert and replace a.txt while keeping original date stamp: .PP .Vb 2 \& dos2unix \-k a.txt \& dos2unix \-k \-o a.txt .Ve .PP Convert a.txt and write to e.txt: .PP .Vb 1 \& dos2unix \-n a.txt e.txt .Ve .PP Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt: .PP .Vb 1 \& dos2unix \-k \-n a.txt e.txt .Ve .PP Convert and replace a.txt, convert b.txt and write to e.txt: .PP .Vb 2 \& dos2unix a.txt \-n b.txt e.txt \& dos2unix \-o a.txt \-n b.txt e.txt .Ve .PP Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt: .PP .Vb 1 \& dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt .Ve .SH "RECURSIVE CONVERSION" .IX Header "RECURSIVE CONVERSION" Use dos2unix in combination with the \fIfind\fR\|(1) and \fIxargs\fR\|(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type: .PP .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .PP In a Windows Command Prompt the following command can be used: .PP .Vb 1 \& for /R %G in (*.txt) do dos2unix "%G" .Ve .PP PowerShell users can use the following command in Windows PowerShell: .PP .Vb 1 \& get\-childitem \-path . \-filter \*(Aq*.txt\*(Aq \-recurse | foreach\-object {dos2unix $_.Fullname} .Ve .SH "LOCALIZATION" .IX Header "LOCALIZATION" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" The primary language is selected with the environment variable \s-1LANG.\s0 The \s-1LANG\s0 variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for \s-1POSIX\s0 standard type shells: .Sp .Vb 7 \& export LANG=nl Dutch \& export LANG=nl_NL Dutch, The Netherlands \& export LANG=nl_BE Dutch, Belgium \& export LANG=es_ES Spanish, Spain \& export LANG=es_MX Spanish, Mexico \& export LANG=en_US.iso88591 English, USA, Latin\-1 encoding \& export LANG=en_GB.UTF\-8 English, UK, UTF\-8 encoding .Ve .Sp For a complete list of language and country codes see the gettext manual: .Sp On Unix systems you can use the command \fIlocale\fR\|(1) to get locale specific information. .IP "\fB\s-1LANGUAGE\s0\fR" 4 .IX Item "LANGUAGE" With the \s-1LANGUAGE\s0 environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to \s-1LANGUAGE\s0 over \s-1LANG.\s0 For instance, first Dutch and then German: \f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. You have to first enable localization, by setting \s-1LANG \s0(or \s-1LC_ALL\s0) to a value other than \&\*(L"C\*(R", before you can use a language priority list through the \s-1LANGUAGE\s0 variable. See also the gettext manual: .Sp If you select a language which is not available you will get the standard English messages. .IP "\fB\s-1DOS2UNIX_LOCALEDIR\s0\fR" 4 .IX Item "DOS2UNIX_LOCALEDIR" With the environment variable \s-1DOS2UNIX_LOCALEDIR\s0 the \s-1LOCALEDIR\s0 set during compilation can be overruled. \s-1LOCALEDIR\s0 is used to find the language files. The \s-1GNU\s0 default value is \f(CW\*(C`/usr/local/share/locale\*(C'\fR. Option \fB\-\-version\fR will display the \s-1LOCALEDIR\s0 that is used. .Sp Example (\s-1POSIX\s0 shell): .Sp .Vb 1 \& export DOS2UNIX_LOCALEDIR=$HOME/share/locale .Ve .SH "RETURN VALUE" .IX Header "RETURN VALUE" On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned. .PP The return value is always zero in quiet mode, except when wrong command-line options are used. .SH "STANDARDS" .IX Header "STANDARDS" .PP .PP .PP .SH "AUTHORS" .IX Header "AUTHORS" Benjamin Lin \- , Bernd Johannes Wuebben (mac2unix mode) \- , Christian Wurll (add extra newline) \- , Erwin Waterlander \- (maintainer) .PP Project page: .PP SourceForge page: .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIfile\fR\|(1) \&\fIfind\fR\|(1) \&\fIiconv\fR\|(1) \&\fIlocale\fR\|(1) \&\fIxargs\fR\|(1) dos2unix-7.3.4/man/man1/dos2unix.htm0000644000175500010010000007511412721132572016455 0ustar waterlanGeen dos2unix 7.3.4 - DOS/MAC to UNIX and vice versa text file format converter

NAME

dos2unix - DOS/Mac to Unix and vice versa text file format converter

SYNOPSIS

    dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]
    unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]

DESCRIPTION

The Dos2unix package includes utilities dos2unix and unix2dos to convert plain text files in DOS or Mac format to Unix format and vice versa.

In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks.

Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files.

Binary files are automatically skipped, unless conversion is forced.

Non-regular files, such as directories and FIFOs, are automatically skipped.

Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows.

Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options -o and -n. Another difference is that the SunOS/Solaris version uses by default iso mode conversion while this version uses by default ascii mode conversion.

OPTIONS

--

Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named "-foo", you can use this command:

    dos2unix -- -foo

Or in new file mode:

    dos2unix -n -- -foo out.txt
-ascii

Convert only line breaks. This is the default conversion mode.

-iso

Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES.

-1252

Use Windows code page 1252 (Western European).

-437

Use DOS code page 437 (US). This is the default code page used for ISO conversion.

-850

Use DOS code page 850 (Western European).

-860

Use DOS code page 860 (Portuguese).

-863

Use DOS code page 863 (French Canadian).

-865

Use DOS code page 865 (Nordic).

-7

Convert 8 bit characters to 7 bit space.

-b, --keep-bom

Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option -r.

-c, --convmode CONVMODE

Set conversion mode. Where CONVMODE is one of: ascii, 7bit, iso, mac with ascii being the default.

-D, --display-enc ENCODING

Set encoding of displayed text. Where ENCODING is one of: ansi, unicode, unicodebom, utf8, utf8bom with ansi being the default.

This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed.

There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages.

ansi

Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the chcp command, because dos2unix uses the Windows system code page.

The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK.

unicode, unicodebom

The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it.

When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font.

The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program.

When method unicodebom is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell.

utf8, utf8bom

The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the unicode encoding.

The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed.

In a ConEmu console the utf8 encoding method works well.

When method utf8bom is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell.

The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to unicode, unicodebom, utf8, or utf8bom.

-f, --force

Force conversion of binary files.

-gb, --gb18030

On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030.

-h, --help

Display help and exit.

-i[FLAGS], --info[=FLAGS] FILE ...

Display file information. No conversion is done.

The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name.

Example output:

     6       0       0  no_bom    text    dos.txt
     0       6       0  no_bom    text    unix.txt
     0       0       6  no_bom    text    mac.txt
     6       6       6  no_bom    text    mixed.txt
    50       0       0  UTF-16LE  text    utf16le.txt
     0      50       0  no_bom    text    utf8unix.txt
    50       0       0  UTF-8     text    utf8dos.txt
     2     418     219  no_bom    binary  dos2unix.exe

Note that sometimes a binary file can be mistaken for a text file. See also option -s.

Optionally extra flags can be set to change the output. One or more flags can be added.

d

Print number of DOS line breaks.

u

Print number of Unix line breaks.

m

Print number of Mac line breaks.

b

Print the byte order mark.

t

Print if file is text or binary.

c

Print only the files that would be converted.

With the c flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks.

h

Print a header.

p

Show file names without path.

Examples:

Show information for all *.txt files:

    dos2unix -i *.txt

Show only the number of DOS line breaks and Unix line breaks:

    dos2unix -idu *.txt

Show only the byte order mark:

    dos2unix --info=b *.txt

List the files that have DOS line breaks:

    dos2unix -ic *.txt

List the files that have Unix line breaks:

    unix2dos -ic *.txt

Convert only files that have DOS line breaks and leave the other files untouched:

    dos2unix -ic *.txt | xargs dos2unix

Find text files that have DOS line breaks:

    find -name '*.txt' | xargs dos2unix -ic
-k, --keepdate

Keep the date stamp of output file same as input file.

-L, --license

Display program's license.

-l, --newline

Add additional newline.

dos2unix: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks.

unix2dos: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks.

-m, --add-bom

Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written.

When the input file is UTF-16, and the option -u is used, an UTF-16 BOM will be written.

Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE.

-n, --newfile INFILE OUTFILE ...

New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should not be used or you will lose your files.

The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion.

-o, --oldfile FILE ...

Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used.

In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix.

-q, --quiet

Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used.

-r, --remove-bom

Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option -b.

-s, --safe

Skip binary files (default).

The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file.

-u, --keep-utf16

Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the -ascii option.

-ul, --assume-utf16le

Assume that the input file format is UTF-16LE.

When there is a Byte Order Mark in the input file the BOM has priority over this option.

When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file.

The assumption of UTF-16LE works as a conversion mode. By switching to the default ascii mode the UTF-16LE assumption is turned off.

-ub, --assume-utf16be

Assume that the input file format is UTF-16BE.

This option works the same as option -ul.

-v, --verbose

Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks.

Follow symbolic links and convert the targets.

Replace symbolic links with converted files (original target files remain unchanged).

Keep symbolic links and targets unchanged (default).

-V, --version

Display version information and exit.

MAC MODE

In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted.

In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed.

To run in Mac mode use the command-line option -c mac or use the commands mac2unix or unix2mac.

CONVERSION MODES

ascii

In mode ascii only line breaks are converted. This is the default conversion mode.

Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files.

7bit

In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space.

iso

Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart.

When only option -iso is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options -437 (US), -850 (Western European), -860 (Portuguese), -863 (French Canadian), or -865 (Nordic). Windows code page CP1252 (Western European) is also supported with option -1252. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings.

Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files.

Some examples:

Convert from DOS default code page to Unix Latin-1:

    dos2unix -iso -n in.txt out.txt

Convert from DOS CP850 to Unix Latin-1:

    dos2unix -850 -n in.txt out.txt

Convert from Windows CP1252 to Unix Latin-1:

    dos2unix -1252 -n in.txt out.txt

Convert from Windows CP1252 to Unix UTF-8 (Unicode):

    iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt

Convert from Unix Latin-1 to DOS default code page:

    unix2dos -iso -n in.txt out.txt

Convert from Unix Latin-1 to DOS CP850:

    unix2dos -850 -n in.txt out.txt

Convert from Unix Latin-1 to Windows CP1252:

    unix2dos -1252 -n in.txt out.txt

Convert from Unix UTF-8 (Unicode) to Windows CP1252:

    unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt

See also http://czyborra.com/charsets/codepages.html and http://czyborra.com/charsets/iso8859.html.

UNICODE

Encodings

There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format.

Conversion

Unicode text files can have DOS, Unix or Mac line breaks, like regular text files.

All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII.

Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type dos2unix -V.

On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped.

On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux.

UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped.

When option -u is used, the output file will be written in the same UTF-16 encoding as the input file. Option -u prevents conversion to UTF-8.

Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16.

ISO and 7-bit mode conversion do not work on UTF-16 files.

Byte Order Mark

On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also http://en.wikipedia.org/wiki/Byte_order_mark.

On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding.

Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file.

Use option -ul or -ub to convert an UTF-16 file without BOM.

Dos2unix writes by default no BOM in the output file. With option -b Dos2unix writes a BOM when the input file has a BOM.

Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option -r to remove the BOM.

Dos2unix and unix2dos write always a BOM when option -m is used.

Unicode file names on Windows

Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type dos2unix -V.

There are some issues with displaying Unicode file names in a Windows console. See option -D, --display-enc. The file names may be displayed wrongly in the console, but the files will be written with the correct name.

Unicode examples

Convert from Windows UTF-16 (with BOM) to Unix UTF-8:

    dos2unix -n in.txt out.txt

Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:

    dos2unix -ul -n in.txt out.txt

Convert from Unix UTF-8 to Windows UTF-8 with BOM:

    unix2dos -m -n in.txt out.txt

Convert from Unix UTF-8 to Windows UTF-16:

    unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt

GB18030

GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also http://en.wikipedia.org/wiki/GB_18030.

GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK.

On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command locale -a to get the list of supported locales.

On Windows you need to use option -gb to convert UTF-16 files to GB18030.

GB18030 encoded files can have a Byte Order Mark, like Unicode files.

EXAMPLES

Read input from 'stdin' and write output to 'stdout':

    dos2unix < a.txt
    cat a.txt | dos2unix

Convert and replace a.txt. Convert and replace b.txt:

    dos2unix a.txt b.txt
    dos2unix -o a.txt b.txt

Convert and replace a.txt in ascii conversion mode:

    dos2unix a.txt

Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode:

    dos2unix a.txt -c 7bit b.txt
    dos2unix -c ascii a.txt -c 7bit b.txt
    dos2unix -ascii a.txt -7 b.txt

Convert a.txt from Mac to Unix format:

    dos2unix -c mac a.txt
    mac2unix a.txt

Convert a.txt from Unix to Mac format:

    unix2dos -c mac a.txt
    unix2mac a.txt

Convert and replace a.txt while keeping original date stamp:

    dos2unix -k a.txt
    dos2unix -k -o a.txt

Convert a.txt and write to e.txt:

    dos2unix -n a.txt e.txt

Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:

    dos2unix -k -n a.txt e.txt

Convert and replace a.txt, convert b.txt and write to e.txt:

    dos2unix a.txt -n b.txt e.txt
    dos2unix -o a.txt -n b.txt e.txt

Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt:

    dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt

RECURSIVE CONVERSION

Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type:

    find . -name '*.txt' |xargs dos2unix

In a Windows Command Prompt the following command can be used:

    for /R %G in (*.txt) do dos2unix "%G"

PowerShell users can use the following command in Windows PowerShell:

    get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}

LOCALIZATION

LANG

The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:

    export LANG=nl               Dutch
    export LANG=nl_NL            Dutch, The Netherlands
    export LANG=nl_BE            Dutch, Belgium
    export LANG=es_ES            Spanish, Spain
    export LANG=es_MX            Spanish, Mexico
    export LANG=en_US.iso88591   English, USA, Latin-1 encoding
    export LANG=en_GB.UTF-8      English, UK, UTF-8 encoding

For a complete list of language and country codes see the gettext manual: http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

On Unix systems you can use the command locale(1) to get locale specific information.

LANGUAGE

With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: LANGUAGE=nl:de. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than "C", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

If you select a language which is not available you will get the standard English messages.

DOS2UNIX_LOCALEDIR

With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is /usr/local/share/locale. Option --version will display the LOCALEDIR that is used.

Example (POSIX shell):

    export DOS2UNIX_LOCALEDIR=$HOME/share/locale

RETURN VALUE

On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned.

The return value is always zero in quiet mode, except when wrong command-line options are used.

STANDARDS

http://en.wikipedia.org/wiki/Text_file

http://en.wikipedia.org/wiki/Carriage_return

http://en.wikipedia.org/wiki/Newline

http://en.wikipedia.org/wiki/Unicode

AUTHORS

Benjamin Lin - <blin@socs.uts.edu.au>, Bernd Johannes Wuebben (mac2unix mode) - <wuebben@kde.org>, Christian Wurll (add extra newline) - <wurll@ira.uka.de>, Erwin Waterlander - <waterlan@xs4all.nl> (maintainer)

Project page: http://waterlan.home.xs4all.nl/dos2unix.html

SourceForge page: http://sourceforge.net/projects/dos2unix/

SEE ALSO

file(1) find(1) iconv(1) locale(1) xargs(1)

dos2unix-7.3.4/man/man1/dos2unix.pod0000644000175500010010000006306412721132543016446 0ustar waterlanGeen/* # Copyright and License # # Copyright (C) 2009-2016 Erwin Waterlander # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice in the documentation and/or other materials provided with # the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # Description # # To learn what TOP LEVEL section to use in manual pages, # see POSIX/Susv standard and "Utility Description Defaults" at # http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap01.html#tag_01_11 # # This is manual page in Perl POD format. Read more at # http://perldoc.perl.org/perlpod.html or run command: # # perldoc perlpod | less # # To check the syntax: # # podchecker *.pod # # Create manual page with command: # # pod2man PAGE.N.pod > PAGE.N */ =pod =encoding UTF-8 =head1 NAME dos2unix - DOS/Mac to Unix and vice versa text file format converter =head1 SYNOPSIS dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...] unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...] =head1 DESCRIPTION The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa. In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks. Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files. Binary files are automatically skipped, unless conversion is forced. Non-regular files, such as directories and FIFOs, are automatically skipped. Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows. Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion. =head1 OPTIONS =over 4 =item B<--> Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named "-foo", you can use this command: dos2unix -- -foo Or in new file mode: dos2unix -n -- -foo out.txt =item B<-ascii> Convert only line breaks. This is the default conversion mode. =item B<-iso> Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES. =item B<-1252> Use Windows code page 1252 (Western European). =item B<-437> Use DOS code page 437 (US). This is the default code page used for ISO conversion. =item B<-850> Use DOS code page 850 (Western European). =item B<-860> Use DOS code page 860 (Portuguese). =item B<-863> Use DOS code page 863 (French Canadian). =item B<-865> Use DOS code page 865 (Nordic). =item B<-7> Convert 8 bit characters to 7 bit space. =item B<-b, --keep-bom> Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option C<-r>. =item B<-c, --convmode CONVMODE> Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default. =item B<-D, --display-enc ENCODING> Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default. This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed. There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages. =over 4 =item B Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page. The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK. =item B The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it. When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font. The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program. When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. =item B The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding. The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed. In a ConEmu console the utf8 encoding method works well. When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. =back The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C. =item B<-f, --force> Force conversion of binary files. =item B<-gb, --gb18030> On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030. =item B<-h, --help> Display help and exit. =item B<-i[FLAGS], --info[=FLAGS] FILE ...> Display file information. No conversion is done. The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name. Example output: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>. Optionally extra flags can be set to change the output. One or more flags can be added. =over 4 =item B Print number of DOS line breaks. =item B Print number of Unix line breaks. =item B Print number of Mac line breaks. =item B Print the byte order mark. =item B Print if file is text or binary. =item B Print only the files that would be converted. With the C flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks. =item B Print a header. =item B

Show file names without path. =back Examples: Show information for all *.txt files: dos2unix -i *.txt Show only the number of DOS line breaks and Unix line breaks: dos2unix -idu *.txt Show only the byte order mark: dos2unix --info=b *.txt List the files that have DOS line breaks: dos2unix -ic *.txt List the files that have Unix line breaks: unix2dos -ic *.txt Convert only files that have DOS line breaks and leave the other files untouched: dos2unix -ic *.txt | xargs dos2unix Find text files that have DOS line breaks: find -name '*.txt' | xargs dos2unix -ic =item B<-k, --keepdate> Keep the date stamp of output file same as input file. =item B<-L, --license> Display program's license. =item B<-l, --newline> Add additional newline. B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks. B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks. =item B<-m, --add-bom> Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written. When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM will be written. Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE. =item B<-n, --newfile INFILE OUTFILE ...> New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files. The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion. =item B<-o, --oldfile FILE ...> Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used. In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix. =item B<-q, --quiet> Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used. =item B<-r, --remove-bom> Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option C<-b>. =item B<-s, --safe> Skip binary files (default). The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file. =item B<-u, --keep-utf16> Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the C<-ascii> option. =item B<-ul, --assume-utf16le> Assume that the input file format is UTF-16LE. When there is a Byte Order Mark in the input file the BOM has priority over this option. When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file. The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off. =item B<-ub, --assume-utf16be> Assume that the input file format is UTF-16BE. This option works the same as option C<-ul>. =item B<-v, --verbose> Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks. =item B<-F, --follow-symlink> Follow symbolic links and convert the targets. =item B<-R, --replace-symlink> Replace symbolic links with converted files (original target files remain unchanged). =item B<-S, --skip-symlink> Keep symbolic links and targets unchanged (default). =item B<-V, --version> Display version information and exit. =back =head1 MAC MODE In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted. In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed. To run in Mac mode use the command-line option C<-c mac> or use the commands C or C. =head1 CONVERSION MODES =over 4 =item B In mode C only line breaks are converted. This is the default conversion mode. Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files. =item B<7bit> In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space. =item B Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart. When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings. Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files. Some examples: Convert from DOS default code page to Unix Latin-1: dos2unix -iso -n in.txt out.txt Convert from DOS CP850 to Unix Latin-1: dos2unix -850 -n in.txt out.txt Convert from Windows CP1252 to Unix Latin-1: dos2unix -1252 -n in.txt out.txt Convert from Windows CP1252 to Unix UTF-8 (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Convert from Unix Latin-1 to DOS default code page: unix2dos -iso -n in.txt out.txt Convert from Unix Latin-1 to DOS CP850: unix2dos -850 -n in.txt out.txt Convert from Unix Latin-1 to Windows CP1252: unix2dos -1252 -n in.txt out.txt Convert from Unix UTF-8 (Unicode) to Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt See also L and L. =back =head1 UNICODE =head2 Encodings There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format. =head2 Conversion Unicode text files can have DOS, Unix or Mac line breaks, like regular text files. All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII. Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C. On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped. On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux. UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped. When option C<-u> is used, the output file will be written in the same UTF-16 encoding as the input file. Option C<-u> prevents conversion to UTF-8. Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16. ISO and 7-bit mode conversion do not work on UTF-16 files. =head2 Byte Order Mark On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L. On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding. Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file. Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM. Dos2unix writes by default no BOM in the output file. With option C<-b> Dos2unix writes a BOM when the input file has a BOM. Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option C<-r> to remove the BOM. Dos2unix and unix2dos write always a BOM when option C<-m> is used. =head2 Unicode file names on Windows Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C. There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name. =head2 Unicode examples Convert from Windows UTF-16 (with BOM) to Unix UTF-8: dos2unix -n in.txt out.txt Convert from Windows UTF-16LE (without BOM) to Unix UTF-8: dos2unix -ul -n in.txt out.txt Convert from Unix UTF-8 to Windows UTF-8 with BOM: unix2dos -m -n in.txt out.txt Convert from Unix UTF-8 to Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt =head1 GB18030 GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also L. GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK. On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command C to get the list of supported locales. On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030. GB18030 encoded files can have a Byte Order Mark, like Unicode files. =head1 EXAMPLES Read input from 'stdin' and write output to 'stdout': dos2unix < a.txt cat a.txt | dos2unix Convert and replace a.txt. Convert and replace b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Convert and replace a.txt in ascii conversion mode: dos2unix a.txt Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Convert a.txt from Mac to Unix format: dos2unix -c mac a.txt mac2unix a.txt Convert a.txt from Unix to Mac format: unix2dos -c mac a.txt unix2mac a.txt Convert and replace a.txt while keeping original date stamp: dos2unix -k a.txt dos2unix -k -o a.txt Convert a.txt and write to e.txt: dos2unix -n a.txt e.txt Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt: dos2unix -k -n a.txt e.txt Convert and replace a.txt, convert b.txt and write to e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 RECURSIVE CONVERSION Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type: find . -name '*.txt' |xargs dos2unix In a Windows Command Prompt the following command can be used: for /R %G in (*.txt) do dos2unix "%G" PowerShell users can use the following command in Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} =head1 LOCALIZATION =over 4 =item B The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells: export LANG=nl Dutch export LANG=nl_NL Dutch, The Netherlands export LANG=nl_BE Dutch, Belgium export LANG=es_ES Spanish, Spain export LANG=es_MX Spanish, Mexico export LANG=en_US.iso88591 English, USA, Latin-1 encoding export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding For a complete list of language and country codes see the gettext manual: L On Unix systems you can use the command locale(1) to get locale specific information. =item B With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than "C", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L If you select a language which is not available you will get the standard English messages. =item B With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used. Example (POSIX shell): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 RETURN VALUE On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned. The return value is always zero in quiet mode, except when wrong command-line options are used. =head1 STANDARDS L L L L =head1 AUTHORS Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer) Project page: L SourceForge page: L =head1 SEE ALSO file(1) find(1) iconv(1) locale(1) xargs(1) =cut dos2unix-7.3.4/man/man1/dos2unix.txt0000644000175500010010000006371412721132567016513 0ustar waterlanGeenNAME dos2unix - DOS/Mac to Unix and vice versa text file format converter SYNOPSIS dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...] unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...] DESCRIPTION The Dos2unix package includes utilities "dos2unix" and "unix2dos" to convert plain text files in DOS or Mac format to Unix format and vice versa. In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks. Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files. Binary files are automatically skipped, unless conversion is forced. Non-regular files, such as directories and FIFOs, are automatically skipped. Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows. Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options "-o" and "-n". Another difference is that the SunOS/Solaris version uses by default *iso* mode conversion while this version uses by default *ascii* mode conversion. OPTIONS -- Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named "-foo", you can use this command: dos2unix -- -foo Or in new file mode: dos2unix -n -- -foo out.txt -ascii Convert only line breaks. This is the default conversion mode. -iso Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES. -1252 Use Windows code page 1252 (Western European). -437 Use DOS code page 437 (US). This is the default code page used for ISO conversion. -850 Use DOS code page 850 (Western European). -860 Use DOS code page 860 (Portuguese). -863 Use DOS code page 863 (French Canadian). -865 Use DOS code page 865 (Nordic). -7 Convert 8 bit characters to 7 bit space. -b, --keep-bom Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option "-r". -c, --convmode CONVMODE Set conversion mode. Where CONVMODE is one of: *ascii*, *7bit*, *iso*, *mac* with ascii being the default. -D, --display-enc ENCODING Set encoding of displayed text. Where ENCODING is one of: *ansi*, *unicode*, *unicodebom*, *utf8*, *utf8bom* with ansi being the default. This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed. There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages. ansi Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the "chcp" command, because dos2unix uses the Windows system code page. The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK. unicode, unicodebom The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it. When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font. The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program. When method "unicodebom" is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. utf8, utf8bom The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the "unicode" encoding. The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed. In a ConEmu console the utf8 encoding method works well. When method "utf8bom" is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to "unicode", "unicodebom", "utf8", or "utf8bom". -f, --force Force conversion of binary files. -gb, --gb18030 On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030. -h, --help Display help and exit. -i[FLAGS], --info[=FLAGS] FILE ... Display file information. No conversion is done. The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name. Example output: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Note that sometimes a binary file can be mistaken for a text file. See also option "-s". Optionally extra flags can be set to change the output. One or more flags can be added. d Print number of DOS line breaks. u Print number of Unix line breaks. m Print number of Mac line breaks. b Print the byte order mark. t Print if file is text or binary. c Print only the files that would be converted. With the "c" flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks. h Print a header. p Show file names without path. Examples: Show information for all *.txt files: dos2unix -i *.txt Show only the number of DOS line breaks and Unix line breaks: dos2unix -idu *.txt Show only the byte order mark: dos2unix --info=b *.txt List the files that have DOS line breaks: dos2unix -ic *.txt List the files that have Unix line breaks: unix2dos -ic *.txt Convert only files that have DOS line breaks and leave the other files untouched: dos2unix -ic *.txt | xargs dos2unix Find text files that have DOS line breaks: find -name '*.txt' | xargs dos2unix -ic -k, --keepdate Keep the date stamp of output file same as input file. -L, --license Display program's license. -l, --newline Add additional newline. dos2unix: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks. unix2dos: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks. -m, --add-bom Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written. When the input file is UTF-16, and the option "-u" is used, an UTF-16 BOM will be written. Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE. -n, --newfile INFILE OUTFILE ... New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should *not* be used or you *will* lose your files. The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion. -o, --oldfile FILE ... Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used. In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix. -q, --quiet Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used. -r, --remove-bom Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option "-b". -s, --safe Skip binary files (default). The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file. -u, --keep-utf16 Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the "-ascii" option. -ul, --assume-utf16le Assume that the input file format is UTF-16LE. When there is a Byte Order Mark in the input file the BOM has priority over this option. When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file. The assumption of UTF-16LE works as a *conversion mode*. By switching to the default *ascii* mode the UTF-16LE assumption is turned off. -ub, --assume-utf16be Assume that the input file format is UTF-16BE. This option works the same as option "-ul". -v, --verbose Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks. -F, --follow-symlink Follow symbolic links and convert the targets. -R, --replace-symlink Replace symbolic links with converted files (original target files remain unchanged). -S, --skip-symlink Keep symbolic links and targets unchanged (default). -V, --version Display version information and exit. MAC MODE In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted. In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed. To run in Mac mode use the command-line option "-c mac" or use the commands "mac2unix" or "unix2mac". CONVERSION MODES ascii In mode "ascii" only line breaks are converted. This is the default conversion mode. Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files. 7bit In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space. iso Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart. When only option "-iso" is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options -437 (US), -850 (Western European), -860 (Portuguese), -863 (French Canadian), or -865 (Nordic). Windows code page CP1252 (Western European) is also supported with option -1252. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings. Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files. Some examples: Convert from DOS default code page to Unix Latin-1: dos2unix -iso -n in.txt out.txt Convert from DOS CP850 to Unix Latin-1: dos2unix -850 -n in.txt out.txt Convert from Windows CP1252 to Unix Latin-1: dos2unix -1252 -n in.txt out.txt Convert from Windows CP1252 to Unix UTF-8 (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Convert from Unix Latin-1 to DOS default code page: unix2dos -iso -n in.txt out.txt Convert from Unix Latin-1 to DOS CP850: unix2dos -850 -n in.txt out.txt Convert from Unix Latin-1 to Windows CP1252: unix2dos -1252 -n in.txt out.txt Convert from Unix UTF-8 (Unicode) to Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt See also and . UNICODE Encodings There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format. Conversion Unicode text files can have DOS, Unix or Mac line breaks, like regular text files. All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII. Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type "dos2unix -V". On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped. On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux. UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped. When option "-u" is used, the output file will be written in the same UTF-16 encoding as the input file. Option "-u" prevents conversion to UTF-8. Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16. ISO and 7-bit mode conversion do not work on UTF-16 files. Byte Order Mark On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also . On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding. Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file. Use option "-ul" or "-ub" to convert an UTF-16 file without BOM. Dos2unix writes by default no BOM in the output file. With option "-b" Dos2unix writes a BOM when the input file has a BOM. Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option "-r" to remove the BOM. Dos2unix and unix2dos write always a BOM when option "-m" is used. Unicode file names on Windows Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type "dos2unix -V". There are some issues with displaying Unicode file names in a Windows console. See option "-D", "--display-enc". The file names may be displayed wrongly in the console, but the files will be written with the correct name. Unicode examples Convert from Windows UTF-16 (with BOM) to Unix UTF-8: dos2unix -n in.txt out.txt Convert from Windows UTF-16LE (without BOM) to Unix UTF-8: dos2unix -ul -n in.txt out.txt Convert from Unix UTF-8 to Windows UTF-8 with BOM: unix2dos -m -n in.txt out.txt Convert from Unix UTF-8 to Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt GB18030 GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also . GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK. On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command "locale -a" to get the list of supported locales. On Windows you need to use option "-gb" to convert UTF-16 files to GB18030. GB18030 encoded files can have a Byte Order Mark, like Unicode files. EXAMPLES Read input from 'stdin' and write output to 'stdout': dos2unix < a.txt cat a.txt | dos2unix Convert and replace a.txt. Convert and replace b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Convert and replace a.txt in ascii conversion mode: dos2unix a.txt Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Convert a.txt from Mac to Unix format: dos2unix -c mac a.txt mac2unix a.txt Convert a.txt from Unix to Mac format: unix2dos -c mac a.txt unix2mac a.txt Convert and replace a.txt while keeping original date stamp: dos2unix -k a.txt dos2unix -k -o a.txt Convert a.txt and write to e.txt: dos2unix -n a.txt e.txt Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt: dos2unix -k -n a.txt e.txt Convert and replace a.txt, convert b.txt and write to e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt RECURSIVE CONVERSION Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type: find . -name '*.txt' |xargs dos2unix In a Windows Command Prompt the following command can be used: for /R %G in (*.txt) do dos2unix "%G" PowerShell users can use the following command in Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} LOCALIZATION LANG The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells: export LANG=nl Dutch export LANG=nl_NL Dutch, The Netherlands export LANG=nl_BE Dutch, Belgium export LANG=es_ES Spanish, Spain export LANG=es_MX Spanish, Mexico export LANG=en_US.iso88591 English, USA, Latin-1 encoding export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding For a complete list of language and country codes see the gettext manual: On Unix systems you can use the command locale(1) to get locale specific information. LANGUAGE With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: "LANGUAGE=nl:de". You have to first enable localization, by setting LANG (or LC_ALL) to a value other than "C", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: If you select a language which is not available you will get the standard English messages. DOS2UNIX_LOCALEDIR With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is "/usr/local/share/locale". Option --version will display the LOCALEDIR that is used. Example (POSIX shell): export DOS2UNIX_LOCALEDIR=$HOME/share/locale RETURN VALUE On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned. The return value is always zero in quiet mode, except when wrong command-line options are used. STANDARDS AUTHORS Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer) Project page: SourceForge page: SEE ALSO file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/man1/Makefile0000644000175500010010000000745412721132543015630 0ustar waterlanGeen# pod2man.mk -- Makefile portion to convert *.pod files to manual pages # # Copyright information # # Copyright (C) 2010 Jari Aalto # Copyright (C) 2010-2016 Erwin Waterlander # # License # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the # following conditions are met: # # 1. Redistributions of source code must retain the above # copyright notice, this list of conditions and the following # disclaimer. # # 2. Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials # provided with the distribution. # # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OF THIS # FILE OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # DAMAGE. # # The license text is copy of the FreeBSD License available at # with following # modifications: wording "THIS SOFTWARE IS PROVIDED BY THE # FREEBSD PROJECT" was changed to "THIS SOFTWARE IS PROVIDED 'AS # IS'" and wording "IN NO EVENT SHALL THE FREEBSD PROJECT" was # changed to "IN NO EVENT SHALL THE AUTHOR(S)" # # Description # # Convert *.pod files to manual pages. ifneq (,) This makefile requires GNU Make. endif .PRECIOUS: %.pod # This variable *must* be set when calling PACKAGE ?= dos2unix # Optional variables to set MANSECT ?= 1 PODCENTER ?= $$(date "+%Y-%m-%d") # Directories MANSRC = MANDEST = $(MANSRC) MANPOD = $(MANSRC)$(PACKAGE).pod MANPAGE = $(MANDEST)$(PACKAGE).$(MANSECT) POD2MAN = pod2man POD2MAN_FLAGS = POFILES = $(wildcard ../../po-man/*.po) PODFILES = $(patsubst ../../po-man/%.po,../%/man1/dos2unix.pod,$(POFILES)) MAN_OBJECTS = dos2unix.1 $(patsubst %.pod,%.1,$(PODFILES)) MKDIR = mkdir all: $(MAN_OBJECTS) ../../po-man/dos2unix-man.pot # Issues: # The perl version of MinGW and DJGPP is 5.8.8. The pod2man command of perl # 5.8.8 does not yet have the options -u, --utf8, and does support the # =encoding command. The =encoding command and the --utf8 option are supported # since perl 5.10.1. # Erwin W. # Dos2unix 6.0.5: Forget Latin-1, we do now only UTF-8. ../../po-man/dos2unix-man.pot : dos2unix.pod po4a-updatepo -f pod -m $< -p $@ --msgmerge-opt --no-wrap %.po : dos2unix.pod po4a-updatepo -f pod -m $< -p $@ --msgmerge-opt "--backup=numbered --no-wrap" # change timestamp in case .po file was not updated. touch $@ # Create pod files from po. # Fix problem that =encoding is before =pod command. ../%/man1/dos2unix.pod : ../../po-man/%.po $(MKDIR) -p $(dir $@) po4a-translate -f pod -m dos2unix.pod -k 70 -p $< > $@ perl -ni.bak -e 'print unless /=encoding UTF-8/' $@ perl -pli.bak -e 's/=pod/=pod\n\n=encoding UTF-8/' $@ # An empty recipe for dos2unix.pod to break circular dependency. dos2unix.pod : ; %.1 : %.pod # make target - create manual page from a *.pod page podchecker $< $(POD2MAN) $(POD2MAN_FLAGS) \ --utf8 \ --center="$(PODCENTER)" \ --name="$(PACKAGE)" \ --section="$(MANSECT)" \ $< \ | perl -p -e 's/[Pp]erl v[0-9.]+/$(PACKAGE)/;' \ > $@ && \ rm -f pod*.tmp clean: rm -f $(MAN_OBJECTS) rm -f ../../po-man/dos2unix-man.pot rm -f $(PODFILES) # End of of Makefile part dos2unix-7.3.4/man/nl/0000755000175500010010000000000012721132557013740 5ustar waterlanGeendos2unix-7.3.4/man/nl/man1/0000755000175500010010000000000012721132613014565 5ustar waterlanGeendos2unix-7.3.4/man/nl/man1/dos2unix.10000644000175500010010000010206512721132560016427 0ustar waterlanGeen.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dos2unix 1" .TH dos2unix 1 "2016-05-24" "dos2unix" "2016-05-24" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAAM" .IX Header "NAAM" dos2unix \- omzetter van tekstbestandsindelingen, van DOS/Mac naar Unix en vice versa .SH "OVERZICHT" .IX Header "OVERZICHT" .Vb 2 \& dos2unix [opties] [BESTAND ...] [\-n INVOERBESTAND UITVOERBESTAND ...] \& unix2dos [opties] [BESTAND ...] [\-n INVOERBESTAND UITVOERBESTAND ...] .Ve .SH "BESCHRIJVING" .IX Header "BESCHRIJVING" Het Dos2unix pakket bevat de toepassingen \f(CW\*(C`dos2unix\*(C'\fR en \f(CW\*(C`unix2dos\*(C'\fR om platte tekstbestanden in \s-1DOS\-\s0 of Mac-indeling naar Unix-indeling om te zetten, en vice versa. .PP In DOS/Windows\-tekstbestanden bestaat een regeleinde uit een combinatie van twee tekens: een 'Carriage Return' (\s-1CR\s0) gevolgd door een 'Line Feed' (\s-1LF\s0). In Unix-tekstbestanden bestaat een regeleinde uit één enkel 'Newline'\-teken, dat gelijk is aan een \s-1DOS \s0'Line Feed'-teken (\s-1LF\s0). In Mac-tekstbestanden, van vóór Mac \s-1OS X,\s0 bestaan regeleindes uit één enkel 'Carriage Return'-teken. Mac \s-1OS X\s0 is op Unix gebaseerd en heeft dezelfde regeleindes als Unix. .PP Naast regeleindes kan Dos2unix ook de codering van bestanden converteren. Enkele DOS-codetabellen kunnen omgezet worden naar Unix Latin\-1. En Windows Unicode-bestanden (\s-1UTF\-16\s0) kunnen geconverteerd worden naar Unix Unicode-bestanden (\s-1UTF\-8\s0). .PP Binaire bestanden worden automatisch overgeslagen, behalve als de omzetting geforceerd wordt. .PP Niet-reguliere bestanden, zoals mappen en \s-1FIFO\s0's, worden automatisch overgeslagen. .PP Symbolische koppelingen en hun doelen blijven standaard onaangeroerd. Optioneel kunnen symbolische koppelingen worden vervangen, of de uitvoer kan naar het doel van de symbolische koppeling worden geschreven. Op Windows wordt het schrijven naar het doel van een symbolische koppeling niet ondersteund. .PP Dos2unix is gemodelleerd naar dos2unix op SunOS/Solaris, maar er is een belangrijk verschil: deze versie van dos2unix voert standaard een vervangende conversie uit (oud-bestand-modus) terwijl de oorspronkelijke SunOS/Solaris\-versie alleen de gepaarde conversie (nieuw-bestand-modus) kent. Zie ook de opties \f(CW\*(C`\-o\*(C'\fR en \f(CW\*(C`\-n\*(C'\fR. Een ander verschil is dat de SunOS/Solaris\-versie standaard een conversie in \fIiso\fR\-modus doet terwijl deze versie standaard \fIascii\fR\-modus gebruikt. .SH "OPTIES" .IX Header "OPTIES" .IP "\fB\-\-\fR" 4 .IX Item "--" Alle volgende opties als bestandsnamen behandelen. Gebruik deze optie als u een bestand wilt converteren waarvan de naam met een streepje begint. Bijvoorbeeld, om een bestand genaamd \*(L"\-foo\*(R" om te zetten, gebruikt u de volgende opdracht: .Sp .Vb 1 \& dos2unix \-\- \-foo .Ve .Sp Of in nieuw-bestand-modus: .Sp .Vb 1 \& dos2unix \-n \-\- \-foo uit.txt .Ve .IP "\fB\-ascii\fR" 4 .IX Item "-ascii" Alleen regeleindes converteren. Dit is de standaardconversiemodus. .IP "\fB\-iso\fR" 4 .IX Item "-iso" Conversie tussen de tekensets \s-1DOS\s0 en \s-1ISO\-8859\-1. \s0 Zie ook de sectie \&\fB\s-1CONVERSIEMODI\s0\fR. .IP "\fB\-1252\fR" 4 .IX Item "-1252" Windows-codetabel 1252 (West-Europees) gebruiken. .IP "\fB\-437\fR" 4 .IX Item "-437" DOS-codetabel 437 (\s-1VS\s0) gebruiken. Dit is de standaard codetabel die gebruikt wordt bij ISO-conversie. .IP "\fB\-850\fR" 4 .IX Item "-850" DOS-codetabel 850 (West-Europees) gebruiken. .IP "\fB\-860\fR" 4 .IX Item "-860" DOS-codetabel 860 (Portugees) gebruiken. .IP "\fB\-863\fR" 4 .IX Item "-863" DOS-codetabel 863 (Canadees Frans) gebruiken. .IP "\fB\-865\fR" 4 .IX Item "-865" DOS-codetabel 865 (Scandinavisch) gebruiken. .IP "\fB\-7\fR" 4 .IX Item "-7" Lettertekens met het achtste bit gezet converteren naar spaties. .IP "\fB\-b\fR, \fB\-\-keep\-bom\fR" 4 .IX Item "-b, --keep-bom" Een Byte-Order-Mark (\s-1BOM\s0) behouden. Als het invoerbestand een \s-1BOM\s0 bevat, dan wordt ook een \s-1BOM\s0 naar het uitvoerbestand geschreven. Dit is het standaardgedrag bij conversie naar \s-1DOS. \s0 Zie ook optie \f(CW\*(C`\-r\*(C'\fR. .IP "\fB\-c\fR, \fB\-\-convmode \s-1CONVERSIEMODUS\s0\fR" 4 .IX Item "-c, --convmode CONVERSIEMODUS" De te gebruiken conversiemodus. \s-1CONVERSIEMODUS\s0 kan zijn: \fIascii\fR, \fI7bit\fR, \&\fIiso\fR, of \fImac\fR, waarbij ascii de standaardinstelling is. .IP "\fB\-D\fR, \fB\-\-display\-enc \s-1CODERING\s0\fR" 4 .IX Item "-D, --display-enc CODERING" De te gebruiken tekencodering voor weergegeven tekst. \s-1CODERING\s0 kan zijn: \&\fIansi\fR, \fIunicode\fR, \fIunicodebom\fR, \fIutf8\fR, of \fIutf8bom\fR, waarbij ansi de standaardinstelling is. .Sp Deze optie is alleen beschikbaar in dos2unix voor Windows met Unicode-bestandsnaam-ondersteuning. Deze optie heeft geen effect op de gelezen en geschreven bestandsnamen, maar alleen op hoe deze weergegeven worden. .Sp There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages. .RS 4 .IP "\fBansi\fR" 4 .IX Item "ansi" Dos2unix's default method is to use \s-1ANSI\s0 encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active \s-1DOS OEM\s0 code page to the Windows system \s-1ANSI\s0 code page using the \f(CW\*(C`chcp\*(C'\fR command, because dos2unix uses the Windows system code page. .Sp The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is \s-1OK.\s0 .IP "\fBunicode\fR, \fBunicodebom\fR" 4 .IX Item "unicode, unicodebom" The advantage of unicode (the Windows name for \s-1UTF\-16\s0) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it. .Sp When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font. .Sp The disadvantage of unicode is that it is not compatible with \s-1ASCII.\s0 The output is not easy to handle when you redirect it to another program. .Sp When method \f(CW\*(C`unicodebom\*(C'\fR is used the Unicode text will be preceded with a \&\s-1BOM \s0(Byte Order Mark). A \s-1BOM\s0 is required for correct redirection or piping in PowerShell. .IP "\fButf8\fR, \fButf8bom\fR" 4 .IX Item "utf8, utf8bom" The advantage of utf8 is that it is compatible with \s-1ASCII.\s0 You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the \f(CW\*(C`unicode\*(C'\fR encoding. .Sp The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed. .Sp In a ConEmu console the utf8 encoding method works well. .Sp When method \f(CW\*(C`utf8bom\*(C'\fR is used the \s-1UTF\-8\s0 text will be preceded with a \s-1BOM \&\s0(Byte Order Mark). A \s-1BOM\s0 is required for correct redirection or piping in PowerShell. .RE .RS 4 .Sp The default encoding can be changed with environment variable \&\s-1DOS2UNIX_DISPLAY_ENC\s0 by setting it to \f(CW\*(C`unicode\*(C'\fR, \f(CW\*(C`unicodebom\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR, or \&\f(CW\*(C`utf8bom\*(C'\fR. .RE .IP "\fB\-f\fR, \fB\-\-force\fR" 4 .IX Item "-f, --force" Conversie van binaire bestanden afdwingen. .IP "\fB\-gb\fR, \fB\-\-gb18030\fR" 4 .IX Item "-gb, --gb18030" Op Windows worden UTF\-16\-bestanden standaard naar \s-1UTF\-8\s0 geconverteerd, ongeacht de ingestelde taalregio. Gebruik deze optie om UTF\-16\-bestanden naar \s-1GB18030\s0 te converteren. Deze optie is alleen beschikbaar op Windows. Zie ook de sectie \fB\s-1GB18030\s0\fR. .IP "\fB\-h\fR, \fB\-\-help\fR" 4 .IX Item "-h, --help" Een hulptekst tonen. .IP "\fB\-i\fR[\fB\s-1VLAGGEN\s0\fR], \fB\-\-info\fR[\fB=VLAGGEN\fR] \fB\s-1BESTAND\s0\fR..." 4 .IX Item "-i[VLAGGEN], --info[=VLAGGEN] BESTAND..." Bestandsinformatie tonen. Er wordt niets geconverteerd. .Sp De volgende informatie wordt weergegeven, in deze volgorde: het aantal DOS-regeleindes, het aantal Unix-regeleindes, het aantal Mac-regeleindes, de Byte-Order-Mark, of het een tekst\- of binair bestand is, en de bestandsnaam. .Sp Voorbeelduitvoer: .Sp .Vb 8 \& 6 0 0 no_bom text dos.txt \& 0 6 0 no_bom text unix.txt \& 0 0 6 no_bom text mac.txt \& 6 6 6 no_bom text mixed.txt \& 50 0 0 UTF\-16LE text utf16le.txt \& 0 50 0 no_bom text utf8unix.txt \& 50 0 0 UTF\-8 text utf8dos.txt \& 2 418 219 no_bom binary dos2unix.exe .Ve .Sp Merk op dat een binair bestand soms voor een tekstbestand aangezien kan worden. Zie ook optie \f(CW\*(C`\-s\*(C'\fR. .Sp Bij de optie kunnen één of meer vlaggen meegegeven worden om de uitvoer te beperken. .RS 4 .IP "\fBd\fR" 4 .IX Item "d" Het aantal DOS-regeleindes tonen. .IP "\fBu\fR" 4 .IX Item "u" Het aantal Unix-regeleindes tonen. .IP "\fBm\fR" 4 .IX Item "m" Het aantal Mac-regeleindes tonen. .IP "\fBb\fR" 4 .IX Item "b" De Byte-Order-Mark tonen. .IP "\fBt\fR" 4 .IX Item "t" Tonen of het bestand tekst is of binair. .IP "\fBc\fR" 4 .IX Item "c" Alleen de namen tonen van de bestanden die geconverteerd zouden worden. .Sp Met de vlag \f(CW\*(C`c\*(C'\fR toont dos2unix alleen de bestanden die DOS-regeleindes bevatten, en unix2dos alleen de bestanden die Unix-regeleindes bevatten. .IP "\fBh\fR" 4 .IX Item "h" Een kopregel printen. .IP "\fBp\fR" 4 .IX Item "p" Bestandsnamen tonen zonder pad. .RE .RS 4 .Sp Voorbeelden: .Sp Informatie weergeven voor alle bestanden met de extensie 'txt': .Sp .Vb 1 \& dos2unix \-i *.txt .Ve .Sp Alleen de aantallen DOS-regeleindes en Unix-regeleindes tonen: .Sp .Vb 1 \& dos2unix \-idu *.txt .Ve .Sp Alleen de Byte-Order-Mark tonen: .Sp .Vb 1 \& dos2unix \-\-info=b *.txt .Ve .Sp De bestanden opsommen die DOS-regeleindes bevatten: .Sp .Vb 1 \& dos2unix \-ic *.txt .Ve .Sp De bestanden opsommen die Unix-regeleindes bevatten: .Sp .Vb 1 \& unix2dos \-ic *.txt .Ve .Sp Alleen bestanden die DOS-regeleindes bevatten converteren en andere bestanden ongemoeid laten: .Sp .Vb 1 \& dos2unix \-ic *.txt | xargs dos2unix .Ve .Sp De bestanden vinden die DOS-regeleindes bevatten: .Sp .Vb 1 \& find \-name \*(Aq*.txt\*(Aq | xargs dos2unix \-ic .Ve .RE .IP "\fB\-k\fR, \fB\-\-keepdate\fR" 4 .IX Item "-k, --keepdate" Het tijdsstempel van het invoerbestand behouden voor het uitvoerbestand. .IP "\fB\-L\fR, \fB\-\-license\fR" 4 .IX Item "-L, --license" De softwarelicentie tonen. .IP "\fB\-l\fR, \fB\-\-newline\fR" 4 .IX Item "-l, --newline" Een extra regeleinde toevoegen. .Sp \&\fBdos2unix\fR: Alleen DOS-regeleindes worden omgezet naar twee Unix-regeleindes. In Mac-modus worden alleen Mac-regeleindes omgezet naar twee Unix-regeleindes. .Sp \&\fBunix2dos\fR: Alleen Unix-regeleindes worden omgezet naar twee DOS-regeleindes. In Mac-modus worden Unix-regeleindes omgezet naar twee Mac-regeleindes. .IP "\fB\-m\fR, \fB\-\-add\-bom\fR" 4 .IX Item "-m, --add-bom" Een Byte-Order-Mark (\s-1BOM\s0) naar het uitvoerbestand schrijven. Standaard wordt een \s-1UTF\-8\-BOM\s0 geschreven. .Sp Als het invoerbestand in \s-1UTF\-16\s0 is, en de optie \f(CW\*(C`\-u\*(C'\fR is gegeven, dan wordt een \s-1UTF\-16\-BOM\s0 geschreven. .Sp Gebruik deze optie nooit als de codering van het uitvoerbestand niet \s-1UTF\-8, UTF\-16,\s0 of \s-1GB18030\s0 is. Zie ook de sectie \fB\s-1UNICODE\s0\fR. .IP "\fB\-n\fR, \fB\-\-newfile \s-1INVOERBESTAND UITVOERBESTAND\s0\fR ..." 4 .IX Item "-n, --newfile INVOERBESTAND UITVOERBESTAND ..." Nieuw-bestand-modus. Het bestand \s-1INVOERBESTAND\s0 converteren en naar bestand \&\s-1UITVOERBESTAND\s0 schrijven. Bestandsnamen moeten opgegeven worden in paren. Jokertekens moeten \fIniet\fRgebruikt worden, anders \fIverlies\fR je de bestanden. .Sp De gebruiker die de conversie start in nieuw-bestand (gepaarde) modus wordt de eigenaar van het geconverteerde bestand. De lees/schrijf\-toegangsrechten van het nieuwe bestand worden de toegangsrechten van het originele bestand minus de \fIumask\fR\|(1) van de gebruiker die de conversie draait. .IP "\fB\-o\fR, \fB\-\-oldfile \s-1BESTAND\s0\fR ..." 4 .IX Item "-o, --oldfile BESTAND ..." Oud-bestand-modus. Het bestand \s-1BESTAND\s0 converteren en overschrijven. Dit is de standaard modus. Jokertekens kunnen gebruikt worden. .Sp In oud-bestand (vervangende) modus krijgt het geconverteerde bestand dezelfde eigenaar, groep en lees/schrijf\-rechten als het originele bestand. Ook wanneer het bestand wordt omgezet door een andere gebruiker die schrijfrechten heeft op het bestand (b.v. gebruiker root). De omzetting wordt afgebroken wanneer het niet mogelijk is de originele waardes te behouden. Verandering van eigenaar kan betekenen dat de originele eigenaar het bestand niet meer kan lezen. Verandering van groep zou een veiligheidsrisico kunnen zijn, het bestand zou leesbaar kunnen worden voor personen voor wie het niet bestemd is. Behoud van eigenaar, groep en lees/schrijf\-rechten wordt alleen ondersteund op Unix. .IP "\fB\-q\fR, \fB\-\-quiet\fR" 4 .IX Item "-q, --quiet" Stille werking. Alle waarschuwingen onderdrukken. De afsluitwaarde is nul, behalve wanneer verkeerde opties worden gegeven. .IP "\fB\-r\fR, \fB\-\-remove\-bom\fR" 4 .IX Item "-r, --remove-bom" Een Byte-Order-Mark (\s-1BOM\s0) verwijderen. Er wordt geen \s-1BOM\s0 naar het uitvoerbestand geschreven. Dit is het standaardgedrag bij conversie naar Unix. Zie ook optie \f(CW\*(C`\-b\*(C'\fR. .IP "\fB\-s\fR, \fB\-\-safe\fR" 4 .IX Item "-s, --safe" Binaire bestanden overslaan (standaard). .Sp Binaire bestanden worden overgeslagen om vergissingen te voorkomen. Het detecteren van binaire bestanden is echter niet 100% betrouwbaar. Invoerbestanden worden gescand op binaire tekens die gewoonlijk niet in tekstbestanden voorkomen. Maar het is mogelijk dat een binair bestand enkel normale teksttekens bevat. Zo'n binair bestand zal dan foutief als een tekstbestand gezien worden. .IP "\fB\-u\fR, \fB\-\-keep\-utf16\fR" 4 .IX Item "-u, --keep-utf16" De originele UTF\-16\-codering van het invoerbestand behouden. Het uitvoerbestand wordt in dezelfde UTF\-16\-codering (little endian of big endian) geschreven als het invoerbestand. Dit voorkomt conversie naar \&\s-1UTF\-8. \s0 Er wordt ook een corresponderende \s-1UTF\-16\-BOM\s0 geschreven. Deze optie kan uitgeschakeld worden met de optie \f(CW\*(C`\-ascii\*(C'\fR. .IP "\fB\-ul\fR, \fB\-\-assume\-utf16le\fR" 4 .IX Item "-ul, --assume-utf16le" Veronderstellen dat de indeling van het invoerbestand \s-1UTF\-16LE\s0 is. .Sp Wanneer het invoerbestand een Byte-Order-Mark (\s-1BOM\s0) bevat, dan gaat deze \s-1BOM\s0 vóór deze optie. .Sp Wanneer een verkeerde aanname is gemaakt (het invoerbestand was geen \&\s-1UTF\-16LE\s0) en de conversie verliep met succes, dan krijgt u een UTF\-8\-bestand met verkeerde tekst. De verkeerde conversie kan ongedaan worden gemaakt door met \fIiconv\fR\|(1) het UTF\-8\-uitvoerbestand terug om te zetten naar \&\s-1UTF\-16LE. \s0 Dit zal het originele bestand terug brengen. .Sp De aanname van \s-1UTF\-16LE\s0 werkt als een \fIconversiemodus\fR. Door de standaardmodus \fIascii\fR in te schakelen wordt de UTF\-16LE\-veronderstelling uitgeschakeld. .IP "\fB\-ub\fR, \fB\-\-assume\-utf16be\fR" 4 .IX Item "-ub, --assume-utf16be" Veronderstellen dat de indeling van het invoerbestand \s-1UTF\-16BE\s0 is. .Sp Deze optie werkt hetzelfde als optie \f(CW\*(C`\-ul\*(C'\fR. .IP "\fB\-v\fR, \fB\-\-verbose\fR" 4 .IX Item "-v, --verbose" Extra meldingen weergeven. Er wordt extra informatie getoond over Byte-Order-Marks en het aantal geconverteerde regeleindes. .IP "\fB\-F\fR, \fB\-\-follow\-symlink\fR" 4 .IX Item "-F, --follow-symlink" Symbolische koppelingen volgen en de doelen converteren. .IP "\fB\-R\fR, \fB\-\-replace\-symlink\fR" 4 .IX Item "-R, --replace-symlink" Symbolische koppelingen vervangen door geconverteerde bestanden (de originele doelbestanden blijven ongewijzigd). .IP "\fB\-S\fR, \fB\-\-skip\-symlink\fR" 4 .IX Item "-S, --skip-symlink" Symbolische koppelingen en doelen ongewijzigd laten (standaard). .IP "\fB\-V\fR, \fB\-\-version\fR" 4 .IX Item "-V, --version" Versie-informatie tonen. .SH "MAC-MODUS" .IX Header "MAC-MODUS" In normale modus worden DOS-regeleindes naar Unix omgezet en vice versa. Mac-regeleindes worden niet omgezet. .PP In Mac-modus worden Mac-regeleindes naar Unix omgezet en vice versa. DOS-regeleindes blijven ongewijzigd. .PP Om in Mac-modus te draaien kunt u de opdrachtregeloptie \f(CW\*(C`\-c mac\*(C'\fR gebruiken, of de opdrachten \f(CW\*(C`mac2unix\*(C'\fR of \f(CW\*(C`unix2mac\*(C'\fR. .SH "CONVERSIEMODI" .IX Header "CONVERSIEMODI" .IP "\fBascii\fR" 4 .IX Item "ascii" In modus \f(CW\*(C`ascii\*(C'\fR worden alleen regeleindes omgezet. Dit is de standaardmodus. .Sp Hoewel de naam van deze modus \s-1ASCII\s0 is, wat een 7\-bits standaard is, is de werkelijke modus 8\-bits. Gebruik altijd deze modus wanneer u Unicode UTF\-8\-bestanden omzet. .IP "\fB7bit\fR" 4 .IX Item "7bit" Alle 8\-bits niet-ASCII lettertekens (met waardes van 128 t/m 255) worden omgezet naar een 7\-bits spatie. .IP "\fBiso\fR" 4 .IX Item "iso" Tekens worden omgezet tussen een DOS-tekenset (codetabel) en de ISO-tekenset \&\s-1ISO\-8859\-1 \s0(Latin\-1) op Unix. DOS-tekens zonder een ISO\-8859\-1\-equivalent, waarvoor dus geen omzetting mogelijk is, worden omgezet in een punt. Hetzelfde geldt voor ISO\-8859\-1\-tekens zonder DOS-tegenhanger. .Sp Wanneer alleen optie \f(CW\*(C`\-iso\*(C'\fR gebruikt wordt, zal dos2unix proberen de actieve codetabel te gebruiken. Als dat niet mogelijk is wordt codetabel \&\s-1CP437\s0 gebruikt, die vooral in de \s-1VS\s0 gebruikt wordt. Om een bepaalde codetabel te forceren, kunt u de opties \f(CW\*(C`\-850\*(C'\fR (West-Europees), \f(CW\*(C`\-860\*(C'\fR (Portugees), \f(CW\*(C`\-863\*(C'\fR (Canadees Frans) of \f(CW\*(C`\-865\*(C'\fR (Scandinavisch) gebruiken. Windows-codetabel \s-1CP1252 \s0(West-Europees) wordt ook ondersteund met optie \&\f(CW\*(C`\-1252\*(C'\fR. Gebruik voor andere codetabellen dos2unix in combinatie met \&\fIiconv\fR\|(1). Iconv kan omzetten tussen een lange lijst tekensetcoderingen. .Sp Gebruik ISO-conversie nooit op Unicode-tekstbestanden. Het zal UTF\-8\-gecodeerde bestanden beschadigen. .Sp Enkele voorbeelden: .Sp Omzetten van de standaard DOS-codetabel naar Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-iso \-n in.txt uit.txt .Ve .Sp Omzetten van \s-1DOS CP850\s0 naar Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-850 \-n in.txt uit.txt .Ve .Sp Omzetten van Windows \s-1CP1252\s0 naar Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-1252 \-n in.txt uit.txt .Ve .Sp Omzetten van Windows \s-1CP1252\s0 naar Unix \s-1UTF\-8 \s0(Unicode): .Sp .Vb 1 \& iconv \-f CP1252 \-t UTF\-8 in.txt | dos2unix > uit.txt .Ve .Sp Omzetten van Unix Latin\-1 naar de standaard DOS-codetabel: .Sp .Vb 1 \& unix2dos \-iso \-n in.txt uit.txt .Ve .Sp Omzetten van Unix Latin\-1 naar \s-1DOS CP850:\s0 .Sp .Vb 1 \& unix2dos \-850 \-n in.txt uit.txt .Ve .Sp Omzetten van Unix Latin\-1 naar Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos \-1252 \-n in.txt uit.txt .Ve .Sp Omzetten van Unix \s-1UTF\-8 \s0(Unicode) naar Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t CP1252 > uit.txt .Ve .Sp Zie ook en . .SH "UNICODE" .IX Header "UNICODE" .SS "Coderingen" .IX Subsection "Coderingen" Er bestaan verschillende Unicode-coderingen. Op Unix en Linux zijn Unicode-bestanden typisch gecodeerd in \s-1UTF\-8. \s0 Op Windows kunnen Unicode-tekstbestanden gecodeerd zijn in \s-1UTF\-8, UTF\-16\s0 of \s-1UTF\-16\s0 big endian, maar ze zijn meestal gecodeerd in \s-1UTF\-16.\s0 .SS "Conversie" .IX Subsection "Conversie" Unicode-tekstbestanden kunnen \s-1DOS\-,\s0 Unix\- of Mac-regeleindes hebben, net als reguliere tekstbestanden. .PP Alle versies van dos2unix en unix2dos kunnen UTF\-8\-gecodeerde bestanden omzetten, want \s-1UTF\-8\s0 is ontworpen op compatibiliteit met \s-1ASCII.\s0 .PP Dos2unix en unix2dos met Unicode UTF\-16\-ondersteuning kunnen little en big endian UTF\-16\-gecodeerde tekstbestanden lezen. Om er achter te komen of dos2unix gebouwd is met \s-1UTF\-16\-\s0 ondersteuning, typt u \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP Op Unix/Linux worden UTF\-16\-bestanden geconverteerd naar de codering van de ingestelde taalregio. Gebruik de opdracht \fBlocale\fR(1) om te zien wat de ingestelde codering is. Wanneer conversie niet mogelijk is, treedt er een fout op en wordt het bestand overgeslagen. .PP Op Windows worden UTF\-16\-bestanden standaard naar \s-1UTF\-8\s0 geconverteerd. UTF\-8\-tekstbestanden worden alom goed ondersteund, zowel op Windows als Unix/Linux. .PP De \s-1UTF\-16\-\s0 en UTF\-8\-coderingen zijn volledig compatibel, er gaat bij het converteren niets verloren. Als er tijdens de conversie van \s-1UTF\-16\s0 naar \&\s-1UTF\-8\s0 een fout optreedt, bijvoorbeeld omdat het UTF\-16\-invoerbestand een fout bevat, dan wordt het bestand overgeslagen. .PP Wanneer \f(CW\*(C`\-u\*(C'\fR gebruikt wordt, wordt het uitvoerbestand in dezelfde UTF\-16\-codering geschreven als het invoerbestand. Optie \f(CW\*(C`\-u\*(C'\fR voorkomt conversie naar \s-1UTF\-8.\s0 .PP Dos2unix en unix2dos hebben geen optie om van \s-1UTF\-8\s0 naar \s-1UTF\-16\s0 te converteren. .PP \&\s-1ISO\-\s0 en 7\-bits\-conversie werken niet op UTF\-16\-bestanden. .SS "Byte-Order-Mark" .IX Subsection "Byte-Order-Mark" Op Windows bevatten Unicode-tekstbestanden gewoonlijk een Byte-Order-Mark (\s-1BOM\s0), omdat veel Windows-programma's (inclusief Kladblok) standaard een \s-1BOM\s0 toevoegen. Zie ook . .PP Op Unix hebben Unicode-tekstbestanden meestal geen \s-1BOM. \s0 Er wordt aangenomen dat de codering van tekstbestanden gelijk is aan de tekencodering van de ingestelde taalregio. .PP Dos2unix kan alleen detecteren of een bestand in UTF\-16\-codering is als het bestand een \s-1BOM\s0 bevat. Wanneer een UTF\-16\-bestand geen \s-1BOM\s0 heeft, ziet dos2unix het bestand als een binair bestand. .PP Gebruik optie \f(CW\*(C`\-ul\*(C'\fR of \f(CW\*(C`\-ub\*(C'\fR om een UTF\-16\-bestand zonder \s-1BOM\s0 om te zetten. .PP Dos2unix schrijft standaard geen \s-1BOM\s0 in het uitvoerbestand. Met optie \f(CW\*(C`\-b\*(C'\fR schrijft dos2unix een \s-1BOM\s0 wanneer het invoerbestand een \s-1BOM\s0 bevat. .PP Unix2dos schrijft standaard een \s-1BOM\s0 in het uitvoerbestand wanneer het invoerbestand een \s-1BOM\s0 bevat. Gebruik optie \f(CW\*(C`\-r\*(C'\fR om de \s-1BOM\s0 te verwijderen. .PP Dos2unix en unix2dos schrijven altijd een \s-1BOM\s0 wanneer optie \f(CW\*(C`\-m\*(C'\fR gebruikt wordt. .SS "Unicode-bestandsnamen op Windows" .IX Subsection "Unicode-bestandsnamen op Windows" Dos2unix heeft optionele ondersteuning voor het lezen en schrijven van Unicode-bestandsnamen in de Windows Opdrachtprompt. Dit betekent dat dos2unix bestanden kan openen waarvan de naam tekens bevat die niet voorkomen in de standaard ANSI-codetabel. Om te zien of dos2unix voor Windows gecompileerd werd met ondersteuning voor Unicode-bestandsnamen, typt u \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP Er zijn enige problemen met het weergeven van Unicode-bestandsnamen in een Windows-console; zie bij optie \f(CW\*(C`\-D\*(C'\fR, \f(CW\*(C`\-\-display\-enc\*(C'\fR. De bestandsnamen kunnen verkeerd weergegeven worden, maar de bestanden zullen geschreven worden met de correcte naam. .SS "Unicode-voorbeelden" .IX Subsection "Unicode-voorbeelden" Omzetten van Windows \s-1UTF\-16 \s0(met \s-1BOM\s0) naar Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-n in.txt uit.txt .Ve .PP Omzetten van Windows \s-1UTF\-16LE \s0(zonder \s-1BOM\s0) naar Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-ul \-n in.txt uit.txt .Ve .PP Omzetten van Unix \s-1UTF\-8\s0 naar Windows \s-1UTF\-8\s0 met \s-1BOM:\s0 .PP .Vb 1 \& unix2dos \-m \-n in.txt uit.txt .Ve .PP Omzetten van Unix \s-1UTF\-8\s0 naar Windows \s-1UTF\-16:\s0 .PP .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t UTF\-16 > uit.txt .Ve .SH "GB18030" .IX Header "GB18030" \&\s-1GB18030\s0 is een standaard van de Chinese overheid. Een subset van de GB18030\-standaard is officieel verplicht voor alle softwareproducten die in China verkocht worden. Zie ook . .PP \&\s-1GB18030\s0 is volledig compatibel met Unicode, en kan als een Unicodetransformatie beschouwd worden. Net als \s-1UTF\-8\s0 is \s-1GB18030\s0 compatibel met \s-1ASCII. GB18030\s0 is ook compatibel met Windows-codetabel 936 (ook wel \s-1GBK\s0 genoemd). .PP Op Unix/Linux worden UTF\-16\-bestanden naar \s-1GB18030\s0 geconverteerd wanneer de taalregio-codering \s-1GB18030\s0 is. Merk op dat dit alleen werkt als deze taalregio-instelling door het systeem ondersteund wordt. Gebruik het commando \f(CW\*(C`locale \-a\*(C'\fR voor een overzicht van de beschikbare taalregio's. .PP Op Windows dient u de optie \f(CW\*(C`\-gb\*(C'\fR te gebruiken om UTF\-16\-bestanden naar \&\s-1GB18030\s0 te converteren. .PP GB18030\-bestanden kunnen een Byte-Order-Mark bevatten, net als Unicode-bestanden. .SH "VOORBEELDEN" .IX Header "VOORBEELDEN" Invoer lezen van standaardinvoer en uitvoer schrijven naar standaarduitvoer: .PP .Vb 2 \& dos2unix < a.txt \& cat a.txt | dos2unix .Ve .PP Omzetten en vervangen van a.txt; omzetten en vervangen van b.txt: .PP .Vb 2 \& dos2unix a.txt b.txt \& dos2unix \-o a.txt b.txt .Ve .PP Omzetten en vervangen van a.txt in ascii-conversiemodus: .PP .Vb 1 \& dos2unix a.txt .Ve .PP Omzetten en vervangen van a.txt in ascii-conversiemodus; omzetten en vervangen van b.txt in 7\-bits conversiemodus: .PP .Vb 3 \& dos2unix a.txt \-c 7bit b.txt \& dos2unix \-c ascii a.txt \-c 7bit b.txt \& dos2unix \-ascii a.txt \-7 b.txt .Ve .PP Omzetten van a.txt van Mac\- naar Unix-indeling: .PP .Vb 2 \& dos2unix \-c mac a.txt \& mac2unix a.txt .Ve .PP Omzetten van a.txt van Unix\- naar Mac-indeling: .PP .Vb 2 \& unix2dos \-c mac a.txt \& unix2mac a.txt .Ve .PP Omzetten en vervangen van a.txt met behoud van origineel tijdsstempel: .PP .Vb 2 \& dos2unix \-k a.txt \& dos2unix \-k \-o a.txt .Ve .PP Omzetten van a.txt en resultaat naar e.txt schrijven: .PP .Vb 1 \& dos2unix \-n a.txt e.txt .Ve .PP Omzetten van a.txt en naar e.txt schrijven, met tijdsstempel van e.txt gelijk aan die van a.txt: .PP .Vb 1 \& dos2unix \-k \-n a.txt e.txt .Ve .PP Omzetten en vervangen van a.txt; omzetten van b.txt en naar e.txt schrijven: .PP .Vb 2 \& dos2unix a.txt \-n b.txt e.txt \& dos2unix \-o a.txt \-n b.txt e.txt .Ve .PP Omzetten van c.txt en naar e.txt schrijven; omzetten en vervangen van a.txt; omzetten en vervangen van b.txt; omzetten van d.txt en naar f.txt schrijven. .PP .Vb 1 \& dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt .Ve .SH "RECURSIEVE CONVERSIE" .IX Header "RECURSIEVE CONVERSIE" Gebruik dos2unix in combinatie met de opdrachten \fBfind\fR(1) en \fBxargs\fR(1) om tekstbestanden in een mappenboom recursief om te zetten. Bijvoorbeeld om alle .txt\-bestanden in de mappenboom onder de huidige map te converteren, typt u: .PP .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq | xargs dos2unix .Ve .PP In een Windows Opdrachtprompt kan de volgende opdracht gebruikt worden: .PP .Vb 1 \& for /R %G in (*.txt) do dos2unix "%G" .Ve .PP PowerShell users can use the following command in Windows PowerShell: .PP .Vb 1 \& get\-childitem \-path . \-filter \*(Aq*.txt\*(Aq \-recurse | foreach\-object {dos2unix $_.Fullname} .Ve .SH "LOKALISATIE" .IX Header "LOKALISATIE" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" De primaire taal wordt geselecteerd via de omgevingsvariabele \s-1LANG. \s0 De variabele \s-1LANG\s0 bestaat uit verschillende onderdelen. Het eerste deel is in kleine letters de taalcode. Het tweede deel is optioneel en is de landcode in hoofdletters, voorafgegaan door een liggend streepje. Er is ook een optioneel derde deel: de tekencodering, voorafgegaan door een punt. Enkele voorbeelden voor een POSIX-shell: .Sp .Vb 7 \& export LANG=nl Nederlands \& export LANG=nl_NL Nederlands, Nederland \& export LANG=nl_BE Nederlands, België \& export LANG=es_ES Spaans, Spanje \& export LANG=es_MX Spaans, Mexico \& export LANG=en_US.iso88591 Engels, VS, Latin\-1\-codering \& export LANG=en_GB.UTF\-8 Engels, GB, UTF\-8\-codering .Ve .Sp Voor een complete lijst van taal\- en landcodes zie de gettext-handleiding: .Sp Op Unix-systemen kunt u de opdracht \fBlocale\fR(1) gebruiken om specifieke taalregio-informatie te verkrijgen. .IP "\fB\s-1LANGUAGE\s0\fR" 4 .IX Item "LANGUAGE" Met de omgevingsvariabele \s-1LANGUAGE\s0 kunt u een prioriteitenlijst specificeren van talen, gescheiden door dubbele punten. Dos2unix geeft voorrang aan \&\s-1LANGUAGE\s0 boven \s-1LANG. \s0 Bijvoorbeeld, eerst Nederlands en dan Duits: \&\f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. U moet eerst lokalisatie in werking stellen, door het instellen van \s-1LANG \s0(of \s-1LC_ALL\s0) op een waarde ongelijk aan \*(L"C\*(R", voordat u een talen-prioriteitenlijst kunt gebruiken via de variabele \s-1LANGUAGE. \s0 Zie ook de gettext-handleiding: .Sp Als u een taal kiest die niet beschikbaar is, worden de standaard Engelse berichten gebruikt. .IP "\fB\s-1DOS2UNIX_LOCALEDIR\s0\fR" 4 .IX Item "DOS2UNIX_LOCALEDIR" Met de omgevingsvariabele \s-1DOS2UNIX_LOCALEDIR\s0 kan de \s-1LOCALEDIR\s0 die ingesteld werd tijdens compilatie worden overstemd. \s-1LOCALEDIR\s0 wordt gebruikt om de taalbestanden te vinden. De \s-1GNU\s0 standaardwaarde is \&\f(CW\*(C`/usr/local/share/locale\*(C'\fR. De optie \fB\-\-version\fR laat de gebruikte \&\s-1LOCALEDIR\s0 zien. .Sp Voorbeeld (POSIX-shell): .Sp .Vb 1 \& export DOS2UNIX_LOCALEDIR=$HOME/share/locale .Ve .SH "AFSLUITWAARDE" .IX Header "AFSLUITWAARDE" Bij succes wordt nul teruggegeven. Wanneer een systeemfout optreedt wordt het laatste systeemfoutnummer teruggegeven. Bij andere fouten wordt 1 teruggegeven. .PP De afsluitwaarde is altijd nul in de stillewerkingsmodus, behalve wanneer verkeerde opties worden gegeven. .SH "STANDAARDEN" .IX Header "STANDAARDEN" .PP .PP .PP .SH "AUTEURS" .IX Header "AUTEURS" Benjamin Lin \- , Bernd Johannes Wuebben (mac2unix\-modus) \- , Christian Wurll (toevoegen van extra regeleindes) \- , Erwin Waterlander \- (beheerder) .PP Projectpagina: .PP SourceForge-pagina: .SH "ZIE OOK" .IX Header "ZIE OOK" \&\fIfile\fR\|(1) \fIfind\fR\|(1) \fIiconv\fR\|(1) \fIlocale\fR\|(1) \fIxargs\fR\|(1) dos2unix-7.3.4/man/nl/man1/dos2unix.htm0000644000175500010010000010213712721132573017063 0ustar waterlanGeen dos2unix 7.3.4 - DOS/Mac naar Unix en vice versa tekstbestand formaat omzetter

NAAM

dos2unix - omzetter van tekstbestandsindelingen, van DOS/Mac naar Unix en vice versa

OVERZICHT

    dos2unix [opties] [BESTAND ...] [-n INVOERBESTAND UITVOERBESTAND ...]
    unix2dos [opties] [BESTAND ...] [-n INVOERBESTAND UITVOERBESTAND ...]

BESCHRIJVING

Het Dos2unix pakket bevat de toepassingen dos2unix en unix2dos om platte tekstbestanden in DOS- of Mac-indeling naar Unix-indeling om te zetten, en vice versa.

In DOS/Windows-tekstbestanden bestaat een regeleinde uit een combinatie van twee tekens: een 'Carriage Return' (CR) gevolgd door een 'Line Feed' (LF). In Unix-tekstbestanden bestaat een regeleinde uit één enkel 'Newline'-teken, dat gelijk is aan een DOS 'Line Feed'-teken (LF). In Mac-tekstbestanden, van vóór Mac OS X, bestaan regeleindes uit één enkel 'Carriage Return'-teken. Mac OS X is op Unix gebaseerd en heeft dezelfde regeleindes als Unix.

Naast regeleindes kan Dos2unix ook de codering van bestanden converteren. Enkele DOS-codetabellen kunnen omgezet worden naar Unix Latin-1. En Windows Unicode-bestanden (UTF-16) kunnen geconverteerd worden naar Unix Unicode-bestanden (UTF-8).

Binaire bestanden worden automatisch overgeslagen, behalve als de omzetting geforceerd wordt.

Niet-reguliere bestanden, zoals mappen en FIFO's, worden automatisch overgeslagen.

Symbolische koppelingen en hun doelen blijven standaard onaangeroerd. Optioneel kunnen symbolische koppelingen worden vervangen, of de uitvoer kan naar het doel van de symbolische koppeling worden geschreven. Op Windows wordt het schrijven naar het doel van een symbolische koppeling niet ondersteund.

Dos2unix is gemodelleerd naar dos2unix op SunOS/Solaris, maar er is een belangrijk verschil: deze versie van dos2unix voert standaard een vervangende conversie uit (oud-bestand-modus) terwijl de oorspronkelijke SunOS/Solaris-versie alleen de gepaarde conversie (nieuw-bestand-modus) kent. Zie ook de opties -o en -n. Een ander verschil is dat de SunOS/Solaris-versie standaard een conversie in iso-modus doet terwijl deze versie standaard ascii-modus gebruikt.

OPTIES

--

Alle volgende opties als bestandsnamen behandelen. Gebruik deze optie als u een bestand wilt converteren waarvan de naam met een streepje begint. Bijvoorbeeld, om een bestand genaamd "-foo" om te zetten, gebruikt u de volgende opdracht:

    dos2unix -- -foo

Of in nieuw-bestand-modus:

    dos2unix -n -- -foo uit.txt
-ascii

Alleen regeleindes converteren. Dit is de standaardconversiemodus.

-iso

Conversie tussen de tekensets DOS en ISO-8859-1. Zie ook de sectie CONVERSIEMODI.

-1252

Windows-codetabel 1252 (West-Europees) gebruiken.

-437

DOS-codetabel 437 (VS) gebruiken. Dit is de standaard codetabel die gebruikt wordt bij ISO-conversie.

-850

DOS-codetabel 850 (West-Europees) gebruiken.

-860

DOS-codetabel 860 (Portugees) gebruiken.

-863

DOS-codetabel 863 (Canadees Frans) gebruiken.

-865

DOS-codetabel 865 (Scandinavisch) gebruiken.

-7

Lettertekens met het achtste bit gezet converteren naar spaties.

-b, --keep-bom

Een Byte-Order-Mark (BOM) behouden. Als het invoerbestand een BOM bevat, dan wordt ook een BOM naar het uitvoerbestand geschreven. Dit is het standaardgedrag bij conversie naar DOS. Zie ook optie -r.

-c, --convmode CONVERSIEMODUS

De te gebruiken conversiemodus. CONVERSIEMODUS kan zijn: ascii, 7bit, iso, of mac, waarbij ascii de standaardinstelling is.

-D, --display-enc CODERING

De te gebruiken tekencodering voor weergegeven tekst. CODERING kan zijn: ansi, unicode, unicodebom, utf8, of utf8bom, waarbij ansi de standaardinstelling is.

Deze optie is alleen beschikbaar in dos2unix voor Windows met Unicode-bestandsnaam-ondersteuning. Deze optie heeft geen effect op de gelezen en geschreven bestandsnamen, maar alleen op hoe deze weergegeven worden.

There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages.

ansi

Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the chcp command, because dos2unix uses the Windows system code page.

The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK.

unicode, unicodebom

The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it.

When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font.

The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program.

When method unicodebom is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell.

utf8, utf8bom

The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the unicode encoding.

The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed.

In a ConEmu console the utf8 encoding method works well.

When method utf8bom is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell.

The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to unicode, unicodebom, utf8, or utf8bom.

-f, --force

Conversie van binaire bestanden afdwingen.

-gb, --gb18030

Op Windows worden UTF-16-bestanden standaard naar UTF-8 geconverteerd, ongeacht de ingestelde taalregio. Gebruik deze optie om UTF-16-bestanden naar GB18030 te converteren. Deze optie is alleen beschikbaar op Windows. Zie ook de sectie GB18030.

-h, --help

Een hulptekst tonen.

-i[VLAGGEN], --info[=VLAGGEN] BESTAND...

Bestandsinformatie tonen. Er wordt niets geconverteerd.

De volgende informatie wordt weergegeven, in deze volgorde: het aantal DOS-regeleindes, het aantal Unix-regeleindes, het aantal Mac-regeleindes, de Byte-Order-Mark, of het een tekst- of binair bestand is, en de bestandsnaam.

Voorbeelduitvoer:

     6       0       0  no_bom    text    dos.txt
     0       6       0  no_bom    text    unix.txt
     0       0       6  no_bom    text    mac.txt
     6       6       6  no_bom    text    mixed.txt
    50       0       0  UTF-16LE  text    utf16le.txt
     0      50       0  no_bom    text    utf8unix.txt
    50       0       0  UTF-8     text    utf8dos.txt
     2     418     219  no_bom    binary  dos2unix.exe

Merk op dat een binair bestand soms voor een tekstbestand aangezien kan worden. Zie ook optie -s.

Bij de optie kunnen één of meer vlaggen meegegeven worden om de uitvoer te beperken.

d

Het aantal DOS-regeleindes tonen.

u

Het aantal Unix-regeleindes tonen.

m

Het aantal Mac-regeleindes tonen.

b

De Byte-Order-Mark tonen.

t

Tonen of het bestand tekst is of binair.

c

Alleen de namen tonen van de bestanden die geconverteerd zouden worden.

Met de vlag c toont dos2unix alleen de bestanden die DOS-regeleindes bevatten, en unix2dos alleen de bestanden die Unix-regeleindes bevatten.

h

Een kopregel printen.

p

Bestandsnamen tonen zonder pad.

Voorbeelden:

Informatie weergeven voor alle bestanden met de extensie 'txt':

    dos2unix -i *.txt

Alleen de aantallen DOS-regeleindes en Unix-regeleindes tonen:

    dos2unix -idu *.txt

Alleen de Byte-Order-Mark tonen:

    dos2unix --info=b *.txt

De bestanden opsommen die DOS-regeleindes bevatten:

    dos2unix -ic *.txt

De bestanden opsommen die Unix-regeleindes bevatten:

    unix2dos -ic *.txt

Alleen bestanden die DOS-regeleindes bevatten converteren en andere bestanden ongemoeid laten:

    dos2unix -ic *.txt | xargs dos2unix

De bestanden vinden die DOS-regeleindes bevatten:

    find -name '*.txt' | xargs dos2unix -ic
-k, --keepdate

Het tijdsstempel van het invoerbestand behouden voor het uitvoerbestand.

-L, --license

De softwarelicentie tonen.

-l, --newline

Een extra regeleinde toevoegen.

dos2unix: Alleen DOS-regeleindes worden omgezet naar twee Unix-regeleindes. In Mac-modus worden alleen Mac-regeleindes omgezet naar twee Unix-regeleindes.

unix2dos: Alleen Unix-regeleindes worden omgezet naar twee DOS-regeleindes. In Mac-modus worden Unix-regeleindes omgezet naar twee Mac-regeleindes.

-m, --add-bom

Een Byte-Order-Mark (BOM) naar het uitvoerbestand schrijven. Standaard wordt een UTF-8-BOM geschreven.

Als het invoerbestand in UTF-16 is, en de optie -u is gegeven, dan wordt een UTF-16-BOM geschreven.

Gebruik deze optie nooit als de codering van het uitvoerbestand niet UTF-8, UTF-16, of GB18030 is. Zie ook de sectie UNICODE.

-n, --newfile INVOERBESTAND UITVOERBESTAND ...

Nieuw-bestand-modus. Het bestand INVOERBESTAND converteren en naar bestand UITVOERBESTAND schrijven. Bestandsnamen moeten opgegeven worden in paren. Jokertekens moeten nietgebruikt worden, anders verlies je de bestanden.

De gebruiker die de conversie start in nieuw-bestand (gepaarde) modus wordt de eigenaar van het geconverteerde bestand. De lees/schrijf-toegangsrechten van het nieuwe bestand worden de toegangsrechten van het originele bestand minus de umask(1) van de gebruiker die de conversie draait.

-o, --oldfile BESTAND ...

Oud-bestand-modus. Het bestand BESTAND converteren en overschrijven. Dit is de standaard modus. Jokertekens kunnen gebruikt worden.

In oud-bestand (vervangende) modus krijgt het geconverteerde bestand dezelfde eigenaar, groep en lees/schrijf-rechten als het originele bestand. Ook wanneer het bestand wordt omgezet door een andere gebruiker die schrijfrechten heeft op het bestand (b.v. gebruiker root). De omzetting wordt afgebroken wanneer het niet mogelijk is de originele waardes te behouden. Verandering van eigenaar kan betekenen dat de originele eigenaar het bestand niet meer kan lezen. Verandering van groep zou een veiligheidsrisico kunnen zijn, het bestand zou leesbaar kunnen worden voor personen voor wie het niet bestemd is. Behoud van eigenaar, groep en lees/schrijf-rechten wordt alleen ondersteund op Unix.

-q, --quiet

Stille werking. Alle waarschuwingen onderdrukken. De afsluitwaarde is nul, behalve wanneer verkeerde opties worden gegeven.

-r, --remove-bom

Een Byte-Order-Mark (BOM) verwijderen. Er wordt geen BOM naar het uitvoerbestand geschreven. Dit is het standaardgedrag bij conversie naar Unix. Zie ook optie -b.

-s, --safe

Binaire bestanden overslaan (standaard).

Binaire bestanden worden overgeslagen om vergissingen te voorkomen. Het detecteren van binaire bestanden is echter niet 100% betrouwbaar. Invoerbestanden worden gescand op binaire tekens die gewoonlijk niet in tekstbestanden voorkomen. Maar het is mogelijk dat een binair bestand enkel normale teksttekens bevat. Zo'n binair bestand zal dan foutief als een tekstbestand gezien worden.

-u, --keep-utf16

De originele UTF-16-codering van het invoerbestand behouden. Het uitvoerbestand wordt in dezelfde UTF-16-codering (little endian of big endian) geschreven als het invoerbestand. Dit voorkomt conversie naar UTF-8. Er wordt ook een corresponderende UTF-16-BOM geschreven. Deze optie kan uitgeschakeld worden met de optie -ascii.

-ul, --assume-utf16le

Veronderstellen dat de indeling van het invoerbestand UTF-16LE is.

Wanneer het invoerbestand een Byte-Order-Mark (BOM) bevat, dan gaat deze BOM vóór deze optie.

Wanneer een verkeerde aanname is gemaakt (het invoerbestand was geen UTF-16LE) en de conversie verliep met succes, dan krijgt u een UTF-8-bestand met verkeerde tekst. De verkeerde conversie kan ongedaan worden gemaakt door met iconv(1) het UTF-8-uitvoerbestand terug om te zetten naar UTF-16LE. Dit zal het originele bestand terug brengen.

De aanname van UTF-16LE werkt als een conversiemodus. Door de standaardmodus ascii in te schakelen wordt de UTF-16LE-veronderstelling uitgeschakeld.

-ub, --assume-utf16be

Veronderstellen dat de indeling van het invoerbestand UTF-16BE is.

Deze optie werkt hetzelfde als optie -ul.

-v, --verbose

Extra meldingen weergeven. Er wordt extra informatie getoond over Byte-Order-Marks en het aantal geconverteerde regeleindes.

Symbolische koppelingen volgen en de doelen converteren.

Symbolische koppelingen vervangen door geconverteerde bestanden (de originele doelbestanden blijven ongewijzigd).

Symbolische koppelingen en doelen ongewijzigd laten (standaard).

-V, --version

Versie-informatie tonen.

MAC-MODUS

In normale modus worden DOS-regeleindes naar Unix omgezet en vice versa. Mac-regeleindes worden niet omgezet.

In Mac-modus worden Mac-regeleindes naar Unix omgezet en vice versa. DOS-regeleindes blijven ongewijzigd.

Om in Mac-modus te draaien kunt u de opdrachtregeloptie -c mac gebruiken, of de opdrachten mac2unix of unix2mac.

CONVERSIEMODI

ascii

In modus ascii worden alleen regeleindes omgezet. Dit is de standaardmodus.

Hoewel de naam van deze modus ASCII is, wat een 7-bits standaard is, is de werkelijke modus 8-bits. Gebruik altijd deze modus wanneer u Unicode UTF-8-bestanden omzet.

7bit

Alle 8-bits niet-ASCII lettertekens (met waardes van 128 t/m 255) worden omgezet naar een 7-bits spatie.

iso

Tekens worden omgezet tussen een DOS-tekenset (codetabel) en de ISO-tekenset ISO-8859-1 (Latin-1) op Unix. DOS-tekens zonder een ISO-8859-1-equivalent, waarvoor dus geen omzetting mogelijk is, worden omgezet in een punt. Hetzelfde geldt voor ISO-8859-1-tekens zonder DOS-tegenhanger.

Wanneer alleen optie -iso gebruikt wordt, zal dos2unix proberen de actieve codetabel te gebruiken. Als dat niet mogelijk is wordt codetabel CP437 gebruikt, die vooral in de VS gebruikt wordt. Om een bepaalde codetabel te forceren, kunt u de opties -850 (West-Europees), -860 (Portugees), -863 (Canadees Frans) of -865 (Scandinavisch) gebruiken. Windows-codetabel CP1252 (West-Europees) wordt ook ondersteund met optie -1252. Gebruik voor andere codetabellen dos2unix in combinatie met iconv(1). Iconv kan omzetten tussen een lange lijst tekensetcoderingen.

Gebruik ISO-conversie nooit op Unicode-tekstbestanden. Het zal UTF-8-gecodeerde bestanden beschadigen.

Enkele voorbeelden:

Omzetten van de standaard DOS-codetabel naar Unix Latin-1:

    dos2unix -iso -n in.txt uit.txt

Omzetten van DOS CP850 naar Unix Latin-1:

    dos2unix -850 -n in.txt uit.txt

Omzetten van Windows CP1252 naar Unix Latin-1:

    dos2unix -1252 -n in.txt uit.txt

Omzetten van Windows CP1252 naar Unix UTF-8 (Unicode):

    iconv -f CP1252 -t UTF-8 in.txt | dos2unix > uit.txt

Omzetten van Unix Latin-1 naar de standaard DOS-codetabel:

    unix2dos -iso -n in.txt uit.txt

Omzetten van Unix Latin-1 naar DOS CP850:

    unix2dos -850 -n in.txt uit.txt

Omzetten van Unix Latin-1 naar Windows CP1252:

    unix2dos -1252 -n in.txt uit.txt

Omzetten van Unix UTF-8 (Unicode) naar Windows CP1252:

    unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > uit.txt

Zie ook http://czyborra.com/charsets/codepages.html en http://czyborra.com/charsets/iso8859.html.

UNICODE

Coderingen

Er bestaan verschillende Unicode-coderingen. Op Unix en Linux zijn Unicode-bestanden typisch gecodeerd in UTF-8. Op Windows kunnen Unicode-tekstbestanden gecodeerd zijn in UTF-8, UTF-16 of UTF-16 big endian, maar ze zijn meestal gecodeerd in UTF-16.

Conversie

Unicode-tekstbestanden kunnen DOS-, Unix- of Mac-regeleindes hebben, net als reguliere tekstbestanden.

Alle versies van dos2unix en unix2dos kunnen UTF-8-gecodeerde bestanden omzetten, want UTF-8 is ontworpen op compatibiliteit met ASCII.

Dos2unix en unix2dos met Unicode UTF-16-ondersteuning kunnen little en big endian UTF-16-gecodeerde tekstbestanden lezen. Om er achter te komen of dos2unix gebouwd is met UTF-16- ondersteuning, typt u dos2unix -V.

Op Unix/Linux worden UTF-16-bestanden geconverteerd naar de codering van de ingestelde taalregio. Gebruik de opdracht locale(1) om te zien wat de ingestelde codering is. Wanneer conversie niet mogelijk is, treedt er een fout op en wordt het bestand overgeslagen.

Op Windows worden UTF-16-bestanden standaard naar UTF-8 geconverteerd. UTF-8-tekstbestanden worden alom goed ondersteund, zowel op Windows als Unix/Linux.

De UTF-16- en UTF-8-coderingen zijn volledig compatibel, er gaat bij het converteren niets verloren. Als er tijdens de conversie van UTF-16 naar UTF-8 een fout optreedt, bijvoorbeeld omdat het UTF-16-invoerbestand een fout bevat, dan wordt het bestand overgeslagen.

Wanneer -u gebruikt wordt, wordt het uitvoerbestand in dezelfde UTF-16-codering geschreven als het invoerbestand. Optie -u voorkomt conversie naar UTF-8.

Dos2unix en unix2dos hebben geen optie om van UTF-8 naar UTF-16 te converteren.

ISO- en 7-bits-conversie werken niet op UTF-16-bestanden.

Byte-Order-Mark

Op Windows bevatten Unicode-tekstbestanden gewoonlijk een Byte-Order-Mark (BOM), omdat veel Windows-programma's (inclusief Kladblok) standaard een BOM toevoegen. Zie ook http://en.wikipedia.org/wiki/Byte_order_mark.

Op Unix hebben Unicode-tekstbestanden meestal geen BOM. Er wordt aangenomen dat de codering van tekstbestanden gelijk is aan de tekencodering van de ingestelde taalregio.

Dos2unix kan alleen detecteren of een bestand in UTF-16-codering is als het bestand een BOM bevat. Wanneer een UTF-16-bestand geen BOM heeft, ziet dos2unix het bestand als een binair bestand.

Gebruik optie -ul of -ub om een UTF-16-bestand zonder BOM om te zetten.

Dos2unix schrijft standaard geen BOM in het uitvoerbestand. Met optie -b schrijft dos2unix een BOM wanneer het invoerbestand een BOM bevat.

Unix2dos schrijft standaard een BOM in het uitvoerbestand wanneer het invoerbestand een BOM bevat. Gebruik optie -r om de BOM te verwijderen.

Dos2unix en unix2dos schrijven altijd een BOM wanneer optie -m gebruikt wordt.

Unicode-bestandsnamen op Windows

Dos2unix heeft optionele ondersteuning voor het lezen en schrijven van Unicode-bestandsnamen in de Windows Opdrachtprompt. Dit betekent dat dos2unix bestanden kan openen waarvan de naam tekens bevat die niet voorkomen in de standaard ANSI-codetabel. Om te zien of dos2unix voor Windows gecompileerd werd met ondersteuning voor Unicode-bestandsnamen, typt u dos2unix -V.

Er zijn enige problemen met het weergeven van Unicode-bestandsnamen in een Windows-console; zie bij optie -D, --display-enc. De bestandsnamen kunnen verkeerd weergegeven worden, maar de bestanden zullen geschreven worden met de correcte naam.

Unicode-voorbeelden

Omzetten van Windows UTF-16 (met BOM) naar Unix UTF-8:

    dos2unix -n in.txt uit.txt

Omzetten van Windows UTF-16LE (zonder BOM) naar Unix UTF-8:

    dos2unix -ul -n in.txt uit.txt

Omzetten van Unix UTF-8 naar Windows UTF-8 met BOM:

    unix2dos -m -n in.txt uit.txt

Omzetten van Unix UTF-8 naar Windows UTF-16:

    unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > uit.txt

GB18030

GB18030 is een standaard van de Chinese overheid. Een subset van de GB18030-standaard is officieel verplicht voor alle softwareproducten die in China verkocht worden. Zie ook http://en.wikipedia.org/wiki/GB_18030.

GB18030 is volledig compatibel met Unicode, en kan als een Unicodetransformatie beschouwd worden. Net als UTF-8 is GB18030 compatibel met ASCII. GB18030 is ook compatibel met Windows-codetabel 936 (ook wel GBK genoemd).

Op Unix/Linux worden UTF-16-bestanden naar GB18030 geconverteerd wanneer de taalregio-codering GB18030 is. Merk op dat dit alleen werkt als deze taalregio-instelling door het systeem ondersteund wordt. Gebruik het commando locale -a voor een overzicht van de beschikbare taalregio's.

Op Windows dient u de optie -gb te gebruiken om UTF-16-bestanden naar GB18030 te converteren.

GB18030-bestanden kunnen een Byte-Order-Mark bevatten, net als Unicode-bestanden.

VOORBEELDEN

Invoer lezen van standaardinvoer en uitvoer schrijven naar standaarduitvoer:

    dos2unix < a.txt
    cat a.txt | dos2unix

Omzetten en vervangen van a.txt; omzetten en vervangen van b.txt:

    dos2unix a.txt b.txt
    dos2unix -o a.txt b.txt

Omzetten en vervangen van a.txt in ascii-conversiemodus:

    dos2unix a.txt

Omzetten en vervangen van a.txt in ascii-conversiemodus; omzetten en vervangen van b.txt in 7-bits conversiemodus:

    dos2unix a.txt -c 7bit b.txt
    dos2unix -c ascii a.txt -c 7bit b.txt
    dos2unix -ascii a.txt -7 b.txt

Omzetten van a.txt van Mac- naar Unix-indeling:

    dos2unix -c mac a.txt
    mac2unix a.txt

Omzetten van a.txt van Unix- naar Mac-indeling:

    unix2dos -c mac a.txt
    unix2mac a.txt

Omzetten en vervangen van a.txt met behoud van origineel tijdsstempel:

    dos2unix -k a.txt
    dos2unix -k -o a.txt

Omzetten van a.txt en resultaat naar e.txt schrijven:

    dos2unix -n a.txt e.txt

Omzetten van a.txt en naar e.txt schrijven, met tijdsstempel van e.txt gelijk aan die van a.txt:

    dos2unix -k -n a.txt e.txt

Omzetten en vervangen van a.txt; omzetten van b.txt en naar e.txt schrijven:

    dos2unix a.txt -n b.txt e.txt
    dos2unix -o a.txt -n b.txt e.txt

Omzetten van c.txt en naar e.txt schrijven; omzetten en vervangen van a.txt; omzetten en vervangen van b.txt; omzetten van d.txt en naar f.txt schrijven.

    dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt

RECURSIEVE CONVERSIE

Gebruik dos2unix in combinatie met de opdrachten find(1) en xargs(1) om tekstbestanden in een mappenboom recursief om te zetten. Bijvoorbeeld om alle .txt-bestanden in de mappenboom onder de huidige map te converteren, typt u:

    find . -name '*.txt' | xargs dos2unix

In een Windows Opdrachtprompt kan de volgende opdracht gebruikt worden:

    for /R %G in (*.txt) do dos2unix "%G"

PowerShell users can use the following command in Windows PowerShell:

    get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}

LOKALISATIE

LANG

De primaire taal wordt geselecteerd via de omgevingsvariabele LANG. De variabele LANG bestaat uit verschillende onderdelen. Het eerste deel is in kleine letters de taalcode. Het tweede deel is optioneel en is de landcode in hoofdletters, voorafgegaan door een liggend streepje. Er is ook een optioneel derde deel: de tekencodering, voorafgegaan door een punt. Enkele voorbeelden voor een POSIX-shell:

    export LANG=nl               Nederlands
    export LANG=nl_NL            Nederlands, Nederland
    export LANG=nl_BE            Nederlands, België
    export LANG=es_ES            Spaans, Spanje
    export LANG=es_MX            Spaans, Mexico
    export LANG=en_US.iso88591   Engels, VS, Latin-1-codering
    export LANG=en_GB.UTF-8      Engels, GB, UTF-8-codering

Voor een complete lijst van taal- en landcodes zie de gettext-handleiding: http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

Op Unix-systemen kunt u de opdracht locale(1) gebruiken om specifieke taalregio-informatie te verkrijgen.

LANGUAGE

Met de omgevingsvariabele LANGUAGE kunt u een prioriteitenlijst specificeren van talen, gescheiden door dubbele punten. Dos2unix geeft voorrang aan LANGUAGE boven LANG. Bijvoorbeeld, eerst Nederlands en dan Duits: LANGUAGE=nl:de. U moet eerst lokalisatie in werking stellen, door het instellen van LANG (of LC_ALL) op een waarde ongelijk aan "C", voordat u een talen-prioriteitenlijst kunt gebruiken via de variabele LANGUAGE. Zie ook de gettext-handleiding: http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

Als u een taal kiest die niet beschikbaar is, worden de standaard Engelse berichten gebruikt.

DOS2UNIX_LOCALEDIR

Met de omgevingsvariabele DOS2UNIX_LOCALEDIR kan de LOCALEDIR die ingesteld werd tijdens compilatie worden overstemd. LOCALEDIR wordt gebruikt om de taalbestanden te vinden. De GNU standaardwaarde is /usr/local/share/locale. De optie --version laat de gebruikte LOCALEDIR zien.

Voorbeeld (POSIX-shell):

    export DOS2UNIX_LOCALEDIR=$HOME/share/locale

AFSLUITWAARDE

Bij succes wordt nul teruggegeven. Wanneer een systeemfout optreedt wordt het laatste systeemfoutnummer teruggegeven. Bij andere fouten wordt 1 teruggegeven.

De afsluitwaarde is altijd nul in de stillewerkingsmodus, behalve wanneer verkeerde opties worden gegeven.

STANDAARDEN

http://nl.wikipedia.org/wiki/Tekstbestand

http://nl.wikipedia.org/wiki/Carriage_Return

http://nl.wikipedia.org/wiki/Linefeed

<http://nl.wikipedia.org/wiki/Unicode>

AUTEURS

Benjamin Lin - <blin@socs.uts.edu.au>, Bernd Johannes Wuebben (mac2unix-modus) - <wuebben@kde.org>, Christian Wurll (toevoegen van extra regeleindes) - <wurll@ira.uka.de>, Erwin Waterlander - <waterlan@xs4all.nl> (beheerder)

Projectpagina: http://waterlan.home.xs4all.nl/dos2unix.html

SourceForge-pagina: http://sourceforge.net/projects/dos2unix/

ZIE OOK

file(1) find(1) iconv(1) locale(1) xargs(1)

dos2unix-7.3.4/man/nl/man1/dos2unix.pod0000644000175500010010000006514712721132557017070 0ustar waterlanGeen ***************************************************** * GENERATED FILE, DO NOT EDIT * * THIS IS NO SOURCE FILE, BUT RESULT OF COMPILATION * ***************************************************** This file was generated by po4a(7). Do not store it (in VCS, for example), but store the PO file used as source file by po4a-translate. In fact, consider this as a binary, and the PO file as a regular .c file: If the PO get lost, keeping this translation up-to-date will be harder. =pod =encoding UTF-8 =head1 NAAM dos2unix - omzetter van tekstbestandsindelingen, van DOS/Mac naar Unix en vice versa =head1 OVERZICHT dos2unix [opties] [BESTAND ...] [-n INVOERBESTAND UITVOERBESTAND ...] unix2dos [opties] [BESTAND ...] [-n INVOERBESTAND UITVOERBESTAND ...] =head1 BESCHRIJVING Het Dos2unix pakket bevat de toepassingen C en C om platte tekstbestanden in DOS- of Mac-indeling naar Unix-indeling om te zetten, en vice versa. In DOS/Windows-tekstbestanden bestaat een regeleinde uit een combinatie van twee tekens: een 'Carriage Return' (CR) gevolgd door een 'Line Feed' (LF). In Unix-tekstbestanden bestaat een regeleinde uit één enkel 'Newline'-teken, dat gelijk is aan een DOS 'Line Feed'-teken (LF). In Mac-tekstbestanden, van vóór Mac OS X, bestaan regeleindes uit één enkel 'Carriage Return'-teken. Mac OS X is op Unix gebaseerd en heeft dezelfde regeleindes als Unix. Naast regeleindes kan Dos2unix ook de codering van bestanden converteren. Enkele DOS-codetabellen kunnen omgezet worden naar Unix Latin-1. En Windows Unicode-bestanden (UTF-16) kunnen geconverteerd worden naar Unix Unicode-bestanden (UTF-8). Binaire bestanden worden automatisch overgeslagen, behalve als de omzetting geforceerd wordt. Niet-reguliere bestanden, zoals mappen en FIFO's, worden automatisch overgeslagen. Symbolische koppelingen en hun doelen blijven standaard onaangeroerd. Optioneel kunnen symbolische koppelingen worden vervangen, of de uitvoer kan naar het doel van de symbolische koppeling worden geschreven. Op Windows wordt het schrijven naar het doel van een symbolische koppeling niet ondersteund. Dos2unix is gemodelleerd naar dos2unix op SunOS/Solaris, maar er is een belangrijk verschil: deze versie van dos2unix voert standaard een vervangende conversie uit (oud-bestand-modus) terwijl de oorspronkelijke SunOS/Solaris-versie alleen de gepaarde conversie (nieuw-bestand-modus) kent. Zie ook de opties C<-o> en C<-n>. Een ander verschil is dat de SunOS/Solaris-versie standaard een conversie in I-modus doet terwijl deze versie standaard I-modus gebruikt. =head1 OPTIES =over 4 =item B<--> Alle volgende opties als bestandsnamen behandelen. Gebruik deze optie als u een bestand wilt converteren waarvan de naam met een streepje begint. Bijvoorbeeld, om een bestand genaamd "-foo" om te zetten, gebruikt u de volgende opdracht: dos2unix -- -foo Of in nieuw-bestand-modus: dos2unix -n -- -foo uit.txt =item B<-ascii> Alleen regeleindes converteren. Dit is de standaardconversiemodus. =item B<-iso> Conversie tussen de tekensets DOS en ISO-8859-1. Zie ook de sectie B. =item B<-1252> Windows-codetabel 1252 (West-Europees) gebruiken. =item B<-437> DOS-codetabel 437 (VS) gebruiken. Dit is de standaard codetabel die gebruikt wordt bij ISO-conversie. =item B<-850> DOS-codetabel 850 (West-Europees) gebruiken. =item B<-860> DOS-codetabel 860 (Portugees) gebruiken. =item B<-863> DOS-codetabel 863 (Canadees Frans) gebruiken. =item B<-865> DOS-codetabel 865 (Scandinavisch) gebruiken. =item B<-7> Lettertekens met het achtste bit gezet converteren naar spaties. =item B<-b>, B<--keep-bom> Een Byte-Order-Mark (BOM) behouden. Als het invoerbestand een BOM bevat, dan wordt ook een BOM naar het uitvoerbestand geschreven. Dit is het standaardgedrag bij conversie naar DOS. Zie ook optie C<-r>. =item B<-c>, B<--convmode CONVERSIEMODUS> De te gebruiken conversiemodus. CONVERSIEMODUS kan zijn: I, I<7bit>, I, of I, waarbij ascii de standaardinstelling is. =item B<-D>, B<--display-enc CODERING> De te gebruiken tekencodering voor weergegeven tekst. CODERING kan zijn: I, I, I, I, of I, waarbij ansi de standaardinstelling is. Deze optie is alleen beschikbaar in dos2unix voor Windows met Unicode-bestandsnaam-ondersteuning. Deze optie heeft geen effect op de gelezen en geschreven bestandsnamen, maar alleen op hoe deze weergegeven worden. There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages. =over 4 =item B Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page. The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK. =item B, B The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it. When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font. The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program. When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. =item B, B The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding. The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed. In a ConEmu console the utf8 encoding method works well. When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. =back The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C. =item B<-f>, B<--force> Conversie van binaire bestanden afdwingen. =item B<-gb>, B<--gb18030> Op Windows worden UTF-16-bestanden standaard naar UTF-8 geconverteerd, ongeacht de ingestelde taalregio. Gebruik deze optie om UTF-16-bestanden naar GB18030 te converteren. Deze optie is alleen beschikbaar op Windows. Zie ook de sectie B. =item B<-h>, B<--help> Een hulptekst tonen. =item B<-i>[B], B<--info>[B<=VLAGGEN>] B... Bestandsinformatie tonen. Er wordt niets geconverteerd. De volgende informatie wordt weergegeven, in deze volgorde: het aantal DOS-regeleindes, het aantal Unix-regeleindes, het aantal Mac-regeleindes, de Byte-Order-Mark, of het een tekst- of binair bestand is, en de bestandsnaam. Voorbeelduitvoer: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Merk op dat een binair bestand soms voor een tekstbestand aangezien kan worden. Zie ook optie C<-s>. Bij de optie kunnen één of meer vlaggen meegegeven worden om de uitvoer te beperken. =over 4 =item B Het aantal DOS-regeleindes tonen. =item B Het aantal Unix-regeleindes tonen. =item B Het aantal Mac-regeleindes tonen. =item B De Byte-Order-Mark tonen. =item B Tonen of het bestand tekst is of binair. =item B Alleen de namen tonen van de bestanden die geconverteerd zouden worden. Met de vlag C toont dos2unix alleen de bestanden die DOS-regeleindes bevatten, en unix2dos alleen de bestanden die Unix-regeleindes bevatten. =item B Een kopregel printen. =item B

Bestandsnamen tonen zonder pad. =back Voorbeelden: Informatie weergeven voor alle bestanden met de extensie 'txt': dos2unix -i *.txt Alleen de aantallen DOS-regeleindes en Unix-regeleindes tonen: dos2unix -idu *.txt Alleen de Byte-Order-Mark tonen: dos2unix --info=b *.txt De bestanden opsommen die DOS-regeleindes bevatten: dos2unix -ic *.txt De bestanden opsommen die Unix-regeleindes bevatten: unix2dos -ic *.txt Alleen bestanden die DOS-regeleindes bevatten converteren en andere bestanden ongemoeid laten: dos2unix -ic *.txt | xargs dos2unix De bestanden vinden die DOS-regeleindes bevatten: find -name '*.txt' | xargs dos2unix -ic =item B<-k>, B<--keepdate> Het tijdsstempel van het invoerbestand behouden voor het uitvoerbestand. =item B<-L>, B<--license> De softwarelicentie tonen. =item B<-l>, B<--newline> Een extra regeleinde toevoegen. B: Alleen DOS-regeleindes worden omgezet naar twee Unix-regeleindes. In Mac-modus worden alleen Mac-regeleindes omgezet naar twee Unix-regeleindes. B: Alleen Unix-regeleindes worden omgezet naar twee DOS-regeleindes. In Mac-modus worden Unix-regeleindes omgezet naar twee Mac-regeleindes. =item B<-m>, B<--add-bom> Een Byte-Order-Mark (BOM) naar het uitvoerbestand schrijven. Standaard wordt een UTF-8-BOM geschreven. Als het invoerbestand in UTF-16 is, en de optie C<-u> is gegeven, dan wordt een UTF-16-BOM geschreven. Gebruik deze optie nooit als de codering van het uitvoerbestand niet UTF-8, UTF-16, of GB18030 is. Zie ook de sectie B. =item B<-n>, B<--newfile INVOERBESTAND UITVOERBESTAND> ... Nieuw-bestand-modus. Het bestand INVOERBESTAND converteren en naar bestand UITVOERBESTAND schrijven. Bestandsnamen moeten opgegeven worden in paren. Jokertekens moeten Igebruikt worden, anders I je de bestanden. De gebruiker die de conversie start in nieuw-bestand (gepaarde) modus wordt de eigenaar van het geconverteerde bestand. De lees/schrijf-toegangsrechten van het nieuwe bestand worden de toegangsrechten van het originele bestand minus de umask(1) van de gebruiker die de conversie draait. =item B<-o>, B<--oldfile BESTAND> ... Oud-bestand-modus. Het bestand BESTAND converteren en overschrijven. Dit is de standaard modus. Jokertekens kunnen gebruikt worden. In oud-bestand (vervangende) modus krijgt het geconverteerde bestand dezelfde eigenaar, groep en lees/schrijf-rechten als het originele bestand. Ook wanneer het bestand wordt omgezet door een andere gebruiker die schrijfrechten heeft op het bestand (b.v. gebruiker root). De omzetting wordt afgebroken wanneer het niet mogelijk is de originele waardes te behouden. Verandering van eigenaar kan betekenen dat de originele eigenaar het bestand niet meer kan lezen. Verandering van groep zou een veiligheidsrisico kunnen zijn, het bestand zou leesbaar kunnen worden voor personen voor wie het niet bestemd is. Behoud van eigenaar, groep en lees/schrijf-rechten wordt alleen ondersteund op Unix. =item B<-q>, B<--quiet> Stille werking. Alle waarschuwingen onderdrukken. De afsluitwaarde is nul, behalve wanneer verkeerde opties worden gegeven. =item B<-r>, B<--remove-bom> Een Byte-Order-Mark (BOM) verwijderen. Er wordt geen BOM naar het uitvoerbestand geschreven. Dit is het standaardgedrag bij conversie naar Unix. Zie ook optie C<-b>. =item B<-s>, B<--safe> Binaire bestanden overslaan (standaard). Binaire bestanden worden overgeslagen om vergissingen te voorkomen. Het detecteren van binaire bestanden is echter niet 100% betrouwbaar. Invoerbestanden worden gescand op binaire tekens die gewoonlijk niet in tekstbestanden voorkomen. Maar het is mogelijk dat een binair bestand enkel normale teksttekens bevat. Zo'n binair bestand zal dan foutief als een tekstbestand gezien worden. =item B<-u>, B<--keep-utf16> De originele UTF-16-codering van het invoerbestand behouden. Het uitvoerbestand wordt in dezelfde UTF-16-codering (little endian of big endian) geschreven als het invoerbestand. Dit voorkomt conversie naar UTF-8. Er wordt ook een corresponderende UTF-16-BOM geschreven. Deze optie kan uitgeschakeld worden met de optie C<-ascii>. =item B<-ul>, B<--assume-utf16le> Veronderstellen dat de indeling van het invoerbestand UTF-16LE is. Wanneer het invoerbestand een Byte-Order-Mark (BOM) bevat, dan gaat deze BOM vóór deze optie. Wanneer een verkeerde aanname is gemaakt (het invoerbestand was geen UTF-16LE) en de conversie verliep met succes, dan krijgt u een UTF-8-bestand met verkeerde tekst. De verkeerde conversie kan ongedaan worden gemaakt door met iconv(1) het UTF-8-uitvoerbestand terug om te zetten naar UTF-16LE. Dit zal het originele bestand terug brengen. De aanname van UTF-16LE werkt als een I. Door de standaardmodus I in te schakelen wordt de UTF-16LE-veronderstelling uitgeschakeld. =item B<-ub>, B<--assume-utf16be> Veronderstellen dat de indeling van het invoerbestand UTF-16BE is. Deze optie werkt hetzelfde als optie C<-ul>. =item B<-v>, B<--verbose> Extra meldingen weergeven. Er wordt extra informatie getoond over Byte-Order-Marks en het aantal geconverteerde regeleindes. =item B<-F>, B<--follow-symlink> Symbolische koppelingen volgen en de doelen converteren. =item B<-R>, B<--replace-symlink> Symbolische koppelingen vervangen door geconverteerde bestanden (de originele doelbestanden blijven ongewijzigd). =item B<-S>, B<--skip-symlink> Symbolische koppelingen en doelen ongewijzigd laten (standaard). =item B<-V>, B<--version> Versie-informatie tonen. =back =head1 MAC-MODUS In normale modus worden DOS-regeleindes naar Unix omgezet en vice versa. Mac-regeleindes worden niet omgezet. In Mac-modus worden Mac-regeleindes naar Unix omgezet en vice versa. DOS-regeleindes blijven ongewijzigd. Om in Mac-modus te draaien kunt u de opdrachtregeloptie C<-c mac> gebruiken, of de opdrachten C of C. =head1 CONVERSIEMODI =over 4 =item B In modus C worden alleen regeleindes omgezet. Dit is de standaardmodus. Hoewel de naam van deze modus ASCII is, wat een 7-bits standaard is, is de werkelijke modus 8-bits. Gebruik altijd deze modus wanneer u Unicode UTF-8-bestanden omzet. =item B<7bit> Alle 8-bits niet-ASCII lettertekens (met waardes van 128 t/m 255) worden omgezet naar een 7-bits spatie. =item B Tekens worden omgezet tussen een DOS-tekenset (codetabel) en de ISO-tekenset ISO-8859-1 (Latin-1) op Unix. DOS-tekens zonder een ISO-8859-1-equivalent, waarvoor dus geen omzetting mogelijk is, worden omgezet in een punt. Hetzelfde geldt voor ISO-8859-1-tekens zonder DOS-tegenhanger. Wanneer alleen optie C<-iso> gebruikt wordt, zal dos2unix proberen de actieve codetabel te gebruiken. Als dat niet mogelijk is wordt codetabel CP437 gebruikt, die vooral in de VS gebruikt wordt. Om een bepaalde codetabel te forceren, kunt u de opties C<-850> (West-Europees), C<-860> (Portugees), C<-863> (Canadees Frans) of C<-865> (Scandinavisch) gebruiken. Windows-codetabel CP1252 (West-Europees) wordt ook ondersteund met optie C<-1252>. Gebruik voor andere codetabellen dos2unix in combinatie met iconv(1). Iconv kan omzetten tussen een lange lijst tekensetcoderingen. Gebruik ISO-conversie nooit op Unicode-tekstbestanden. Het zal UTF-8-gecodeerde bestanden beschadigen. Enkele voorbeelden: Omzetten van de standaard DOS-codetabel naar Unix Latin-1: dos2unix -iso -n in.txt uit.txt Omzetten van DOS CP850 naar Unix Latin-1: dos2unix -850 -n in.txt uit.txt Omzetten van Windows CP1252 naar Unix Latin-1: dos2unix -1252 -n in.txt uit.txt Omzetten van Windows CP1252 naar Unix UTF-8 (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > uit.txt Omzetten van Unix Latin-1 naar de standaard DOS-codetabel: unix2dos -iso -n in.txt uit.txt Omzetten van Unix Latin-1 naar DOS CP850: unix2dos -850 -n in.txt uit.txt Omzetten van Unix Latin-1 naar Windows CP1252: unix2dos -1252 -n in.txt uit.txt Omzetten van Unix UTF-8 (Unicode) naar Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > uit.txt Zie ook L en L. =back =head1 UNICODE =head2 Coderingen Er bestaan verschillende Unicode-coderingen. Op Unix en Linux zijn Unicode-bestanden typisch gecodeerd in UTF-8. Op Windows kunnen Unicode-tekstbestanden gecodeerd zijn in UTF-8, UTF-16 of UTF-16 big endian, maar ze zijn meestal gecodeerd in UTF-16. =head2 Conversie Unicode-tekstbestanden kunnen DOS-, Unix- of Mac-regeleindes hebben, net als reguliere tekstbestanden. Alle versies van dos2unix en unix2dos kunnen UTF-8-gecodeerde bestanden omzetten, want UTF-8 is ontworpen op compatibiliteit met ASCII. Dos2unix en unix2dos met Unicode UTF-16-ondersteuning kunnen little en big endian UTF-16-gecodeerde tekstbestanden lezen. Om er achter te komen of dos2unix gebouwd is met UTF-16- ondersteuning, typt u C. Op Unix/Linux worden UTF-16-bestanden geconverteerd naar de codering van de ingestelde taalregio. Gebruik de opdracht B(1) om te zien wat de ingestelde codering is. Wanneer conversie niet mogelijk is, treedt er een fout op en wordt het bestand overgeslagen. Op Windows worden UTF-16-bestanden standaard naar UTF-8 geconverteerd. UTF-8-tekstbestanden worden alom goed ondersteund, zowel op Windows als Unix/Linux. De UTF-16- en UTF-8-coderingen zijn volledig compatibel, er gaat bij het converteren niets verloren. Als er tijdens de conversie van UTF-16 naar UTF-8 een fout optreedt, bijvoorbeeld omdat het UTF-16-invoerbestand een fout bevat, dan wordt het bestand overgeslagen. Wanneer C<-u> gebruikt wordt, wordt het uitvoerbestand in dezelfde UTF-16-codering geschreven als het invoerbestand. Optie C<-u> voorkomt conversie naar UTF-8. Dos2unix en unix2dos hebben geen optie om van UTF-8 naar UTF-16 te converteren. ISO- en 7-bits-conversie werken niet op UTF-16-bestanden. =head2 Byte-Order-Mark Op Windows bevatten Unicode-tekstbestanden gewoonlijk een Byte-Order-Mark (BOM), omdat veel Windows-programma's (inclusief Kladblok) standaard een BOM toevoegen. Zie ook L. Op Unix hebben Unicode-tekstbestanden meestal geen BOM. Er wordt aangenomen dat de codering van tekstbestanden gelijk is aan de tekencodering van de ingestelde taalregio. Dos2unix kan alleen detecteren of een bestand in UTF-16-codering is als het bestand een BOM bevat. Wanneer een UTF-16-bestand geen BOM heeft, ziet dos2unix het bestand als een binair bestand. Gebruik optie C<-ul> of C<-ub> om een UTF-16-bestand zonder BOM om te zetten. Dos2unix schrijft standaard geen BOM in het uitvoerbestand. Met optie C<-b> schrijft dos2unix een BOM wanneer het invoerbestand een BOM bevat. Unix2dos schrijft standaard een BOM in het uitvoerbestand wanneer het invoerbestand een BOM bevat. Gebruik optie C<-r> om de BOM te verwijderen. Dos2unix en unix2dos schrijven altijd een BOM wanneer optie C<-m> gebruikt wordt. =head2 Unicode-bestandsnamen op Windows Dos2unix heeft optionele ondersteuning voor het lezen en schrijven van Unicode-bestandsnamen in de Windows Opdrachtprompt. Dit betekent dat dos2unix bestanden kan openen waarvan de naam tekens bevat die niet voorkomen in de standaard ANSI-codetabel. Om te zien of dos2unix voor Windows gecompileerd werd met ondersteuning voor Unicode-bestandsnamen, typt u C. Er zijn enige problemen met het weergeven van Unicode-bestandsnamen in een Windows-console; zie bij optie C<-D>, C<--display-enc>. De bestandsnamen kunnen verkeerd weergegeven worden, maar de bestanden zullen geschreven worden met de correcte naam. =head2 Unicode-voorbeelden Omzetten van Windows UTF-16 (met BOM) naar Unix UTF-8: dos2unix -n in.txt uit.txt Omzetten van Windows UTF-16LE (zonder BOM) naar Unix UTF-8: dos2unix -ul -n in.txt uit.txt Omzetten van Unix UTF-8 naar Windows UTF-8 met BOM: unix2dos -m -n in.txt uit.txt Omzetten van Unix UTF-8 naar Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > uit.txt =head1 GB18030 GB18030 is een standaard van de Chinese overheid. Een subset van de GB18030-standaard is officieel verplicht voor alle softwareproducten die in China verkocht worden. Zie ook L. GB18030 is volledig compatibel met Unicode, en kan als een Unicodetransformatie beschouwd worden. Net als UTF-8 is GB18030 compatibel met ASCII. GB18030 is ook compatibel met Windows-codetabel 936 (ook wel GBK genoemd). Op Unix/Linux worden UTF-16-bestanden naar GB18030 geconverteerd wanneer de taalregio-codering GB18030 is. Merk op dat dit alleen werkt als deze taalregio-instelling door het systeem ondersteund wordt. Gebruik het commando C voor een overzicht van de beschikbare taalregio's. Op Windows dient u de optie C<-gb> te gebruiken om UTF-16-bestanden naar GB18030 te converteren. GB18030-bestanden kunnen een Byte-Order-Mark bevatten, net als Unicode-bestanden. =head1 VOORBEELDEN Invoer lezen van standaardinvoer en uitvoer schrijven naar standaarduitvoer: dos2unix < a.txt cat a.txt | dos2unix Omzetten en vervangen van a.txt; omzetten en vervangen van b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Omzetten en vervangen van a.txt in ascii-conversiemodus: dos2unix a.txt Omzetten en vervangen van a.txt in ascii-conversiemodus; omzetten en vervangen van b.txt in 7-bits conversiemodus: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Omzetten van a.txt van Mac- naar Unix-indeling: dos2unix -c mac a.txt mac2unix a.txt Omzetten van a.txt van Unix- naar Mac-indeling: unix2dos -c mac a.txt unix2mac a.txt Omzetten en vervangen van a.txt met behoud van origineel tijdsstempel: dos2unix -k a.txt dos2unix -k -o a.txt Omzetten van a.txt en resultaat naar e.txt schrijven: dos2unix -n a.txt e.txt Omzetten van a.txt en naar e.txt schrijven, met tijdsstempel van e.txt gelijk aan die van a.txt: dos2unix -k -n a.txt e.txt Omzetten en vervangen van a.txt; omzetten van b.txt en naar e.txt schrijven: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Omzetten van c.txt en naar e.txt schrijven; omzetten en vervangen van a.txt; omzetten en vervangen van b.txt; omzetten van d.txt en naar f.txt schrijven. dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 RECURSIEVE CONVERSIE Gebruik dos2unix in combinatie met de opdrachten B(1) en B(1) om tekstbestanden in een mappenboom recursief om te zetten. Bijvoorbeeld om alle .txt-bestanden in de mappenboom onder de huidige map te converteren, typt u: find . -name '*.txt' | xargs dos2unix In een Windows Opdrachtprompt kan de volgende opdracht gebruikt worden: for /R %G in (*.txt) do dos2unix "%G" PowerShell users can use the following command in Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} =head1 LOKALISATIE =over 4 =item B De primaire taal wordt geselecteerd via de omgevingsvariabele LANG. De variabele LANG bestaat uit verschillende onderdelen. Het eerste deel is in kleine letters de taalcode. Het tweede deel is optioneel en is de landcode in hoofdletters, voorafgegaan door een liggend streepje. Er is ook een optioneel derde deel: de tekencodering, voorafgegaan door een punt. Enkele voorbeelden voor een POSIX-shell: export LANG=nl Nederlands export LANG=nl_NL Nederlands, Nederland export LANG=nl_BE Nederlands, België export LANG=es_ES Spaans, Spanje export LANG=es_MX Spaans, Mexico export LANG=en_US.iso88591 Engels, VS, Latin-1-codering export LANG=en_GB.UTF-8 Engels, GB, UTF-8-codering Voor een complete lijst van taal- en landcodes zie de gettext-handleiding: L Op Unix-systemen kunt u de opdracht B(1) gebruiken om specifieke taalregio-informatie te verkrijgen. =item B Met de omgevingsvariabele LANGUAGE kunt u een prioriteitenlijst specificeren van talen, gescheiden door dubbele punten. Dos2unix geeft voorrang aan LANGUAGE boven LANG. Bijvoorbeeld, eerst Nederlands en dan Duits: C. U moet eerst lokalisatie in werking stellen, door het instellen van LANG (of LC_ALL) op een waarde ongelijk aan "C", voordat u een talen-prioriteitenlijst kunt gebruiken via de variabele LANGUAGE. Zie ook de gettext-handleiding: L Als u een taal kiest die niet beschikbaar is, worden de standaard Engelse berichten gebruikt. =item B Met de omgevingsvariabele DOS2UNIX_LOCALEDIR kan de LOCALEDIR die ingesteld werd tijdens compilatie worden overstemd. LOCALEDIR wordt gebruikt om de taalbestanden te vinden. De GNU standaardwaarde is C. De optie B<--version> laat de gebruikte LOCALEDIR zien. Voorbeeld (POSIX-shell): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 AFSLUITWAARDE Bij succes wordt nul teruggegeven. Wanneer een systeemfout optreedt wordt het laatste systeemfoutnummer teruggegeven. Bij andere fouten wordt 1 teruggegeven. De afsluitwaarde is altijd nul in de stillewerkingsmodus, behalve wanneer verkeerde opties worden gegeven. =head1 STANDAARDEN L L L =head1 AUTEURS Benjamin Lin - , Bernd Johannes Wuebben (mac2unix-modus) - , Christian Wurll (toevoegen van extra regeleindes) - , Erwin Waterlander - (beheerder) Projectpagina: L SourceForge-pagina: L =head1 ZIE OOK file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/nl/man1/dos2unix.txt0000644000175500010010000007044612721132570017116 0ustar waterlanGeenNAAM dos2unix - omzetter van tekstbestandsindelingen, van DOS/Mac naar Unix en vice versa OVERZICHT dos2unix [opties] [BESTAND ...] [-n INVOERBESTAND UITVOERBESTAND ...] unix2dos [opties] [BESTAND ...] [-n INVOERBESTAND UITVOERBESTAND ...] BESCHRIJVING Het Dos2unix pakket bevat de toepassingen "dos2unix" en "unix2dos" om platte tekstbestanden in DOS- of Mac-indeling naar Unix-indeling om te zetten, en vice versa. In DOS/Windows-tekstbestanden bestaat een regeleinde uit een combinatie van twee tekens: een 'Carriage Return' (CR) gevolgd door een 'Line Feed' (LF). In Unix-tekstbestanden bestaat een regeleinde uit één enkel 'Newline'-teken, dat gelijk is aan een DOS 'Line Feed'-teken (LF). In Mac-tekstbestanden, van vóór Mac OS X, bestaan regeleindes uit één enkel 'Carriage Return'-teken. Mac OS X is op Unix gebaseerd en heeft dezelfde regeleindes als Unix. Naast regeleindes kan Dos2unix ook de codering van bestanden converteren. Enkele DOS-codetabellen kunnen omgezet worden naar Unix Latin-1. En Windows Unicode-bestanden (UTF-16) kunnen geconverteerd worden naar Unix Unicode-bestanden (UTF-8). Binaire bestanden worden automatisch overgeslagen, behalve als de omzetting geforceerd wordt. Niet-reguliere bestanden, zoals mappen en FIFO's, worden automatisch overgeslagen. Symbolische koppelingen en hun doelen blijven standaard onaangeroerd. Optioneel kunnen symbolische koppelingen worden vervangen, of de uitvoer kan naar het doel van de symbolische koppeling worden geschreven. Op Windows wordt het schrijven naar het doel van een symbolische koppeling niet ondersteund. Dos2unix is gemodelleerd naar dos2unix op SunOS/Solaris, maar er is een belangrijk verschil: deze versie van dos2unix voert standaard een vervangende conversie uit (oud-bestand-modus) terwijl de oorspronkelijke SunOS/Solaris-versie alleen de gepaarde conversie (nieuw-bestand-modus) kent. Zie ook de opties "-o" en "-n". Een ander verschil is dat de SunOS/Solaris-versie standaard een conversie in *iso*-modus doet terwijl deze versie standaard *ascii*-modus gebruikt. OPTIES -- Alle volgende opties als bestandsnamen behandelen. Gebruik deze optie als u een bestand wilt converteren waarvan de naam met een streepje begint. Bijvoorbeeld, om een bestand genaamd "-foo" om te zetten, gebruikt u de volgende opdracht: dos2unix -- -foo Of in nieuw-bestand-modus: dos2unix -n -- -foo uit.txt -ascii Alleen regeleindes converteren. Dit is de standaardconversiemodus. -iso Conversie tussen de tekensets DOS en ISO-8859-1. Zie ook de sectie CONVERSIEMODI. -1252 Windows-codetabel 1252 (West-Europees) gebruiken. -437 DOS-codetabel 437 (VS) gebruiken. Dit is de standaard codetabel die gebruikt wordt bij ISO-conversie. -850 DOS-codetabel 850 (West-Europees) gebruiken. -860 DOS-codetabel 860 (Portugees) gebruiken. -863 DOS-codetabel 863 (Canadees Frans) gebruiken. -865 DOS-codetabel 865 (Scandinavisch) gebruiken. -7 Lettertekens met het achtste bit gezet converteren naar spaties. -b, --keep-bom Een Byte-Order-Mark (BOM) behouden. Als het invoerbestand een BOM bevat, dan wordt ook een BOM naar het uitvoerbestand geschreven. Dit is het standaardgedrag bij conversie naar DOS. Zie ook optie "-r". -c, --convmode CONVERSIEMODUS De te gebruiken conversiemodus. CONVERSIEMODUS kan zijn: *ascii*, *7bit*, *iso*, of *mac*, waarbij ascii de standaardinstelling is. -D, --display-enc CODERING De te gebruiken tekencodering voor weergegeven tekst. CODERING kan zijn: *ansi*, *unicode*, *unicodebom*, *utf8*, of *utf8bom*, waarbij ansi de standaardinstelling is. Deze optie is alleen beschikbaar in dos2unix voor Windows met Unicode-bestandsnaam-ondersteuning. Deze optie heeft geen effect op de gelezen en geschreven bestandsnamen, maar alleen op hoe deze weergegeven worden. There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages. ansi Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the "chcp" command, because dos2unix uses the Windows system code page. The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK. unicode, unicodebom The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it. When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font. The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program. When method "unicodebom" is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. utf8, utf8bom The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the "unicode" encoding. The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed. In a ConEmu console the utf8 encoding method works well. When method "utf8bom" is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell. The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to "unicode", "unicodebom", "utf8", or "utf8bom". -f, --force Conversie van binaire bestanden afdwingen. -gb, --gb18030 Op Windows worden UTF-16-bestanden standaard naar UTF-8 geconverteerd, ongeacht de ingestelde taalregio. Gebruik deze optie om UTF-16-bestanden naar GB18030 te converteren. Deze optie is alleen beschikbaar op Windows. Zie ook de sectie GB18030. -h, --help Een hulptekst tonen. -i[VLAGGEN], --info[=VLAGGEN] BESTAND... Bestandsinformatie tonen. Er wordt niets geconverteerd. De volgende informatie wordt weergegeven, in deze volgorde: het aantal DOS-regeleindes, het aantal Unix-regeleindes, het aantal Mac-regeleindes, de Byte-Order-Mark, of het een tekst- of binair bestand is, en de bestandsnaam. Voorbeelduitvoer: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Merk op dat een binair bestand soms voor een tekstbestand aangezien kan worden. Zie ook optie "-s". Bij de optie kunnen één of meer vlaggen meegegeven worden om de uitvoer te beperken. d Het aantal DOS-regeleindes tonen. u Het aantal Unix-regeleindes tonen. m Het aantal Mac-regeleindes tonen. b De Byte-Order-Mark tonen. t Tonen of het bestand tekst is of binair. c Alleen de namen tonen van de bestanden die geconverteerd zouden worden. Met de vlag "c" toont dos2unix alleen de bestanden die DOS-regeleindes bevatten, en unix2dos alleen de bestanden die Unix-regeleindes bevatten. h Een kopregel printen. p Bestandsnamen tonen zonder pad. Voorbeelden: Informatie weergeven voor alle bestanden met de extensie 'txt': dos2unix -i *.txt Alleen de aantallen DOS-regeleindes en Unix-regeleindes tonen: dos2unix -idu *.txt Alleen de Byte-Order-Mark tonen: dos2unix --info=b *.txt De bestanden opsommen die DOS-regeleindes bevatten: dos2unix -ic *.txt De bestanden opsommen die Unix-regeleindes bevatten: unix2dos -ic *.txt Alleen bestanden die DOS-regeleindes bevatten converteren en andere bestanden ongemoeid laten: dos2unix -ic *.txt | xargs dos2unix De bestanden vinden die DOS-regeleindes bevatten: find -name '*.txt' | xargs dos2unix -ic -k, --keepdate Het tijdsstempel van het invoerbestand behouden voor het uitvoerbestand. -L, --license De softwarelicentie tonen. -l, --newline Een extra regeleinde toevoegen. dos2unix: Alleen DOS-regeleindes worden omgezet naar twee Unix-regeleindes. In Mac-modus worden alleen Mac-regeleindes omgezet naar twee Unix-regeleindes. unix2dos: Alleen Unix-regeleindes worden omgezet naar twee DOS-regeleindes. In Mac-modus worden Unix-regeleindes omgezet naar twee Mac-regeleindes. -m, --add-bom Een Byte-Order-Mark (BOM) naar het uitvoerbestand schrijven. Standaard wordt een UTF-8-BOM geschreven. Als het invoerbestand in UTF-16 is, en de optie "-u" is gegeven, dan wordt een UTF-16-BOM geschreven. Gebruik deze optie nooit als de codering van het uitvoerbestand niet UTF-8, UTF-16, of GB18030 is. Zie ook de sectie UNICODE. -n, --newfile INVOERBESTAND UITVOERBESTAND ... Nieuw-bestand-modus. Het bestand INVOERBESTAND converteren en naar bestand UITVOERBESTAND schrijven. Bestandsnamen moeten opgegeven worden in paren. Jokertekens moeten *niet*gebruikt worden, anders *verlies* je de bestanden. De gebruiker die de conversie start in nieuw-bestand (gepaarde) modus wordt de eigenaar van het geconverteerde bestand. De lees/schrijf-toegangsrechten van het nieuwe bestand worden de toegangsrechten van het originele bestand minus de umask(1) van de gebruiker die de conversie draait. -o, --oldfile BESTAND ... Oud-bestand-modus. Het bestand BESTAND converteren en overschrijven. Dit is de standaard modus. Jokertekens kunnen gebruikt worden. In oud-bestand (vervangende) modus krijgt het geconverteerde bestand dezelfde eigenaar, groep en lees/schrijf-rechten als het originele bestand. Ook wanneer het bestand wordt omgezet door een andere gebruiker die schrijfrechten heeft op het bestand (b.v. gebruiker root). De omzetting wordt afgebroken wanneer het niet mogelijk is de originele waardes te behouden. Verandering van eigenaar kan betekenen dat de originele eigenaar het bestand niet meer kan lezen. Verandering van groep zou een veiligheidsrisico kunnen zijn, het bestand zou leesbaar kunnen worden voor personen voor wie het niet bestemd is. Behoud van eigenaar, groep en lees/schrijf-rechten wordt alleen ondersteund op Unix. -q, --quiet Stille werking. Alle waarschuwingen onderdrukken. De afsluitwaarde is nul, behalve wanneer verkeerde opties worden gegeven. -r, --remove-bom Een Byte-Order-Mark (BOM) verwijderen. Er wordt geen BOM naar het uitvoerbestand geschreven. Dit is het standaardgedrag bij conversie naar Unix. Zie ook optie "-b". -s, --safe Binaire bestanden overslaan (standaard). Binaire bestanden worden overgeslagen om vergissingen te voorkomen. Het detecteren van binaire bestanden is echter niet 100% betrouwbaar. Invoerbestanden worden gescand op binaire tekens die gewoonlijk niet in tekstbestanden voorkomen. Maar het is mogelijk dat een binair bestand enkel normale teksttekens bevat. Zo'n binair bestand zal dan foutief als een tekstbestand gezien worden. -u, --keep-utf16 De originele UTF-16-codering van het invoerbestand behouden. Het uitvoerbestand wordt in dezelfde UTF-16-codering (little endian of big endian) geschreven als het invoerbestand. Dit voorkomt conversie naar UTF-8. Er wordt ook een corresponderende UTF-16-BOM geschreven. Deze optie kan uitgeschakeld worden met de optie "-ascii". -ul, --assume-utf16le Veronderstellen dat de indeling van het invoerbestand UTF-16LE is. Wanneer het invoerbestand een Byte-Order-Mark (BOM) bevat, dan gaat deze BOM vóór deze optie. Wanneer een verkeerde aanname is gemaakt (het invoerbestand was geen UTF-16LE) en de conversie verliep met succes, dan krijgt u een UTF-8-bestand met verkeerde tekst. De verkeerde conversie kan ongedaan worden gemaakt door met iconv(1) het UTF-8-uitvoerbestand terug om te zetten naar UTF-16LE. Dit zal het originele bestand terug brengen. De aanname van UTF-16LE werkt als een *conversiemodus*. Door de standaardmodus *ascii* in te schakelen wordt de UTF-16LE-veronderstelling uitgeschakeld. -ub, --assume-utf16be Veronderstellen dat de indeling van het invoerbestand UTF-16BE is. Deze optie werkt hetzelfde als optie "-ul". -v, --verbose Extra meldingen weergeven. Er wordt extra informatie getoond over Byte-Order-Marks en het aantal geconverteerde regeleindes. -F, --follow-symlink Symbolische koppelingen volgen en de doelen converteren. -R, --replace-symlink Symbolische koppelingen vervangen door geconverteerde bestanden (de originele doelbestanden blijven ongewijzigd). -S, --skip-symlink Symbolische koppelingen en doelen ongewijzigd laten (standaard). -V, --version Versie-informatie tonen. MAC-MODUS In normale modus worden DOS-regeleindes naar Unix omgezet en vice versa. Mac-regeleindes worden niet omgezet. In Mac-modus worden Mac-regeleindes naar Unix omgezet en vice versa. DOS-regeleindes blijven ongewijzigd. Om in Mac-modus te draaien kunt u de opdrachtregeloptie "-c mac" gebruiken, of de opdrachten "mac2unix" of "unix2mac". CONVERSIEMODI ascii In modus "ascii" worden alleen regeleindes omgezet. Dit is de standaardmodus. Hoewel de naam van deze modus ASCII is, wat een 7-bits standaard is, is de werkelijke modus 8-bits. Gebruik altijd deze modus wanneer u Unicode UTF-8-bestanden omzet. 7bit Alle 8-bits niet-ASCII lettertekens (met waardes van 128 t/m 255) worden omgezet naar een 7-bits spatie. iso Tekens worden omgezet tussen een DOS-tekenset (codetabel) en de ISO-tekenset ISO-8859-1 (Latin-1) op Unix. DOS-tekens zonder een ISO-8859-1-equivalent, waarvoor dus geen omzetting mogelijk is, worden omgezet in een punt. Hetzelfde geldt voor ISO-8859-1-tekens zonder DOS-tegenhanger. Wanneer alleen optie "-iso" gebruikt wordt, zal dos2unix proberen de actieve codetabel te gebruiken. Als dat niet mogelijk is wordt codetabel CP437 gebruikt, die vooral in de VS gebruikt wordt. Om een bepaalde codetabel te forceren, kunt u de opties -850 (West-Europees), -860 (Portugees), -863 (Canadees Frans) of -865 (Scandinavisch) gebruiken. Windows-codetabel CP1252 (West-Europees) wordt ook ondersteund met optie -1252. Gebruik voor andere codetabellen dos2unix in combinatie met iconv(1). Iconv kan omzetten tussen een lange lijst tekensetcoderingen. Gebruik ISO-conversie nooit op Unicode-tekstbestanden. Het zal UTF-8-gecodeerde bestanden beschadigen. Enkele voorbeelden: Omzetten van de standaard DOS-codetabel naar Unix Latin-1: dos2unix -iso -n in.txt uit.txt Omzetten van DOS CP850 naar Unix Latin-1: dos2unix -850 -n in.txt uit.txt Omzetten van Windows CP1252 naar Unix Latin-1: dos2unix -1252 -n in.txt uit.txt Omzetten van Windows CP1252 naar Unix UTF-8 (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > uit.txt Omzetten van Unix Latin-1 naar de standaard DOS-codetabel: unix2dos -iso -n in.txt uit.txt Omzetten van Unix Latin-1 naar DOS CP850: unix2dos -850 -n in.txt uit.txt Omzetten van Unix Latin-1 naar Windows CP1252: unix2dos -1252 -n in.txt uit.txt Omzetten van Unix UTF-8 (Unicode) naar Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > uit.txt Zie ook en . UNICODE Coderingen Er bestaan verschillende Unicode-coderingen. Op Unix en Linux zijn Unicode-bestanden typisch gecodeerd in UTF-8. Op Windows kunnen Unicode-tekstbestanden gecodeerd zijn in UTF-8, UTF-16 of UTF-16 big endian, maar ze zijn meestal gecodeerd in UTF-16. Conversie Unicode-tekstbestanden kunnen DOS-, Unix- of Mac-regeleindes hebben, net als reguliere tekstbestanden. Alle versies van dos2unix en unix2dos kunnen UTF-8-gecodeerde bestanden omzetten, want UTF-8 is ontworpen op compatibiliteit met ASCII. Dos2unix en unix2dos met Unicode UTF-16-ondersteuning kunnen little en big endian UTF-16-gecodeerde tekstbestanden lezen. Om er achter te komen of dos2unix gebouwd is met UTF-16- ondersteuning, typt u "dos2unix -V". Op Unix/Linux worden UTF-16-bestanden geconverteerd naar de codering van de ingestelde taalregio. Gebruik de opdracht locale(1) om te zien wat de ingestelde codering is. Wanneer conversie niet mogelijk is, treedt er een fout op en wordt het bestand overgeslagen. Op Windows worden UTF-16-bestanden standaard naar UTF-8 geconverteerd. UTF-8-tekstbestanden worden alom goed ondersteund, zowel op Windows als Unix/Linux. De UTF-16- en UTF-8-coderingen zijn volledig compatibel, er gaat bij het converteren niets verloren. Als er tijdens de conversie van UTF-16 naar UTF-8 een fout optreedt, bijvoorbeeld omdat het UTF-16-invoerbestand een fout bevat, dan wordt het bestand overgeslagen. Wanneer "-u" gebruikt wordt, wordt het uitvoerbestand in dezelfde UTF-16-codering geschreven als het invoerbestand. Optie "-u" voorkomt conversie naar UTF-8. Dos2unix en unix2dos hebben geen optie om van UTF-8 naar UTF-16 te converteren. ISO- en 7-bits-conversie werken niet op UTF-16-bestanden. Byte-Order-Mark Op Windows bevatten Unicode-tekstbestanden gewoonlijk een Byte-Order-Mark (BOM), omdat veel Windows-programma's (inclusief Kladblok) standaard een BOM toevoegen. Zie ook . Op Unix hebben Unicode-tekstbestanden meestal geen BOM. Er wordt aangenomen dat de codering van tekstbestanden gelijk is aan de tekencodering van de ingestelde taalregio. Dos2unix kan alleen detecteren of een bestand in UTF-16-codering is als het bestand een BOM bevat. Wanneer een UTF-16-bestand geen BOM heeft, ziet dos2unix het bestand als een binair bestand. Gebruik optie "-ul" of "-ub" om een UTF-16-bestand zonder BOM om te zetten. Dos2unix schrijft standaard geen BOM in het uitvoerbestand. Met optie "-b" schrijft dos2unix een BOM wanneer het invoerbestand een BOM bevat. Unix2dos schrijft standaard een BOM in het uitvoerbestand wanneer het invoerbestand een BOM bevat. Gebruik optie "-r" om de BOM te verwijderen. Dos2unix en unix2dos schrijven altijd een BOM wanneer optie "-m" gebruikt wordt. Unicode-bestandsnamen op Windows Dos2unix heeft optionele ondersteuning voor het lezen en schrijven van Unicode-bestandsnamen in de Windows Opdrachtprompt. Dit betekent dat dos2unix bestanden kan openen waarvan de naam tekens bevat die niet voorkomen in de standaard ANSI-codetabel. Om te zien of dos2unix voor Windows gecompileerd werd met ondersteuning voor Unicode-bestandsnamen, typt u "dos2unix -V". Er zijn enige problemen met het weergeven van Unicode-bestandsnamen in een Windows-console; zie bij optie "-D", "--display-enc". De bestandsnamen kunnen verkeerd weergegeven worden, maar de bestanden zullen geschreven worden met de correcte naam. Unicode-voorbeelden Omzetten van Windows UTF-16 (met BOM) naar Unix UTF-8: dos2unix -n in.txt uit.txt Omzetten van Windows UTF-16LE (zonder BOM) naar Unix UTF-8: dos2unix -ul -n in.txt uit.txt Omzetten van Unix UTF-8 naar Windows UTF-8 met BOM: unix2dos -m -n in.txt uit.txt Omzetten van Unix UTF-8 naar Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > uit.txt GB18030 GB18030 is een standaard van de Chinese overheid. Een subset van de GB18030-standaard is officieel verplicht voor alle softwareproducten die in China verkocht worden. Zie ook . GB18030 is volledig compatibel met Unicode, en kan als een Unicodetransformatie beschouwd worden. Net als UTF-8 is GB18030 compatibel met ASCII. GB18030 is ook compatibel met Windows-codetabel 936 (ook wel GBK genoemd). Op Unix/Linux worden UTF-16-bestanden naar GB18030 geconverteerd wanneer de taalregio-codering GB18030 is. Merk op dat dit alleen werkt als deze taalregio-instelling door het systeem ondersteund wordt. Gebruik het commando "locale -a" voor een overzicht van de beschikbare taalregio's. Op Windows dient u de optie "-gb" te gebruiken om UTF-16-bestanden naar GB18030 te converteren. GB18030-bestanden kunnen een Byte-Order-Mark bevatten, net als Unicode-bestanden. VOORBEELDEN Invoer lezen van standaardinvoer en uitvoer schrijven naar standaarduitvoer: dos2unix < a.txt cat a.txt | dos2unix Omzetten en vervangen van a.txt; omzetten en vervangen van b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Omzetten en vervangen van a.txt in ascii-conversiemodus: dos2unix a.txt Omzetten en vervangen van a.txt in ascii-conversiemodus; omzetten en vervangen van b.txt in 7-bits conversiemodus: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Omzetten van a.txt van Mac- naar Unix-indeling: dos2unix -c mac a.txt mac2unix a.txt Omzetten van a.txt van Unix- naar Mac-indeling: unix2dos -c mac a.txt unix2mac a.txt Omzetten en vervangen van a.txt met behoud van origineel tijdsstempel: dos2unix -k a.txt dos2unix -k -o a.txt Omzetten van a.txt en resultaat naar e.txt schrijven: dos2unix -n a.txt e.txt Omzetten van a.txt en naar e.txt schrijven, met tijdsstempel van e.txt gelijk aan die van a.txt: dos2unix -k -n a.txt e.txt Omzetten en vervangen van a.txt; omzetten van b.txt en naar e.txt schrijven: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Omzetten van c.txt en naar e.txt schrijven; omzetten en vervangen van a.txt; omzetten en vervangen van b.txt; omzetten van d.txt en naar f.txt schrijven. dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt RECURSIEVE CONVERSIE Gebruik dos2unix in combinatie met de opdrachten find(1) en xargs(1) om tekstbestanden in een mappenboom recursief om te zetten. Bijvoorbeeld om alle .txt-bestanden in de mappenboom onder de huidige map te converteren, typt u: find . -name '*.txt' | xargs dos2unix In een Windows Opdrachtprompt kan de volgende opdracht gebruikt worden: for /R %G in (*.txt) do dos2unix "%G" PowerShell users can use the following command in Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} LOKALISATIE LANG De primaire taal wordt geselecteerd via de omgevingsvariabele LANG. De variabele LANG bestaat uit verschillende onderdelen. Het eerste deel is in kleine letters de taalcode. Het tweede deel is optioneel en is de landcode in hoofdletters, voorafgegaan door een liggend streepje. Er is ook een optioneel derde deel: de tekencodering, voorafgegaan door een punt. Enkele voorbeelden voor een POSIX-shell: export LANG=nl Nederlands export LANG=nl_NL Nederlands, Nederland export LANG=nl_BE Nederlands, België export LANG=es_ES Spaans, Spanje export LANG=es_MX Spaans, Mexico export LANG=en_US.iso88591 Engels, VS, Latin-1-codering export LANG=en_GB.UTF-8 Engels, GB, UTF-8-codering Voor een complete lijst van taal- en landcodes zie de gettext-handleiding: Op Unix-systemen kunt u de opdracht locale(1) gebruiken om specifieke taalregio-informatie te verkrijgen. LANGUAGE Met de omgevingsvariabele LANGUAGE kunt u een prioriteitenlijst specificeren van talen, gescheiden door dubbele punten. Dos2unix geeft voorrang aan LANGUAGE boven LANG. Bijvoorbeeld, eerst Nederlands en dan Duits: "LANGUAGE=nl:de". U moet eerst lokalisatie in werking stellen, door het instellen van LANG (of LC_ALL) op een waarde ongelijk aan "C", voordat u een talen-prioriteitenlijst kunt gebruiken via de variabele LANGUAGE. Zie ook de gettext-handleiding: Als u een taal kiest die niet beschikbaar is, worden de standaard Engelse berichten gebruikt. DOS2UNIX_LOCALEDIR Met de omgevingsvariabele DOS2UNIX_LOCALEDIR kan de LOCALEDIR die ingesteld werd tijdens compilatie worden overstemd. LOCALEDIR wordt gebruikt om de taalbestanden te vinden. De GNU standaardwaarde is "/usr/local/share/locale". De optie --version laat de gebruikte LOCALEDIR zien. Voorbeeld (POSIX-shell): export DOS2UNIX_LOCALEDIR=$HOME/share/locale AFSLUITWAARDE Bij succes wordt nul teruggegeven. Wanneer een systeemfout optreedt wordt het laatste systeemfoutnummer teruggegeven. Bij andere fouten wordt 1 teruggegeven. De afsluitwaarde is altijd nul in de stillewerkingsmodus, behalve wanneer verkeerde opties worden gegeven. STANDAARDEN AUTEURS Benjamin Lin - , Bernd Johannes Wuebben (mac2unix-modus) - , Christian Wurll (toevoegen van extra regeleindes) - , Erwin Waterlander - (beheerder) Projectpagina: SourceForge-pagina: ZIE OOK file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/pl/0000755000175500010010000000000012721132564013740 5ustar waterlanGeendos2unix-7.3.4/man/pl/man1/0000755000175500010010000000000012721132613014567 5ustar waterlanGeendos2unix-7.3.4/man/pl/man1/dos2unix.10000644000175500010010000010314612721132565016437 0ustar waterlanGeen.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dos2unix 1" .TH dos2unix 1 "2016-05-24" "dos2unix" "2016-05-24" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAZWA" .IX Header "NAZWA" dos2unix \- konwerter formatu plików tekstowych między systemami DOS/Mac a Uniksem .SH "SKŁADNIA" .IX Header "SKŁADNIA" .Vb 2 \& dos2unix [opcje] [PLIK ...] [\-n PLIK_WEJ PLIK_WYJ ...] \& unix2dos [opcje] [PLIK ...] [\-n PLIK_WEJ PLIK_WYJ ...] .Ve .SH "OPIS" .IX Header "OPIS" Pakiet Dos2unix zawiera narzędzia \f(CW\*(C`dos2unix\*(C'\fR oraz \f(CW\*(C`unix2dos\*(C'\fR do konwersji zwykłych plików tekstowych między formatami używanymi w systemach \s-1DOS\s0 lub Mac a formatem uniksowym. .PP W plikach tekstowych systemu DOS/Windows oznaczenie końca linii to połączenie dwóch znaków: powrotu karetki (\s-1CR\s0) i przesunięcia linii (\s-1LF\s0). W uniksowych plikach tekstowych koniec linii to pojedynczy znak \s-1LF. W\s0 plikach tekstowych systemu Mac sprzed Mac \s-1OS X\s0 koniec linii był pojedynczym znakiem \&\s-1CR.\s0 Obecnie Mac \s-1OS\s0 wykorzystuje uniksowe końce linii (\s-1LF\s0). .PP Oprócz oznaczeń końców linii Dos2unix potrafi konwertować także kodowanie plików. Kilko stron kodowych DOS-a może być przekonwertowanych do uniksowego Latin\-1, a windowsowy Unicode (\s-1UTF\-16\s0) do powszechniejszego pod Uniksem kodowania Unicode \s-1UTF\-8.\s0 .PP Pliki binarne są pomijane automatycznie, chyba że konwersja zostanie wymuszona. .PP Pliki inne niż zwykłe, np. katalogi lub \s-1FIFO,\s0 są pomijane automatycznie. .PP Dowiązania symboliczne i ich cele są domyślnie pozostawiane bez zmian. Dowiązania symboliczne mogą być opcjonalnie zastępowane, albo wyjście może być zapisywane do celu dowiązania. Zapis do celu dowiązania symbolicznego nie jest obsługiwane pod Windows. .PP Dos2unix powstał na podstawie narzędzia dos2unix z systemu SunOS/Solaris. Jest jedna istotna różnica w stosunku do oryginalnej wersji z SunOS\-a/Solarisa: ta wersja domyślnie wykonuje konwersję w miejscu (tryb starego pliku), podczas gdy oryginalna obsługiwała tylko konwersję parami (tryb nowego pliku) \- p. także opcje \f(CW\*(C`\-o\*(C'\fR i \f(CW\*(C`\-n\*(C'\fR. Ponadto wersja z SunOS\-a/Solarisa domyślnie wykonuje konwersję w trybie \fIiso\fR, podczas gdy ta wersja domyślnie wykonuje konwersję w trybie \fIascii\fR. .SH "OPCJE" .IX Header "OPCJE" .IP "\fB\-\-\fR" 4 .IX Item "--" Potraktowanie wszystkich kolejnych opcji jako nazw plików. Tej opcji należy użyć, aby przekonwertować pliki, których nazwy zaczynają się od minusa. Przykładowo, aby przekonwertować plik o nazwie \*(L"\-foo\*(R", można użyć polecenia: .Sp .Vb 1 \& dos2unix \-\- \-foo .Ve .Sp Lub w trybie nowego pliku: .Sp .Vb 1 \& dos2unix \-n \-\- \-foo out.txt .Ve .IP "\fB\-ascii\fR" 4 .IX Item "-ascii" Konwersja tylko znaków końca linii. Jest to domyślny tryb konwersji. .IP "\fB\-iso\fR" 4 .IX Item "-iso" Konwersja między zestawami znaków \s-1DOS\s0 i \s-1ISO\-8859\-1.\s0 Więcej w sekcji \s-1TRYBY KONWERSJI.\s0 .IP "\fB\-1252\fR" 4 .IX Item "-1252" Użycie strony kodowej Windows 1252 (zachodnioeuropejskiej). .IP "\fB\-437\fR" 4 .IX Item "-437" Użycie strony kodowej \s-1DOS 437 \s0(\s-1US\s0). Jest to domyślna strona kodowa używana przy konwersji \s-1ISO.\s0 .IP "\fB\-850\fR" 4 .IX Item "-850" Użycie strony kodowej \s-1DOS 850 \s0(zachodnioeuropejskiej). .IP "\fB\-860\fR" 4 .IX Item "-860" Użycie strony kodowej \s-1DOS 860 \s0(portugalskiej). .IP "\fB\-863\fR" 4 .IX Item "-863" Użycie strony kodowej \s-1DOS 863 \s0(kanadyjskiej francuskiej). .IP "\fB\-865\fR" 4 .IX Item "-865" Użycie strony kodowej \s-1DOS 865 \s0(nordyckiej). .IP "\fB\-7\fR" 4 .IX Item "-7" Konwersja znaków 8\-bitowych do przestrzeni 7\-bitowej. .IP "\fB\-b, \-\-keep\-bom\fR" 4 .IX Item "-b, --keep-bom" Zachowanie znaku \s-1BOM \s0(Byte Order Makr). Jeżeli plik wejściowy zawiera \s-1BOM,\s0 powoduje zapisanie go w pliku wyjściowym. Jest to domyślne zachowanie przy konwersji na DOS-owe końce linii. P. także opcja \f(CW\*(C`\-r\*(C'\fR. .IP "\fB\-c, \-\-convmode \s-1TRYB_KONW\s0\fR" 4 .IX Item "-c, --convmode TRYB_KONW" Ustawienie trybu konwersji. \s-1TRYB_KONW\s0 to jeden z: \fIascii\fR, \fI7bit\fR, \fIiso\fR, \&\fImac\fR, przy czym domyślny jest ascii. .IP "\fB\-D, \-\-display\-enc \s-1KODOWANIE\s0\fR" 4 .IX Item "-D, --display-enc KODOWANIE" Ustawienie kodowania wyświetlanego tekstu. \s-1KODOWANIE\s0 to jedno z: \fIansi\fR, \&\fIunicode\fR, \fIunicodebom\fR, \fIutf8\fR, \fIutf8bom\fR, przy czym domyślne to ansi. .Sp Ta opcja jest dostępna wyłączenie w programie dos2unix dla Windows z obsługą nazw plików Unicode. Nie ma wpływu na same nawy odczytywanych i zapisywanych plików, a jedynie na sposób ich wyświetlania. .Sp Istnieje kilka sposobów wyświetlania tekstu w konsoli Windows w zależności od kodowania tekstu. Wszystkie mają swoje zalety i wady. .RS 4 .IP "\fBansi\fR" 4 .IX Item "ansi" Domyślna metoda programu dos2unix to stosowanie tekstu kodowanego w \&\s-1ANSI.\s0 Zaletą jest wsteczna zgodność. Działa z fontami rastrowymi, jak i TrueType. W niektórych rejonach może być potrzeba zmiany aktywnej strony kodowej \s-1DOS OEM\s0 na systemową stronę kodową Windows \s-1ANSI\s0 przy użyciu polecenia \f(CW\*(C`chcp\*(C'\fR, ponieważ dos2unix wykorzystuje systemową stronę kodową Windows. .Sp Wadą kodowania ansi jest fakt, że międzynarodowe nazwy plików ze znakami spoza domyślnej systemowej strony kodowej nie są wyświetlane właściwie. Można zamiast tego zobaczyć znak zapytania albo niewłaściwy symbol. Jeżeli nie pracujemy z obcymi nazwami plików, ta metoda jest poprawna. .IP "\fBunicode, unicodebom\fR" 4 .IX Item "unicode, unicodebom" Zaletą kodowania unicode (windowsową nazwą dla \s-1UTF\-16\s0) jest (zwykle) właściwe wyświetlanie tekstu. Nie ma potrzeby zmiany aktywnej strony kodowej. Może być potrzeba zmiany fontu konsoli na font TrueType, aby znaki międzynarodowe były wyświetlane poprawnie. Jeśli znak nie jest obecny w foncie TrueType, zwykle widać mały kwadrat, czasami ze znakiem zapytania w środku. .Sp W przypadku używania konsoli ConEmu cały tekst jest wyświetlany poprawnie, ponieważ ConEmu automatycznie wybiera dobry font. .Sp Wadą kodowania unicode jest niezgodność z \s-1ASCII.\s0 Wyjście nie jest łatwe do obsłużenia w przypadku przekierowania do innego programu lub pliku. .Sp W przypadku użycia metody \f(CW\*(C`unicodebom\*(C'\fR, tekst w unikodzie jest poprzedzony znakiem \s-1BOM \s0(Byte Order Mark). \s-1BOM\s0 jest wymagany do poprawnego przekierowania lub przekazywania przez potok w powłoce PowerShell. .IP "\fButf8, utf8bom\fR" 4 .IX Item "utf8, utf8bom" Zaletą kodowania utf8 jest zgodność z \s-1ASCII.\s0 Trzeba ustawić font konsoli na font TrueType. Przy użyciu fontu TrueType tekst jest wyświetlany podobnie do kodowania \f(CW\*(C`unicode\*(C'\fR. .Sp Wadą jest fakt, że w przypadku używania domyślnego fontu rastrowego, wszystkie znaki spoza \s-1ASCII\s0 są wyświetlane niepoprawnie. Nie tylko unikodowe nazwy plików, ale także przetłumaczone komunikaty stają się nieczytelne. W Windows skonfigurowanym dla rejonu Azji Wschodniej widać dużo migotania konsoli w trakcie wyświetlania komunikatów. .Sp W konsoli ConEmu metoda kodowania utf8 działa dobrze. .Sp W przypadku użycia metody \f(CW\*(C`utf8bom\*(C'\fR, tekst w \s-1UTF\-8\s0 jest poprzedzony znakiem \&\s-1BOM \s0(Byte Order Mark). \s-1BOM\s0 jest wymagany do poprawnego przekierowania lub przekazywania przez potok w powłoce PowerShell. .RE .RS 4 .Sp Domyślne kodowanie można zmienić przy użyciu zmiennej środowiskowej \&\s-1DOS2UNIX_DISPLAY_ENC,\s0 ustawiając ją na \f(CW\*(C`unicode\*(C'\fR, \f(CW\*(C`unicodebom\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR lub \f(CW\*(C`utf8bom\*(C'\fR. .RE .IP "\fB\-f, \-\-force\fR" 4 .IX Item "-f, --force" Wymuszenie konwersji plików binarnych. .IP "\fB\-gb, \-\-gb18030\fR" 4 .IX Item "-gb, --gb18030" Pod Windows pliki w \s-1UTF\-16\s0 są domyślnie konwertowane do \s-1UTF\-8,\s0 niezależnie od ustawienia lokalizacji. Ta opcja pozwala przekonwertować pliki w \s-1UTF\-16\s0 do \s-1GB18030.\s0 Opcja jest dostępna tylko pod Windows, więcej w sekcji dotyczącej \s-1GB18030.\s0 .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Wyświetlenie opisu i zakończenie. .IP "\fB\-i[\s-1FLAGI\s0], \-\-info[=FLAGI] \s-1PLIK ...\s0\fR" 4 .IX Item "-i[FLAGI], --info[=FLAGI] PLIK ..." Wyświetlenie informacji o pliku. Konwersja nie jest wykonywana. .Sp Wypisywane są następujące informacje, w tej kolejności: liczba DOS-owych końców linii, liczba uniksowych końców linii, liczba macowych końców linii, znacznik \s-1BOM,\s0 tekstowy lub binarny, nazwa pliku. .Sp Przykładowe wyjście: .Sp .Vb 8 \& 6 0 0 no_bom text dos.txt \& 0 6 0 no_bom text unix.txt \& 0 0 6 no_bom text mac.txt \& 6 6 6 no_bom text mixed.txt \& 50 0 0 UTF\-16LE text utf16le.txt \& 0 50 0 no_bom text utf8unix.txt \& 50 0 0 UTF\-8 text utf8dos.txt \& 2 418 219 no_bom binary dos2unix.exe .Ve .Sp Uwaga: czasami plik binarny może być błędnie rozpoznany jako tekstowy. P. także opcja \f(CW\*(C`\-s\*(C'\fR. .Sp Opcjonalnie można ustawić dodatkowe flagi, aby zmienić wyjście. Można dodać jedną lub więcej flag. .RS 4 .IP "\fBd\fR" 4 .IX Item "d" Wypisanie liczby DOS-owych końców linii. .IP "\fBu\fR" 4 .IX Item "u" Wypisanie liczby uniksowych końców linii. .IP "\fBm\fR" 4 .IX Item "m" Wypisanie liczby macowych końców linii. .IP "\fBb\fR" 4 .IX Item "b" Wypisanie znacznika \s-1BOM.\s0 .IP "\fBt\fR" 4 .IX Item "t" Wypisanie, czy plik jest tekstowy, czy binarny. .IP "\fBc\fR" 4 .IX Item "c" Wypisanie tylko plików, które zostałyby przekonwertowane. .Sp Z flagą \f(CW\*(C`c\*(C'\fR dos2unix wypisze tylko pliki zawierające DOS-owe końce linii, a unix2dos wypisze tylko nazwy plików zawierających uniksowe końce linii. .IP "\fBh\fR" 4 .IX Item "h" Wypisanie nagłówka. .IP "\fBp\fR" 4 .IX Item "p" Wyświetlanie nazw plików bez ścieżki. .RE .RS 4 .Sp Przykłady: .Sp Pokazanie informacji o wszystkich plikach *.txt: .Sp .Vb 1 \& dos2unix \-i *.txt .Ve .Sp Pokazanie tylko liczby DOS-owych i uniksowych końców linii: .Sp .Vb 1 \& dos2unix \-idu *.txt .Ve .Sp Pokazanie tylko znacznika \s-1BOM:\s0 .Sp .Vb 1 \& dos2unix \-\-info=b *.txt .Ve .Sp Wypisanie listy plików zawierających DOS-owe końce linii: .Sp .Vb 1 \& dos2unix \-ic *.txt .Ve .Sp Wypisanie listy plików zawierających uniksowe końce linii: .Sp .Vb 1 \& unix2dos \-ic *.txt .Ve .Sp Konwersja tylko plików mających DOS-owe końce linii, pozostawienie pozostałych bez zmian: .Sp .Vb 1 \& dos2unix \-ic *.txt | xargs dos2unix .Ve .Sp Wyszukanie plików tekstowych zawierających DOS-owe końce linii: .Sp .Vb 1 \& find \-name \*(Aq*.txt\*(Aq | xargs dos2unix \-ic .Ve .RE .IP "\fB\-k, \-\-keepdate\fR" 4 .IX Item "-k, --keepdate" Zachowanie znacznika czasu pliku wyjściowego takiego samego, jak pliku wejściowego. .IP "\fB\-L, \-\-license\fR" 4 .IX Item "-L, --license" Wyświetlenie licencji programu. .IP "\fB\-l, \-\-newline\fR" 4 .IX Item "-l, --newline" Dodanie dodatkowego znaku końca linii. .Sp \&\fBdos2unix\fR: tylko DOS-owe znaki końca linii są zamieniane na dwa uniksowe. W trybie Mac tylko macowe znaki końca linii są zamieniane na dwa uniksowe. .Sp \&\fBunix2dos\fR: tylko uniksowe znaki końca linii są zamieniane na dwa DOS-owe. W trybie Mac uniksowe znaki końca linii są zamieniane na dwa macowe. .IP "\fB\-m, \-\-add\-bom\fR" 4 .IX Item "-m, --add-bom" Zapisanie znacznika \s-1BOM \s0(Byte Order Mark) w pliku wyjściowym. Domyślnie zapisywany jest \s-1BOM UTF\-8.\s0 .Sp Jeśli plik wejściowy jest w kodowaniu \s-1UTF\-16\s0 i użyto opcji \f(CW\*(C`\-u\*(C'\fR, zostanie zapisany \s-1BOM UTF\-16.\s0 .Sp Nigdy nie należy używać tej opcji, jeśli kodowanie wyjściowe jest inne niż \&\s-1UTF\-8, UTF\-16\s0 lub \s-1GB18030.\s0 Więcej w sekcji \s-1UNICODE.\s0 .IP "\fB\-n, \-\-newfile \s-1PLIK_WEJ PLIK_WYJ ...\s0\fR" 4 .IX Item "-n, --newfile PLIK_WEJ PLIK_WYJ ..." Tryb nowego pliku. Konwersja \s-1PLIKU_WEJ\s0 z zapisem wyjścia do \s-1PLIKU_WYJ.\s0 Nazwy plików muszą być podane parami, a masek \fInie\fR należy używać, gdyż \&\fIspowoduje\fR to utratę plików. .Sp Osoba uruchamiająca konwersję w trybie nowego pliku (par) będzie właścicielem przekonwertowanego pliku. Prawa odczytu/zapisu nowego pliku będą pochodziły z praw pliku oryginalnego po odjęciu \fIumask\fR\|(1) osoby uruchamiającej konwersję. .IP "\fB\-o, \-\-oldfile \s-1PLIK ...\s0\fR" 4 .IX Item "-o, --oldfile PLIK ..." Tryb starego pliku. Konwersja \s-1PLIKU\s0 i nadpisanie go wyjściem. Program działa domyślnie w tym trybie. Można używać masek. .Sp W trybie starego pliku (w miejscu) przekonwertowany plik otrzymuje tego samego właściciela, grupę oraz prawa odczytu/zapisu, jak plik oryginalny \- także wtedy, gdy plik jest konwertowany przez innego użytkownika, mającego prawo zapisu do pliku (np. przez użytkownika root). Konwersja zostanie przerwana, jeśli nie będzie możliwe zachowanie oryginalnych wartości. Zmiana właściciela mogłaby oznaczać, że pierwotny właściciel nie może już odczytać pliku. Zmiana grupy mogłaby być zagrożeniem bezpieczeństwa, plik mógłby być czytelny dla nie zamierzonych osób. Zachowanie właściciela, grupy i praw odczytu/zapisu jest obsługiwane tylko na Uniksie. .IP "\fB\-q, \-\-quiet\fR" 4 .IX Item "-q, --quiet" Tryb cichy. Pominięcie wszystkich ostrzeżeń i komunikatów. Zwracanym kodem jest zero, chyba że podano błędne opcje linii poleceń. .IP "\fB\-r, \-\-remove\-bom\fR" 4 .IX Item "-r, --remove-bom" Usunięcie znaków \s-1BOM \s0(Byte Order Mark). Bez zapisywania \s-1BOM\s0 do pliku wyjściowego. Jest to domyślne zachowanie przy konwersji na uniksowe końce linii. P. także opcja \f(CW\*(C`\-b\*(C'\fR. .IP "\fB\-s, \-\-safe\fR" 4 .IX Item "-s, --safe" Pominięcie plików binarnych (domyślne). .Sp Pomijanie plików binarnych ma na celu zapobieżenie przypadkowym błędom. Uwaga: wykrywanie plików binarnych nie jest w 100% odporne na błędy. Pliki wejściowe są przeszukiwane pod kątem symboli binarnych, które zwykle nie występują w plikach tekstowych. Może się zdarzyć, że plik binarny zawiera tylko zwykłe znaki tekstowe. Taki plik binarny będzie błędnie widziany jako plik tekstowy. .IP "\fB\-u, \-\-keep\-utf16\fR" 4 .IX Item "-u, --keep-utf16" Zachowanie oryginalnego kodowania pliku wejściowego \s-1UTF\-16.\s0 Plik wyjściowy zostanie zapisany w tym samym kodowaniu \s-1UTF\-16 \s0(little lub big endian), co plik wejściowy. Zapobiega to przekształceniu do \s-1UTF\-8.\s0 Do pliku zostanie zapisany odpowiedni znacznik \s-1BOM UTF\-16.\s0 Tę opcję można wyłączyć opcją \&\f(CW\*(C`\-ascii\*(C'\fR. .IP "\fB\-ul, \-\-assume\-utf16le\fR" 4 .IX Item "-ul, --assume-utf16le" Przyjęcie, że format pliku wejściowego to \s-1UTF\-16LE.\s0 .Sp Jeśli w pliku wejściowym jest znacznik \s-1BOM \s0(Byte Order Mark), ma on priorytet nad tą opcją. .Sp Jeśli przyjęto błędne założenie (plik wejściowy nie jest w formacie \&\s-1UTF\-16LE\s0), a konwersja się uda, wynikiem będzie plik wyjściowy \s-1UTF\-8\s0 ze złym tekstem. Konwersję tę można odwrócić przy użyciu polecenia \fIiconv\fR\|(1) do konwersji wyjścia \s-1UTF\-8\s0 z powrotem do \s-1UTF\-16LE.\s0 Przywróci to plik oryginalny. .Sp Przyjęcie \s-1UTF\-16LE\s0 działa jako \fItryb konwersji\fR. Przy przełączeniu na domyślny tryb \fIascii\fR przyjęcie \s-1UTF\-16LE\s0 jest wyłączane. .IP "\fB\-ub, \-\-assume\-utf16be\fR" 4 .IX Item "-ub, --assume-utf16be" Przyjęcie, że format pliku wejściowego to \s-1UTF\-16BE.\s0 .Sp Ta opcja działa analogicznie do \f(CW\*(C`\-ul\*(C'\fR. .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Wyświetlanie szczegółowych komunikatów. Wyświetlane śa dodatkowe informacje o znacznikach \s-1BOM \s0(Byte Order Mark) oraz liczbie przekonwertowanych końców linii. .IP "\fB\-F, \-\-follow\-symlink\fR" 4 .IX Item "-F, --follow-symlink" Podążanie za dowiązaniami symbolicznymi i konwertowanie ich celów .IP "\fB\-R, \-\-replace\-symlink\fR" 4 .IX Item "-R, --replace-symlink" Zastępowanie dowiązań symbolicznych przekonwertowanymi plikami (oryginalne pliki docelowe pozostają bez zmian). .IP "\fB\-S, \-\-skip\-symlink\fR" 4 .IX Item "-S, --skip-symlink" Pozostawienie dowiązań symbolicznych i celów bez zmian (domyślne). .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" Wyświetlenie informacji o wersji i zakończenie. .SH "TRYB MAC" .IX Header "TRYB MAC" W zwykłym trybie znaki końca linii są konwertowane z DOS-a do Uniksa i odwrotnie. Znaki końca linii systemu Mac nie są konwertowane. .PP W trybie Mac znaki końca linii są konwertowane z formatu Maca do Uniksa i odwrotnie. Znaki końca linii systemu \s-1DOS\s0 nie są zmieniane. .PP Aby uruchomić program w trybie Mac, należy użyć opcji linii poleceń \f(CW\*(C`\-c mac\*(C'\fR albo użyć poleceń \f(CW\*(C`mac2unix\*(C'\fR lub \f(CW\*(C`unix2mac\*(C'\fR. .SH "TRYBY KONWERSJI" .IX Header "TRYBY KONWERSJI" .IP "\fBascii\fR" 4 .IX Item "ascii" W trybie \f(CW\*(C`ascii\*(C'\fR konwertowane są tylko końce linii. Jest to domyślny tryb konwersji. .Sp Mimo że nazwa tego trybu to \s-1ASCII,\s0 które jest standardem 7\-bitowym, jest to tryb 8\-bitowy. Należy zawsze używać tego trybu przy konwersji plików Unicode \&\s-1UTF\-8.\s0 .IP "\fB7bit\fR" 4 .IX Item "7bit" W tym trybie wszystkie znaki 8\-bitowe spoza \s-1ASCII \s0(o wartościach od 128 do 255) są konwertowane do przestrzeni 7\-bitowej. .IP "\fBiso\fR" 4 .IX Item "iso" W tym trybie znaki są konwertowane między zestawem znaków \s-1DOS \s0(stroną kodową) a zestawem znaków \s-1ISO\-8859\-1 \s0(Latin\-1) używanym na Uniksie. Znaki DOS-owe nie mające odpowiednika w \s-1ISO\-8859\-1,\s0 których nie da się przekonwertować, są zamieniane na kropkę. To samo dotyczy znaków \s-1ISO\-8859\-1\s0 bez odpowiednika w DOS-ie. .Sp Jeśli używana jest tylko opcja \f(CW\*(C`\-iso\*(C'\fR, dos2unix próbuje wykryć aktywną stronę kodową. Jeśli nie jest to możliwe, dos2unix używa domyślnej strony kodowej \s-1CP437,\s0 stosowanej głównie w \s-1USA.\s0 Aby wymusić określoną stronę kodową, należy użyć opcji \f(CW\*(C`\-437\*(C'\fR (\s-1US\s0), \f(CW\*(C`\-850\*(C'\fR (zachodnioeuropejska), \&\f(CW\*(C`\-860\*(C'\fR (portugalska), \f(CW\*(C`\-863\*(C'\fR (kanadyjska francuska) lub \f(CW\*(C`\-865\*(C'\fR (nordycka). Ponadto obsługiwana jest strona kodowa Windows \s-1CP1252 \&\s0(zachodnioeuropejska) przy użyciu opcji \f(CW\*(C`\-1252\*(C'\fR. W przypadku innych stron kodowych można użyć narzędzia dos2unix wraz z \fIiconv\fR\|(1). Iconv potrafi konwertować między wieloma kodowaniami znaków. .Sp Nigdy nie należy używać konwersji \s-1ISO\s0 na plikach tekstowych w Unicode. Uszkodziłaby pliki kodowane \s-1UTF\-8.\s0 .Sp Kilka przykładów: .Sp Konwersja z domyślnej strony kodowej \s-1DOS\s0 do uniksowego Latin\-1: .Sp .Vb 1 \& dos2unix \-iso \-n in.txt out.txt .Ve .Sp Konwersja ze strony kodowej \s-1DOS CP850\s0 do uniksowego Latin\-1: .Sp .Vb 1 \& dos2unix \-850 \-n in.txt out.txt .Ve .Sp Konwersja ze strony kodowej Windows \s-1CP1252\s0 do uniksowego Latin\-1: .Sp .Vb 1 \& dos2unix \-1252 \-n in.txt out.txt .Ve .Sp Konwersja ze strony kodowej Windows \s-1CP1252\s0 do uniksowego \s-1UTF\-8 \s0(Unicode): .Sp .Vb 1 \& iconv \-f CP1252 \-t UTF\-8 in.txt | dos2unix > out.txt .Ve .Sp Konwersa z uniksowego Latin\-1 do domyślnej strony kodowej \s-1DOS:\s0 .Sp .Vb 1 \& unix2dos \-iso \-n in.txt out.txt .Ve .Sp Konwersja z uniksowego Latin\-1 do strony kodowej \s-1DOS CP850:\s0 .Sp .Vb 1 \& unix2dos \-850 \-n in.txt out.txt .Ve .Sp Konwersja z uniksowego Latin\-1 do strony kodowej Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos \-1252 \-n in.txt out.txt .Ve .Sp Konwersja z uniksowego \s-1UTF\-8 \s0(Unicode) do strony kodowej Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t CP1252 > out.txt .Ve .Sp Więcej pod adresem oraz . .SH "UNICODE" .IX Header "UNICODE" .SS "Kodowania" .IX Subsection "Kodowania" Istnieją różne kodowania Unicode. Pod Uniksem i Linuksem pliki Unicode są zwykle kodowane z użyciem \s-1UTF\-8.\s0 Pod Windows pliki tekstowe Unicode mogą być kodowane w \s-1UTF\-8, UTF\-16, UTF\-16\s0 big-endian, ale przeważnie są kodowane w \&\s-1UTF\-16.\s0 .SS "Konwersje" .IX Subsection "Konwersje" Pliki tekstowe Unicode mogą mieć znaki końca linii systemu \s-1DOS,\s0 Unix lub Mac, podobnie jak zwykłe pliki tekstowe. .PP Wszystkie wersje dos2unix i unix2dos potrafią konwertować pliki kodowane \&\s-1UTF\-8,\s0 ponieważ \s-1UTF\-8\s0 jest wstecznie zgodne z \s-1ASCII.\s0 .PP Dos2unix i unix2dos z obsługą Unicode \s-1UTF\-16\s0 potrafią odczytywać pliki tekstowe kodowane \s-1UTF\-16\s0 little\- oraz big-endian. Aby sprawdzić, czy dos2unix został zbudowany z obsługą \s-1UTF\-16,\s0 należy napisać \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP Pod Uniksem/Linuksem pliki w kodowaniu \s-1UTF\-16\s0 są konwertowane do kodowania znaków ustawionej lokalizacji. Kodowanie znaków dla lokalizacji można sprawdzić poleceniem \fIlocale\fR\|(1). Jeśli konwersja nie jest możliwa, wystąpi błąd, a plik zostanie pominięty. .PP Pod Windows pliki \s-1UTF\-16\s0 są domyślnie konwertowane do \s-1UTF\-8.\s0 Pliki tekstkowe w kodowaniu \s-1UTF\-8\s0 są dobrze obsługiwane zarówno pod Windows, jak i Uniksem/Linuksem. .PP Kodowania \s-1UTF\-16\s0 i \s-1UTF\-8\s0 są w pełni zgodne, konwersja nie spowoduje utraty żadnej części tekstu. W przypadku wystąpienia błędu konwersji, na przykład w przypadku błędu w pliku wejściowym \s-1UTF\-16,\s0 plik zostanie pominięty. .PP W przypadku użycia opcji \f(CW\*(C`\-u\*(C'\fR, plik wejściowy zostanie zapisany w tym samym kodowaniu \s-1UTF\-16,\s0 co plik wejściowy. Opcja \f(CW\*(C`\-u\*(C'\fR zapobiega konwersji do \&\s-1UTF\-8.\s0 .PP Dos2unix oraz unix2dos nie mają opcji pozwalającej na konwersję plików \s-1UTF\-8\s0 do \s-1UTF\-16.\s0 .PP Tryby konwersji \s-1ISO\s0 i 7\-bit nie działają na plikach \s-1UTF\-16.\s0 .SS "Znacznik \s-1BOM\s0" .IX Subsection "Znacznik BOM" W systemie Windows pliki tekstowe zwykle zawierają znacznik \s-1BOM \s0(Byte Order Mark), ponieważ wiele programów dla Windows (w tym Notepad) dodaje domyślnie znaczniki \s-1BOM.\s0 Więcej informacji można znaleźć pod adresem . .PP Pod Uniksem pliki Unicode zwykle nie mają znacznika \s-1BOM.\s0 Pliki tekstowe są traktowane jako kodowane zgodnie z kodowaniem znaków ustawionej lokalizacji. .PP Dos2unix potrafi wykryć tylko, czy plik jest w formacie \s-1UTF\-16,\s0 jeśli zawiera znacznik \s-1BOM.\s0 Jeśli plik \s-1UTF\-16\s0 nie ma tego znacznika, dos2unix potraktuje plik jako binarny. .PP Do konwersji pliku \s-1UTF\-16\s0 bez znacznika \s-1BOM\s0 można użyć opcji \f(CW\*(C`\-ul\*(C'\fR lub \&\f(CW\*(C`\-ub\*(C'\fR. .PP Dos2unix nie zapisuje domyślnie znaku \s-1BOM\s0 w pliku wyjściowym. Z opcją \f(CW\*(C`\-b\*(C'\fR Dos2unix zapisuje \s-1BOM,\s0 jeśli plik wejściowy zawiera \s-1BOM.\s0 .PP Unix2dos domyślnie zapisuje znaczniki \s-1BOM\s0 w pliku wyjściowym, jeśli plik wejściowy ma \s-1BOM.\s0 Aby usunąć \s-1BOM,\s0 można użyć opcji \f(CW\*(C`\-r\*(C'\fR. .PP Dos2unix oraz unix2dos zawsze zapisują znaczniki \s-1BOM,\s0 jeśli użyta zostanie opcja \f(CW\*(C`\-m\*(C'\fR. .SS "Unikodowe nazwy plików w Windows" .IX Subsection "Unikodowe nazwy plików w Windows" Dos2unix ma opcjonalną obsługę odczytu i zapisu nazw plików Unicode w linii poleceń Windows. Oznacza to, że dos2unix potrafi otwierać pliki zawierające w nazwie znaki spoza domyślnej systemowej strony kodowej \s-1ANSI.\s0 Aby sprawdzić, czy dos2unix dla Windows został zbudowany z obsługą nazw plików Unicode, można wpisać \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP Przy wyświetlaniu nazw plików Unicode w konsoli Windows występuje kilka problemów. Więcej informacji w opisie opcji \f(CW\*(C`\-D\*(C'\fR, \f(CW\*(C`\-\-display\-enc\*(C'\fR. Nazwy plików mogą być wyświetlane błędnie na konsoli, ale pliki będą zapisywane z poprawną nazwą. .SS "Przykłady Unicode" .IX Subsection "Przykłady Unicode" Konwersja pliku \s-1UTF\-16 \s0(z \s-1BOM\s0) z formatu Windows do uniksowego \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-n in.txt out.txt .Ve .PP Konwersja pliku \s-1UTF\-16LE \s0(bez \s-1BOM\s0) z formatu Windows do uniksowego \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-ul \-n in.txt out.txt .Ve .PP Konwersja z uniksowego \s-1UTF\-8\s0 do \s-1UTF\-8\s0 z \s-1BOM\s0 dla Windows: .PP .Vb 1 \& unix2dos \-m \-n in.txt out.txt .Ve .PP Konwersja z uniksowego \s-1UTF\-8\s0 do \s-1UTF\-16\s0 dla Windows: .PP .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t UTF\-16 > out.txt .Ve .SH "GB18030" .IX Header "GB18030" \&\s-1GB18030\s0 to standard urzędowy w Chinach. Obowiązkowy podzbiór standardu \&\s-1GB18030\s0 jest oficjalnym wymaganiem każdego oprogramowania sprzedawanego w Chinach. Więcej pod adresem . .PP \&\s-1GB18030\s0 jest w pełni zgodny z Unicode i może być uważany za format transformacji unikodu. Podobnie jak \s-1UTF\-8, GB18030\s0 jest zgodny z \s-1ASCII.\s0 Jest także zgodny ze stroną kodową Windows 936, znaną też jako \s-1GBK.\s0 .PP Pod Uniksem/Linuksem pliki \s-1UTF\-16\s0 są konwertowane do \s-1GB18030,\s0 jeśli kodowanie dla lokalizacji jest ustawione na \s-1GB18030.\s0 Uwaga: będzie to działać tylko, jeśli lokalizacja jest obsługiwana przez system. Listę obsługiwanych lokalizacji można sprawdzić poleceniem \f(CW\*(C`locale \-a\*(C'\fR. .PP Pod Windows w celu konwersji plików \s-1UTF\-16\s0 do \s-1GB18030\s0 należy użyć opcji \&\f(CW\*(C`\-gb\*(C'\fR. .PP Pliki w kodowaniu \s-1GB18030\s0 mogą mieć znacznik \s-1BOM,\s0 podobnie jak pliki w Unicode. .SH "PRZYKŁADY" .IX Header "PRZYKŁADY" Odczyt ze standardowego wejścia i zapis na standardowe wyjście: .PP .Vb 2 \& dos2unix < a.txt \& cat a.txt | dos2unix .Ve .PP Konwersja i zastąpienie a.txt; konwersja i zastąpienie b.txt: .PP .Vb 2 \& dos2unix a.txt b.txt \& dos2unix \-o a.txt b.txt .Ve .PP Konwersja i zastąpienie a.txt w trybie ascii: .PP .Vb 1 \& dos2unix a.txt .Ve .PP Konwersja i zastąpienie a.txt w trybie ascii; konwersja i zastąpienie b.txt w trybie 7\-bitowym: .PP .Vb 3 \& dos2unix a.txt \-c 7bit b.txt \& dos2unix \-c ascii a.txt \-c 7bit b.txt \& dos2unix \-ascii a.txt \-7 b.txt .Ve .PP Konwersja a.txt z formatu Mac do formatu uniksowego: .PP .Vb 2 \& dos2unix \-c mac a.txt \& mac2unix a.txt .Ve .PP Konwersja a.txt z formatu uniksowego do formatu Mac: .PP .Vb 2 \& unix2dos \-c mac a.txt \& unix2mac a.txt .Ve .PP Konwersja i zastąpienie a.txt z zachowaniem oryginalnego znacznika czasu: .PP .Vb 2 \& dos2unix \-k a.txt \& dos2unix \-k \-o a.txt .Ve .PP Konwersja a.txt i zapis do e.txt: .PP .Vb 1 \& dos2unix \-n a.txt e.txt .Ve .PP Konwersja a.txt i zapis do e.txt z zachowaniem znacznika czasu e.txt takiego, jak a.txt: .PP .Vb 1 \& dos2unix \-k \-n a.txt e.txt .Ve .PP Konwersja i zastąpienie a.txt; konwersja b.txt i zapis do e.txt: .PP .Vb 2 \& dos2unix a.txt \-n b.txt e.txt \& dos2unix \-o a.txt \-n b.txt e.txt .Ve .PP Konwersja c.txt i zapis do e.txt; konwersja i zastąpienie a.txt; konwersja i zastąpienie b.txt; konwersja d.txt i zapis do f.txt: .PP .Vb 1 \& dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt .Ve .SH "KONWERSJA REKURENCYJNA" .IX Header "KONWERSJA REKURENCYJNA" Można użyć dos2unix w połączeniu z poleceniami \fIfind\fR\|(1) i \fIxargs\fR\|(1) do rekurencyjnej konwersji plików tekstowych w strukturze drzewa katalogów. Na przykład, aby przekonwertować wszystkie pliki .txt w drzewie katalogów poniżej katalogu bieżącego, należy napisać: .PP .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .PP Z poziomu linii poleceń Windows można użyć następującego polecenia: .PP .Vb 1 \& for /R %G in (*.txt) do dos2unix "%G" .Ve .PP Użytkownicy powłoki PowerShell mogą użyć następującego polecenia w Windows PowerShell: .PP .Vb 1 \& get\-childitem \-path . \-filter \*(Aq*.txt\*(Aq \-recurse | foreach\-object {dos2unix $_.Fullname} .Ve .SH "LOKALIZACJA" .IX Header "LOKALIZACJA" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" Główny język wybiera się zmienną środowiskową \s-1LANG.\s0 Zmienna \s-1LANG\s0 składa się z kilku części. Pierwsza część to małe litery oznaczające kod języka. Druga część jest opcjonalna i zawiera kod kraju pisany wielkimi literami, poprzedzony podkreśleniem. Jest także opcjonalna trzecia część: kodowanie znaków, poprzedzone kropką. Kilka przykładów dla powłok zgodnych ze standardem \s-1POSIX:\s0 .Sp .Vb 7 \& export LANG=nl holenderski \& export LANG=nl_NL holenderski, Holandia \& export LANG=nl_BE holenderski, Belgia \& export LANG=es_ES hiszpański, Hiszpania \& export LANG=es_MX hiszpański, Meksyk \& export LANG=en_US.iso88591 angielski, USA, kodowanie Latin\-1 \& export LANG=en_GB.UTF\-8 angielski, Wlk. Brytania, kodowanie UTF\-8 .Ve .Sp Pełną listę kodów języków i krajów można znaleźć w podręczniku do gettexta: .Sp W systemach uniksowych do uzyskania informacji dotyczących lokalizacji można użyć polecenia \fIlocale\fR\|(1). .IP "\fB\s-1LANGUAGE\s0\fR" 4 .IX Item "LANGUAGE" Przy użyciu zmiennej środowiskowej \s-1LANGUAGE\s0 można określić listę języków wg priorytetu, oddzielonych dwukropkami. Dos2unix przyjmuje pierwszeństwo zmiennej \s-1LANGUAGE\s0 nad \s-1LANG.\s0 Na przykład, najpierw holenderski, następnie niemiecki: \f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. Aby skorzystać z listy wg priorytetów ze zmiennej \s-1LANGUAGE,\s0 trzeba najpierw włączyć lokalizację przez ustawienie zmiennej \s-1LANG \s0(lub \s-1LC_ALL\s0) na wartość inną niż \*(L"C\*(R". Więcej informacji znajduje się w podręczniku do gettexta: .Sp W przypadku wybrania niedostępnego języka, otrzymamy standardowe, angielskie komunikaty. .IP "\fB\s-1DOS2UNIX_LOCALEDIR\s0\fR" 4 .IX Item "DOS2UNIX_LOCALEDIR" Przy użyciu zmiennej środowiskowej \s-1DOS2UNIX_LOCALEDIR,\s0 można nadpisać ustawienie \s-1LOCALEDIR\s0 z czasu kompilacji. \s-1LOCALEDIR\s0 to katalog używany do znalezienia plików lokalizacji. Domyślną wartością dla \s-1GNU\s0 jest \&\f(CW\*(C`/usr/local/share/locale\*(C'\fR. Opcja \fB\-\-version\fR wyświetla używaną wartość \&\s-1LOCALEDIR.\s0 .Sp Przykład (dla powłoki \s-1POSIX\s0): .Sp .Vb 1 \& export DOS2UNIX_LOCALEDIR=$HOME/share/locale .Ve .SH "WARTOŚĆ ZWRACANA" .IX Header "WARTOŚĆ ZWRACANA" W przypadku powodzenia zwracane jest zero. Jeśli wystąpi błąd systemowy, zwracany jest ostatni błąd systemowy. W przypadku innych błędów zwracane jest 1. .PP Wartość zwracana w trybie cichym to zawsze zero, z wyjątkiem sytuacji podania błędnych opcji linii poleceń. .SH "STANDARDY" .IX Header "STANDARDY" .PP .PP .PP .SH "AUTORZY" .IX Header "AUTORZY" Benjamin Lin ; Bernd Johannes Wuebben (tryb mac2unix) ; Christian Wurll (dodawanie dodatkowej nowej linii) ; Erwin Waterlander (prowadzący) .PP Strona projektu: .PP Strona SourceForge: .SH "ZOBACZ TAKŻE" .IX Header "ZOBACZ TAKŻE" \&\fIfile\fR\|(1) \fIfind\fR\|(1) \fIiconv\fR\|(1) \fIlocale\fR\|(1) \fIxargs\fR\|(1) dos2unix-7.3.4/man/pl/man1/dos2unix.htm0000644000175500010010000011316412721132574017070 0ustar waterlanGeen dos2unix 7.3.4 - konwerter formatu plików tekstowych między systemami DOS/Mac a Uniksem

NAZWA

dos2unix - konwerter formatu plików tekstowych między systemami DOS/Mac a Uniksem

SKŁADNIA

    dos2unix [opcje] [PLIK ...] [-n PLIK_WEJ PLIK_WYJ ...]
    unix2dos [opcje] [PLIK ...] [-n PLIK_WEJ PLIK_WYJ ...]

OPIS

Pakiet Dos2unix zawiera narzędzia dos2unix oraz unix2dos do konwersji zwykłych plików tekstowych między formatami używanymi w systemach DOS lub Mac a formatem uniksowym.

W plikach tekstowych systemu DOS/Windows oznaczenie końca linii to połączenie dwóch znaków: powrotu karetki (CR) i przesunięcia linii (LF). W uniksowych plikach tekstowych koniec linii to pojedynczy znak LF. W plikach tekstowych systemu Mac sprzed Mac OS X koniec linii był pojedynczym znakiem CR. Obecnie Mac OS wykorzystuje uniksowe końce linii (LF).

Oprócz oznaczeń końców linii Dos2unix potrafi konwertować także kodowanie plików. Kilko stron kodowych DOS-a może być przekonwertowanych do uniksowego Latin-1, a windowsowy Unicode (UTF-16) do powszechniejszego pod Uniksem kodowania Unicode UTF-8.

Pliki binarne są pomijane automatycznie, chyba że konwersja zostanie wymuszona.

Pliki inne niż zwykłe, np. katalogi lub FIFO, są pomijane automatycznie.

Dowiązania symboliczne i ich cele są domyślnie pozostawiane bez zmian. Dowiązania symboliczne mogą być opcjonalnie zastępowane, albo wyjście może być zapisywane do celu dowiązania. Zapis do celu dowiązania symbolicznego nie jest obsługiwane pod Windows.

Dos2unix powstał na podstawie narzędzia dos2unix z systemu SunOS/Solaris. Jest jedna istotna różnica w stosunku do oryginalnej wersji z SunOS-a/Solarisa: ta wersja domyślnie wykonuje konwersję w miejscu (tryb starego pliku), podczas gdy oryginalna obsługiwała tylko konwersję parami (tryb nowego pliku) - p. także opcje -o i -n. Ponadto wersja z SunOS-a/Solarisa domyślnie wykonuje konwersję w trybie iso, podczas gdy ta wersja domyślnie wykonuje konwersję w trybie ascii.

OPCJE

--

Potraktowanie wszystkich kolejnych opcji jako nazw plików. Tej opcji należy użyć, aby przekonwertować pliki, których nazwy zaczynają się od minusa. Przykładowo, aby przekonwertować plik o nazwie "-foo", można użyć polecenia:

    dos2unix -- -foo

Lub w trybie nowego pliku:

    dos2unix -n -- -foo out.txt
-ascii

Konwersja tylko znaków końca linii. Jest to domyślny tryb konwersji.

-iso

Konwersja między zestawami znaków DOS i ISO-8859-1. Więcej w sekcji TRYBY KONWERSJI.

-1252

Użycie strony kodowej Windows 1252 (zachodnioeuropejskiej).

-437

Użycie strony kodowej DOS 437 (US). Jest to domyślna strona kodowa używana przy konwersji ISO.

-850

Użycie strony kodowej DOS 850 (zachodnioeuropejskiej).

-860

Użycie strony kodowej DOS 860 (portugalskiej).

-863

Użycie strony kodowej DOS 863 (kanadyjskiej francuskiej).

-865

Użycie strony kodowej DOS 865 (nordyckiej).

-7

Konwersja znaków 8-bitowych do przestrzeni 7-bitowej.

-b, --keep-bom

Zachowanie znaku BOM (Byte Order Makr). Jeżeli plik wejściowy zawiera BOM, powoduje zapisanie go w pliku wyjściowym. Jest to domyślne zachowanie przy konwersji na DOS-owe końce linii. P. także opcja -r.

-c, --convmode TRYB_KONW

Ustawienie trybu konwersji. TRYB_KONW to jeden z: ascii, 7bit, iso, mac, przy czym domyślny jest ascii.

-D, --display-enc KODOWANIE

Ustawienie kodowania wyświetlanego tekstu. KODOWANIE to jedno z: ansi, unicode, unicodebom, utf8, utf8bom, przy czym domyślne to ansi.

Ta opcja jest dostępna wyłączenie w programie dos2unix dla Windows z obsługą nazw plików Unicode. Nie ma wpływu na same nawy odczytywanych i zapisywanych plików, a jedynie na sposób ich wyświetlania.

Istnieje kilka sposobów wyświetlania tekstu w konsoli Windows w zależności od kodowania tekstu. Wszystkie mają swoje zalety i wady.

ansi

Domyślna metoda programu dos2unix to stosowanie tekstu kodowanego w ANSI. Zaletą jest wsteczna zgodność. Działa z fontami rastrowymi, jak i TrueType. W niektórych rejonach może być potrzeba zmiany aktywnej strony kodowej DOS OEM na systemową stronę kodową Windows ANSI przy użyciu polecenia chcp, ponieważ dos2unix wykorzystuje systemową stronę kodową Windows.

Wadą kodowania ansi jest fakt, że międzynarodowe nazwy plików ze znakami spoza domyślnej systemowej strony kodowej nie są wyświetlane właściwie. Można zamiast tego zobaczyć znak zapytania albo niewłaściwy symbol. Jeżeli nie pracujemy z obcymi nazwami plików, ta metoda jest poprawna.

unicode, unicodebom

Zaletą kodowania unicode (windowsową nazwą dla UTF-16) jest (zwykle) właściwe wyświetlanie tekstu. Nie ma potrzeby zmiany aktywnej strony kodowej. Może być potrzeba zmiany fontu konsoli na font TrueType, aby znaki międzynarodowe były wyświetlane poprawnie. Jeśli znak nie jest obecny w foncie TrueType, zwykle widać mały kwadrat, czasami ze znakiem zapytania w środku.

W przypadku używania konsoli ConEmu cały tekst jest wyświetlany poprawnie, ponieważ ConEmu automatycznie wybiera dobry font.

Wadą kodowania unicode jest niezgodność z ASCII. Wyjście nie jest łatwe do obsłużenia w przypadku przekierowania do innego programu lub pliku.

W przypadku użycia metody unicodebom, tekst w unikodzie jest poprzedzony znakiem BOM (Byte Order Mark). BOM jest wymagany do poprawnego przekierowania lub przekazywania przez potok w powłoce PowerShell.

utf8, utf8bom

Zaletą kodowania utf8 jest zgodność z ASCII. Trzeba ustawić font konsoli na font TrueType. Przy użyciu fontu TrueType tekst jest wyświetlany podobnie do kodowania unicode.

Wadą jest fakt, że w przypadku używania domyślnego fontu rastrowego, wszystkie znaki spoza ASCII są wyświetlane niepoprawnie. Nie tylko unikodowe nazwy plików, ale także przetłumaczone komunikaty stają się nieczytelne. W Windows skonfigurowanym dla rejonu Azji Wschodniej widać dużo migotania konsoli w trakcie wyświetlania komunikatów.

W konsoli ConEmu metoda kodowania utf8 działa dobrze.

W przypadku użycia metody utf8bom, tekst w UTF-8 jest poprzedzony znakiem BOM (Byte Order Mark). BOM jest wymagany do poprawnego przekierowania lub przekazywania przez potok w powłoce PowerShell.

Domyślne kodowanie można zmienić przy użyciu zmiennej środowiskowej DOS2UNIX_DISPLAY_ENC, ustawiając ją na unicode, unicodebom, utf8 lub utf8bom.

-f, --force

Wymuszenie konwersji plików binarnych.

-gb, --gb18030

Pod Windows pliki w UTF-16 są domyślnie konwertowane do UTF-8, niezależnie od ustawienia lokalizacji. Ta opcja pozwala przekonwertować pliki w UTF-16 do GB18030. Opcja jest dostępna tylko pod Windows, więcej w sekcji dotyczącej GB18030.

-h, --help

Wyświetlenie opisu i zakończenie.

-i[FLAGI], --info[=FLAGI] PLIK ...

Wyświetlenie informacji o pliku. Konwersja nie jest wykonywana.

Wypisywane są następujące informacje, w tej kolejności: liczba DOS-owych końców linii, liczba uniksowych końców linii, liczba macowych końców linii, znacznik BOM, tekstowy lub binarny, nazwa pliku.

Przykładowe wyjście:

     6       0       0  no_bom    text    dos.txt
     0       6       0  no_bom    text    unix.txt
     0       0       6  no_bom    text    mac.txt
     6       6       6  no_bom    text    mixed.txt
    50       0       0  UTF-16LE  text    utf16le.txt
     0      50       0  no_bom    text    utf8unix.txt
    50       0       0  UTF-8     text    utf8dos.txt
     2     418     219  no_bom    binary  dos2unix.exe

Uwaga: czasami plik binarny może być błędnie rozpoznany jako tekstowy. P. także opcja -s.

Opcjonalnie można ustawić dodatkowe flagi, aby zmienić wyjście. Można dodać jedną lub więcej flag.

d

Wypisanie liczby DOS-owych końców linii.

u

Wypisanie liczby uniksowych końców linii.

m

Wypisanie liczby macowych końców linii.

b

Wypisanie znacznika BOM.

t

Wypisanie, czy plik jest tekstowy, czy binarny.

c

Wypisanie tylko plików, które zostałyby przekonwertowane.

Z flagą c dos2unix wypisze tylko pliki zawierające DOS-owe końce linii, a unix2dos wypisze tylko nazwy plików zawierających uniksowe końce linii.

h

Wypisanie nagłówka.

p

Wyświetlanie nazw plików bez ścieżki.

Przykłady:

Pokazanie informacji o wszystkich plikach *.txt:

    dos2unix -i *.txt

Pokazanie tylko liczby DOS-owych i uniksowych końców linii:

    dos2unix -idu *.txt

Pokazanie tylko znacznika BOM:

    dos2unix --info=b *.txt

Wypisanie listy plików zawierających DOS-owe końce linii:

    dos2unix -ic *.txt

Wypisanie listy plików zawierających uniksowe końce linii:

    unix2dos -ic *.txt

Konwersja tylko plików mających DOS-owe końce linii, pozostawienie pozostałych bez zmian:

    dos2unix -ic *.txt | xargs dos2unix

Wyszukanie plików tekstowych zawierających DOS-owe końce linii:

    find -name '*.txt' | xargs dos2unix -ic
-k, --keepdate

Zachowanie znacznika czasu pliku wyjściowego takiego samego, jak pliku wejściowego.

-L, --license

Wyświetlenie licencji programu.

-l, --newline

Dodanie dodatkowego znaku końca linii.

dos2unix: tylko DOS-owe znaki końca linii są zamieniane na dwa uniksowe. W trybie Mac tylko macowe znaki końca linii są zamieniane na dwa uniksowe.

unix2dos: tylko uniksowe znaki końca linii są zamieniane na dwa DOS-owe. W trybie Mac uniksowe znaki końca linii są zamieniane na dwa macowe.

-m, --add-bom

Zapisanie znacznika BOM (Byte Order Mark) w pliku wyjściowym. Domyślnie zapisywany jest BOM UTF-8.

Jeśli plik wejściowy jest w kodowaniu UTF-16 i użyto opcji -u, zostanie zapisany BOM UTF-16.

Nigdy nie należy używać tej opcji, jeśli kodowanie wyjściowe jest inne niż UTF-8, UTF-16 lub GB18030. Więcej w sekcji UNICODE.

-n, --newfile PLIK_WEJ PLIK_WYJ ...

Tryb nowego pliku. Konwersja PLIKU_WEJ z zapisem wyjścia do PLIKU_WYJ. Nazwy plików muszą być podane parami, a masek nie należy używać, gdyż spowoduje to utratę plików.

Osoba uruchamiająca konwersję w trybie nowego pliku (par) będzie właścicielem przekonwertowanego pliku. Prawa odczytu/zapisu nowego pliku będą pochodziły z praw pliku oryginalnego po odjęciu umask(1) osoby uruchamiającej konwersję.

-o, --oldfile PLIK ...

Tryb starego pliku. Konwersja PLIKU i nadpisanie go wyjściem. Program działa domyślnie w tym trybie. Można używać masek.

W trybie starego pliku (w miejscu) przekonwertowany plik otrzymuje tego samego właściciela, grupę oraz prawa odczytu/zapisu, jak plik oryginalny - także wtedy, gdy plik jest konwertowany przez innego użytkownika, mającego prawo zapisu do pliku (np. przez użytkownika root). Konwersja zostanie przerwana, jeśli nie będzie możliwe zachowanie oryginalnych wartości. Zmiana właściciela mogłaby oznaczać, że pierwotny właściciel nie może już odczytać pliku. Zmiana grupy mogłaby być zagrożeniem bezpieczeństwa, plik mógłby być czytelny dla nie zamierzonych osób. Zachowanie właściciela, grupy i praw odczytu/zapisu jest obsługiwane tylko na Uniksie.

-q, --quiet

Tryb cichy. Pominięcie wszystkich ostrzeżeń i komunikatów. Zwracanym kodem jest zero, chyba że podano błędne opcje linii poleceń.

-r, --remove-bom

Usunięcie znaków BOM (Byte Order Mark). Bez zapisywania BOM do pliku wyjściowego. Jest to domyślne zachowanie przy konwersji na uniksowe końce linii. P. także opcja -b.

-s, --safe

Pominięcie plików binarnych (domyślne).

Pomijanie plików binarnych ma na celu zapobieżenie przypadkowym błędom. Uwaga: wykrywanie plików binarnych nie jest w 100% odporne na błędy. Pliki wejściowe są przeszukiwane pod kątem symboli binarnych, które zwykle nie występują w plikach tekstowych. Może się zdarzyć, że plik binarny zawiera tylko zwykłe znaki tekstowe. Taki plik binarny będzie błędnie widziany jako plik tekstowy.

-u, --keep-utf16

Zachowanie oryginalnego kodowania pliku wejściowego UTF-16. Plik wyjściowy zostanie zapisany w tym samym kodowaniu UTF-16 (little lub big endian), co plik wejściowy. Zapobiega to przekształceniu do UTF-8. Do pliku zostanie zapisany odpowiedni znacznik BOM UTF-16. Tę opcję można wyłączyć opcją -ascii.

-ul, --assume-utf16le

Przyjęcie, że format pliku wejściowego to UTF-16LE.

Jeśli w pliku wejściowym jest znacznik BOM (Byte Order Mark), ma on priorytet nad tą opcją.

Jeśli przyjęto błędne założenie (plik wejściowy nie jest w formacie UTF-16LE), a konwersja się uda, wynikiem będzie plik wyjściowy UTF-8 ze złym tekstem. Konwersję tę można odwrócić przy użyciu polecenia iconv(1) do konwersji wyjścia UTF-8 z powrotem do UTF-16LE. Przywróci to plik oryginalny.

Przyjęcie UTF-16LE działa jako tryb konwersji. Przy przełączeniu na domyślny tryb ascii przyjęcie UTF-16LE jest wyłączane.

-ub, --assume-utf16be

Przyjęcie, że format pliku wejściowego to UTF-16BE.

Ta opcja działa analogicznie do -ul.

-v, --verbose

Wyświetlanie szczegółowych komunikatów. Wyświetlane śa dodatkowe informacje o znacznikach BOM (Byte Order Mark) oraz liczbie przekonwertowanych końców linii.

Podążanie za dowiązaniami symbolicznymi i konwertowanie ich celów

Zastępowanie dowiązań symbolicznych przekonwertowanymi plikami (oryginalne pliki docelowe pozostają bez zmian).

Pozostawienie dowiązań symbolicznych i celów bez zmian (domyślne).

-V, --version

Wyświetlenie informacji o wersji i zakończenie.

TRYB MAC

W zwykłym trybie znaki końca linii są konwertowane z DOS-a do Uniksa i odwrotnie. Znaki końca linii systemu Mac nie są konwertowane.

W trybie Mac znaki końca linii są konwertowane z formatu Maca do Uniksa i odwrotnie. Znaki końca linii systemu DOS nie są zmieniane.

Aby uruchomić program w trybie Mac, należy użyć opcji linii poleceń -c mac albo użyć poleceń mac2unix lub unix2mac.

TRYBY KONWERSJI

ascii

W trybie ascii konwertowane są tylko końce linii. Jest to domyślny tryb konwersji.

Mimo że nazwa tego trybu to ASCII, które jest standardem 7-bitowym, jest to tryb 8-bitowy. Należy zawsze używać tego trybu przy konwersji plików Unicode UTF-8.

7bit

W tym trybie wszystkie znaki 8-bitowe spoza ASCII (o wartościach od 128 do 255) są konwertowane do przestrzeni 7-bitowej.

iso

W tym trybie znaki są konwertowane między zestawem znaków DOS (stroną kodową) a zestawem znaków ISO-8859-1 (Latin-1) używanym na Uniksie. Znaki DOS-owe nie mające odpowiednika w ISO-8859-1, których nie da się przekonwertować, są zamieniane na kropkę. To samo dotyczy znaków ISO-8859-1 bez odpowiednika w DOS-ie.

Jeśli używana jest tylko opcja -iso, dos2unix próbuje wykryć aktywną stronę kodową. Jeśli nie jest to możliwe, dos2unix używa domyślnej strony kodowej CP437, stosowanej głównie w USA. Aby wymusić określoną stronę kodową, należy użyć opcji -437 (US), -850 (zachodnioeuropejska), -860 (portugalska), -863 (kanadyjska francuska) lub -865 (nordycka). Ponadto obsługiwana jest strona kodowa Windows CP1252 (zachodnioeuropejska) przy użyciu opcji -1252. W przypadku innych stron kodowych można użyć narzędzia dos2unix wraz z iconv(1). Iconv potrafi konwertować między wieloma kodowaniami znaków.

Nigdy nie należy używać konwersji ISO na plikach tekstowych w Unicode. Uszkodziłaby pliki kodowane UTF-8.

Kilka przykładów:

Konwersja z domyślnej strony kodowej DOS do uniksowego Latin-1:

    dos2unix -iso -n in.txt out.txt

Konwersja ze strony kodowej DOS CP850 do uniksowego Latin-1:

    dos2unix -850 -n in.txt out.txt

Konwersja ze strony kodowej Windows CP1252 do uniksowego Latin-1:

    dos2unix -1252 -n in.txt out.txt

Konwersja ze strony kodowej Windows CP1252 do uniksowego UTF-8 (Unicode):

    iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt

Konwersa z uniksowego Latin-1 do domyślnej strony kodowej DOS:

    unix2dos -iso -n in.txt out.txt

Konwersja z uniksowego Latin-1 do strony kodowej DOS CP850:

    unix2dos -850 -n in.txt out.txt

Konwersja z uniksowego Latin-1 do strony kodowej Windows CP1252:

    unix2dos -1252 -n in.txt out.txt

Konwersja z uniksowego UTF-8 (Unicode) do strony kodowej Windows CP1252:

    unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt

Więcej pod adresem http://czyborra.com/charsets/codepages.html oraz http://czyborra.com/charsets/iso8859.html.

UNICODE

Kodowania

Istnieją różne kodowania Unicode. Pod Uniksem i Linuksem pliki Unicode są zwykle kodowane z użyciem UTF-8. Pod Windows pliki tekstowe Unicode mogą być kodowane w UTF-8, UTF-16, UTF-16 big-endian, ale przeważnie są kodowane w UTF-16.

Konwersje

Pliki tekstowe Unicode mogą mieć znaki końca linii systemu DOS, Unix lub Mac, podobnie jak zwykłe pliki tekstowe.

Wszystkie wersje dos2unix i unix2dos potrafią konwertować pliki kodowane UTF-8, ponieważ UTF-8 jest wstecznie zgodne z ASCII.

Dos2unix i unix2dos z obsługą Unicode UTF-16 potrafią odczytywać pliki tekstowe kodowane UTF-16 little- oraz big-endian. Aby sprawdzić, czy dos2unix został zbudowany z obsługą UTF-16, należy napisać dos2unix -V.

Pod Uniksem/Linuksem pliki w kodowaniu UTF-16 są konwertowane do kodowania znaków ustawionej lokalizacji. Kodowanie znaków dla lokalizacji można sprawdzić poleceniem locale(1). Jeśli konwersja nie jest możliwa, wystąpi błąd, a plik zostanie pominięty.

Pod Windows pliki UTF-16 są domyślnie konwertowane do UTF-8. Pliki tekstkowe w kodowaniu UTF-8 są dobrze obsługiwane zarówno pod Windows, jak i Uniksem/Linuksem.

Kodowania UTF-16 i UTF-8 są w pełni zgodne, konwersja nie spowoduje utraty żadnej części tekstu. W przypadku wystąpienia błędu konwersji, na przykład w przypadku błędu w pliku wejściowym UTF-16, plik zostanie pominięty.

W przypadku użycia opcji -u, plik wejściowy zostanie zapisany w tym samym kodowaniu UTF-16, co plik wejściowy. Opcja -u zapobiega konwersji do UTF-8.

Dos2unix oraz unix2dos nie mają opcji pozwalającej na konwersję plików UTF-8 do UTF-16.

Tryby konwersji ISO i 7-bit nie działają na plikach UTF-16.

Znacznik BOM

W systemie Windows pliki tekstowe zwykle zawierają znacznik BOM (Byte Order Mark), ponieważ wiele programów dla Windows (w tym Notepad) dodaje domyślnie znaczniki BOM. Więcej informacji można znaleźć pod adresem http://pl.wikipedia.org/wiki/BOM_(informatyka).

Pod Uniksem pliki Unicode zwykle nie mają znacznika BOM. Pliki tekstowe są traktowane jako kodowane zgodnie z kodowaniem znaków ustawionej lokalizacji.

Dos2unix potrafi wykryć tylko, czy plik jest w formacie UTF-16, jeśli zawiera znacznik BOM. Jeśli plik UTF-16 nie ma tego znacznika, dos2unix potraktuje plik jako binarny.

Do konwersji pliku UTF-16 bez znacznika BOM można użyć opcji -ul lub -ub.

Dos2unix nie zapisuje domyślnie znaku BOM w pliku wyjściowym. Z opcją -b Dos2unix zapisuje BOM, jeśli plik wejściowy zawiera BOM.

Unix2dos domyślnie zapisuje znaczniki BOM w pliku wyjściowym, jeśli plik wejściowy ma BOM. Aby usunąć BOM, można użyć opcji -r.

Dos2unix oraz unix2dos zawsze zapisują znaczniki BOM, jeśli użyta zostanie opcja -m.

Unikodowe nazwy plików w Windows

Dos2unix ma opcjonalną obsługę odczytu i zapisu nazw plików Unicode w linii poleceń Windows. Oznacza to, że dos2unix potrafi otwierać pliki zawierające w nazwie znaki spoza domyślnej systemowej strony kodowej ANSI. Aby sprawdzić, czy dos2unix dla Windows został zbudowany z obsługą nazw plików Unicode, można wpisać dos2unix -V.

Przy wyświetlaniu nazw plików Unicode w konsoli Windows występuje kilka problemów. Więcej informacji w opisie opcji -D, --display-enc. Nazwy plików mogą być wyświetlane błędnie na konsoli, ale pliki będą zapisywane z poprawną nazwą.

Przykłady Unicode

Konwersja pliku UTF-16 (z BOM) z formatu Windows do uniksowego UTF-8:

    dos2unix -n in.txt out.txt

Konwersja pliku UTF-16LE (bez BOM) z formatu Windows do uniksowego UTF-8:

    dos2unix -ul -n in.txt out.txt

Konwersja z uniksowego UTF-8 do UTF-8 z BOM dla Windows:

    unix2dos -m -n in.txt out.txt

Konwersja z uniksowego UTF-8 do UTF-16 dla Windows:

    unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt

GB18030

GB18030 to standard urzędowy w Chinach. Obowiązkowy podzbiór standardu GB18030 jest oficjalnym wymaganiem każdego oprogramowania sprzedawanego w Chinach. Więcej pod adresem http://en.wikipedia.org/wiki/GB_18030.

GB18030 jest w pełni zgodny z Unicode i może być uważany za format transformacji unikodu. Podobnie jak UTF-8, GB18030 jest zgodny z ASCII. Jest także zgodny ze stroną kodową Windows 936, znaną też jako GBK.

Pod Uniksem/Linuksem pliki UTF-16 są konwertowane do GB18030, jeśli kodowanie dla lokalizacji jest ustawione na GB18030. Uwaga: będzie to działać tylko, jeśli lokalizacja jest obsługiwana przez system. Listę obsługiwanych lokalizacji można sprawdzić poleceniem locale -a.

Pod Windows w celu konwersji plików UTF-16 do GB18030 należy użyć opcji -gb.

Pliki w kodowaniu GB18030 mogą mieć znacznik BOM, podobnie jak pliki w Unicode.

PRZYKŁADY

Odczyt ze standardowego wejścia i zapis na standardowe wyjście:

    dos2unix < a.txt
    cat a.txt | dos2unix

Konwersja i zastąpienie a.txt; konwersja i zastąpienie b.txt:

    dos2unix a.txt b.txt
    dos2unix -o a.txt b.txt

Konwersja i zastąpienie a.txt w trybie ascii:

    dos2unix a.txt

Konwersja i zastąpienie a.txt w trybie ascii; konwersja i zastąpienie b.txt w trybie 7-bitowym:

    dos2unix a.txt -c 7bit b.txt
    dos2unix -c ascii a.txt -c 7bit b.txt
    dos2unix -ascii a.txt -7 b.txt

Konwersja a.txt z formatu Mac do formatu uniksowego:

    dos2unix -c mac a.txt
    mac2unix a.txt

Konwersja a.txt z formatu uniksowego do formatu Mac:

    unix2dos -c mac a.txt
    unix2mac a.txt

Konwersja i zastąpienie a.txt z zachowaniem oryginalnego znacznika czasu:

    dos2unix -k a.txt
    dos2unix -k -o a.txt

Konwersja a.txt i zapis do e.txt:

    dos2unix -n a.txt e.txt

Konwersja a.txt i zapis do e.txt z zachowaniem znacznika czasu e.txt takiego, jak a.txt:

    dos2unix -k -n a.txt e.txt

Konwersja i zastąpienie a.txt; konwersja b.txt i zapis do e.txt:

    dos2unix a.txt -n b.txt e.txt
    dos2unix -o a.txt -n b.txt e.txt

Konwersja c.txt i zapis do e.txt; konwersja i zastąpienie a.txt; konwersja i zastąpienie b.txt; konwersja d.txt i zapis do f.txt:

    dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt

KONWERSJA REKURENCYJNA

Można użyć dos2unix w połączeniu z poleceniami find(1) i xargs(1) do rekurencyjnej konwersji plików tekstowych w strukturze drzewa katalogów. Na przykład, aby przekonwertować wszystkie pliki .txt w drzewie katalogów poniżej katalogu bieżącego, należy napisać:

    find . -name '*.txt' |xargs dos2unix

Z poziomu linii poleceń Windows można użyć następującego polecenia:

    for /R %G in (*.txt) do dos2unix "%G"

Użytkownicy powłoki PowerShell mogą użyć następującego polecenia w Windows PowerShell:

    get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}

LOKALIZACJA

LANG

Główny język wybiera się zmienną środowiskową LANG. Zmienna LANG składa się z kilku części. Pierwsza część to małe litery oznaczające kod języka. Druga część jest opcjonalna i zawiera kod kraju pisany wielkimi literami, poprzedzony podkreśleniem. Jest także opcjonalna trzecia część: kodowanie znaków, poprzedzone kropką. Kilka przykładów dla powłok zgodnych ze standardem POSIX:

    export LANG=nl               holenderski
    export LANG=nl_NL            holenderski, Holandia
    export LANG=nl_BE            holenderski, Belgia
    export LANG=es_ES            hiszpański, Hiszpania
    export LANG=es_MX            hiszpański, Meksyk
    export LANG=en_US.iso88591   angielski, USA, kodowanie Latin-1
    export LANG=en_GB.UTF-8      angielski, Wlk. Brytania, kodowanie UTF-8

Pełną listę kodów języków i krajów można znaleźć w podręczniku do gettexta: http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

W systemach uniksowych do uzyskania informacji dotyczących lokalizacji można użyć polecenia locale(1).

LANGUAGE

Przy użyciu zmiennej środowiskowej LANGUAGE można określić listę języków wg priorytetu, oddzielonych dwukropkami. Dos2unix przyjmuje pierwszeństwo zmiennej LANGUAGE nad LANG. Na przykład, najpierw holenderski, następnie niemiecki: LANGUAGE=nl:de. Aby skorzystać z listy wg priorytetów ze zmiennej LANGUAGE, trzeba najpierw włączyć lokalizację przez ustawienie zmiennej LANG (lub LC_ALL) na wartość inną niż "C". Więcej informacji znajduje się w podręczniku do gettexta: http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

W przypadku wybrania niedostępnego języka, otrzymamy standardowe, angielskie komunikaty.

DOS2UNIX_LOCALEDIR

Przy użyciu zmiennej środowiskowej DOS2UNIX_LOCALEDIR, można nadpisać ustawienie LOCALEDIR z czasu kompilacji. LOCALEDIR to katalog używany do znalezienia plików lokalizacji. Domyślną wartością dla GNU jest /usr/local/share/locale. Opcja --version wyświetla używaną wartość LOCALEDIR.

Przykład (dla powłoki POSIX):

    export DOS2UNIX_LOCALEDIR=$HOME/share/locale

WARTOŚĆ ZWRACANA

W przypadku powodzenia zwracane jest zero. Jeśli wystąpi błąd systemowy, zwracany jest ostatni błąd systemowy. W przypadku innych błędów zwracane jest 1.

Wartość zwracana w trybie cichym to zawsze zero, z wyjątkiem sytuacji podania błędnych opcji linii poleceń.

STANDARDY

http://pl.wikipedia.org/wiki/Plik_tekstowy

http://en.wikipedia.org/wiki/Carriage_return

http://pl.wikipedia.org/wiki/End-of-line

http://pl.wikipedia.org/wiki/Unicode

AUTORZY

Benjamin Lin <blin@socs.uts.edu.au>; Bernd Johannes Wuebben (tryb mac2unix) <wuebben@kde.org>; Christian Wurll (dodawanie dodatkowej nowej linii) <wurll@ira.uka.de>; Erwin Waterlander <waterlan@xs4all.nl> (prowadzący)

Strona projektu: http://waterlan.home.xs4all.nl/dos2unix.html

Strona SourceForge: http://sourceforge.net/projects/dos2unix/

ZOBACZ TAKŻE

file(1) find(1) iconv(1) locale(1) xargs(1)

dos2unix-7.3.4/man/pl/man1/dos2unix.pod0000644000175500010010000006576712721132565017101 0ustar waterlanGeen ***************************************************** * GENERATED FILE, DO NOT EDIT * * THIS IS NO SOURCE FILE, BUT RESULT OF COMPILATION * ***************************************************** This file was generated by po4a(7). Do not store it (in VCS, for example), but store the PO file used as source file by po4a-translate. In fact, consider this as a binary, and the PO file as a regular .c file: If the PO get lost, keeping this translation up-to-date will be harder. =pod =encoding UTF-8 =head1 NAZWA dos2unix - konwerter formatu plików tekstowych między systemami DOS/Mac a Uniksem =head1 SKŁADNIA dos2unix [opcje] [PLIK ...] [-n PLIK_WEJ PLIK_WYJ ...] unix2dos [opcje] [PLIK ...] [-n PLIK_WEJ PLIK_WYJ ...] =head1 OPIS Pakiet Dos2unix zawiera narzędzia C oraz C do konwersji zwykłych plików tekstowych między formatami używanymi w systemach DOS lub Mac a formatem uniksowym. W plikach tekstowych systemu DOS/Windows oznaczenie końca linii to połączenie dwóch znaków: powrotu karetki (CR) i przesunięcia linii (LF). W uniksowych plikach tekstowych koniec linii to pojedynczy znak LF. W plikach tekstowych systemu Mac sprzed Mac OS X koniec linii był pojedynczym znakiem CR. Obecnie Mac OS wykorzystuje uniksowe końce linii (LF). Oprócz oznaczeń końców linii Dos2unix potrafi konwertować także kodowanie plików. Kilko stron kodowych DOS-a może być przekonwertowanych do uniksowego Latin-1, a windowsowy Unicode (UTF-16) do powszechniejszego pod Uniksem kodowania Unicode UTF-8. Pliki binarne są pomijane automatycznie, chyba że konwersja zostanie wymuszona. Pliki inne niż zwykłe, np. katalogi lub FIFO, są pomijane automatycznie. Dowiązania symboliczne i ich cele są domyślnie pozostawiane bez zmian. Dowiązania symboliczne mogą być opcjonalnie zastępowane, albo wyjście może być zapisywane do celu dowiązania. Zapis do celu dowiązania symbolicznego nie jest obsługiwane pod Windows. Dos2unix powstał na podstawie narzędzia dos2unix z systemu SunOS/Solaris. Jest jedna istotna różnica w stosunku do oryginalnej wersji z SunOS-a/Solarisa: ta wersja domyślnie wykonuje konwersję w miejscu (tryb starego pliku), podczas gdy oryginalna obsługiwała tylko konwersję parami (tryb nowego pliku) - p. także opcje C<-o> i C<-n>. Ponadto wersja z SunOS-a/Solarisa domyślnie wykonuje konwersję w trybie I, podczas gdy ta wersja domyślnie wykonuje konwersję w trybie I. =head1 OPCJE =over 4 =item B<--> Potraktowanie wszystkich kolejnych opcji jako nazw plików. Tej opcji należy użyć, aby przekonwertować pliki, których nazwy zaczynają się od minusa. Przykładowo, aby przekonwertować plik o nazwie "-foo", można użyć polecenia: dos2unix -- -foo Lub w trybie nowego pliku: dos2unix -n -- -foo out.txt =item B<-ascii> Konwersja tylko znaków końca linii. Jest to domyślny tryb konwersji. =item B<-iso> Konwersja między zestawami znaków DOS i ISO-8859-1. Więcej w sekcji TRYBY KONWERSJI. =item B<-1252> Użycie strony kodowej Windows 1252 (zachodnioeuropejskiej). =item B<-437> Użycie strony kodowej DOS 437 (US). Jest to domyślna strona kodowa używana przy konwersji ISO. =item B<-850> Użycie strony kodowej DOS 850 (zachodnioeuropejskiej). =item B<-860> Użycie strony kodowej DOS 860 (portugalskiej). =item B<-863> Użycie strony kodowej DOS 863 (kanadyjskiej francuskiej). =item B<-865> Użycie strony kodowej DOS 865 (nordyckiej). =item B<-7> Konwersja znaków 8-bitowych do przestrzeni 7-bitowej. =item B<-b, --keep-bom> Zachowanie znaku BOM (Byte Order Makr). Jeżeli plik wejściowy zawiera BOM, powoduje zapisanie go w pliku wyjściowym. Jest to domyślne zachowanie przy konwersji na DOS-owe końce linii. P. także opcja C<-r>. =item B<-c, --convmode TRYB_KONW> Ustawienie trybu konwersji. TRYB_KONW to jeden z: I, I<7bit>, I, I, przy czym domyślny jest ascii. =item B<-D, --display-enc KODOWANIE> Ustawienie kodowania wyświetlanego tekstu. KODOWANIE to jedno z: I, I, I, I, I, przy czym domyślne to ansi. Ta opcja jest dostępna wyłączenie w programie dos2unix dla Windows z obsługą nazw plików Unicode. Nie ma wpływu na same nawy odczytywanych i zapisywanych plików, a jedynie na sposób ich wyświetlania. Istnieje kilka sposobów wyświetlania tekstu w konsoli Windows w zależności od kodowania tekstu. Wszystkie mają swoje zalety i wady. =over 4 =item B Domyślna metoda programu dos2unix to stosowanie tekstu kodowanego w ANSI. Zaletą jest wsteczna zgodność. Działa z fontami rastrowymi, jak i TrueType. W niektórych rejonach może być potrzeba zmiany aktywnej strony kodowej DOS OEM na systemową stronę kodową Windows ANSI przy użyciu polecenia C, ponieważ dos2unix wykorzystuje systemową stronę kodową Windows. Wadą kodowania ansi jest fakt, że międzynarodowe nazwy plików ze znakami spoza domyślnej systemowej strony kodowej nie są wyświetlane właściwie. Można zamiast tego zobaczyć znak zapytania albo niewłaściwy symbol. Jeżeli nie pracujemy z obcymi nazwami plików, ta metoda jest poprawna. =item B Zaletą kodowania unicode (windowsową nazwą dla UTF-16) jest (zwykle) właściwe wyświetlanie tekstu. Nie ma potrzeby zmiany aktywnej strony kodowej. Może być potrzeba zmiany fontu konsoli na font TrueType, aby znaki międzynarodowe były wyświetlane poprawnie. Jeśli znak nie jest obecny w foncie TrueType, zwykle widać mały kwadrat, czasami ze znakiem zapytania w środku. W przypadku używania konsoli ConEmu cały tekst jest wyświetlany poprawnie, ponieważ ConEmu automatycznie wybiera dobry font. Wadą kodowania unicode jest niezgodność z ASCII. Wyjście nie jest łatwe do obsłużenia w przypadku przekierowania do innego programu lub pliku. W przypadku użycia metody C, tekst w unikodzie jest poprzedzony znakiem BOM (Byte Order Mark). BOM jest wymagany do poprawnego przekierowania lub przekazywania przez potok w powłoce PowerShell. =item B Zaletą kodowania utf8 jest zgodność z ASCII. Trzeba ustawić font konsoli na font TrueType. Przy użyciu fontu TrueType tekst jest wyświetlany podobnie do kodowania C. Wadą jest fakt, że w przypadku używania domyślnego fontu rastrowego, wszystkie znaki spoza ASCII są wyświetlane niepoprawnie. Nie tylko unikodowe nazwy plików, ale także przetłumaczone komunikaty stają się nieczytelne. W Windows skonfigurowanym dla rejonu Azji Wschodniej widać dużo migotania konsoli w trakcie wyświetlania komunikatów. W konsoli ConEmu metoda kodowania utf8 działa dobrze. W przypadku użycia metody C, tekst w UTF-8 jest poprzedzony znakiem BOM (Byte Order Mark). BOM jest wymagany do poprawnego przekierowania lub przekazywania przez potok w powłoce PowerShell. =back Domyślne kodowanie można zmienić przy użyciu zmiennej środowiskowej DOS2UNIX_DISPLAY_ENC, ustawiając ją na C, C, C lub C. =item B<-f, --force> Wymuszenie konwersji plików binarnych. =item B<-gb, --gb18030> Pod Windows pliki w UTF-16 są domyślnie konwertowane do UTF-8, niezależnie od ustawienia lokalizacji. Ta opcja pozwala przekonwertować pliki w UTF-16 do GB18030. Opcja jest dostępna tylko pod Windows, więcej w sekcji dotyczącej GB18030. =item B<-h, --help> Wyświetlenie opisu i zakończenie. =item B<-i[FLAGI], --info[=FLAGI] PLIK ...> Wyświetlenie informacji o pliku. Konwersja nie jest wykonywana. Wypisywane są następujące informacje, w tej kolejności: liczba DOS-owych końców linii, liczba uniksowych końców linii, liczba macowych końców linii, znacznik BOM, tekstowy lub binarny, nazwa pliku. Przykładowe wyjście: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Uwaga: czasami plik binarny może być błędnie rozpoznany jako tekstowy. P. także opcja C<-s>. Opcjonalnie można ustawić dodatkowe flagi, aby zmienić wyjście. Można dodać jedną lub więcej flag. =over 4 =item B Wypisanie liczby DOS-owych końców linii. =item B Wypisanie liczby uniksowych końców linii. =item B Wypisanie liczby macowych końców linii. =item B Wypisanie znacznika BOM. =item B Wypisanie, czy plik jest tekstowy, czy binarny. =item B Wypisanie tylko plików, które zostałyby przekonwertowane. Z flagą C dos2unix wypisze tylko pliki zawierające DOS-owe końce linii, a unix2dos wypisze tylko nazwy plików zawierających uniksowe końce linii. =item B Wypisanie nagłówka. =item B

Wyświetlanie nazw plików bez ścieżki. =back Przykłady: Pokazanie informacji o wszystkich plikach *.txt: dos2unix -i *.txt Pokazanie tylko liczby DOS-owych i uniksowych końców linii: dos2unix -idu *.txt Pokazanie tylko znacznika BOM: dos2unix --info=b *.txt Wypisanie listy plików zawierających DOS-owe końce linii: dos2unix -ic *.txt Wypisanie listy plików zawierających uniksowe końce linii: unix2dos -ic *.txt Konwersja tylko plików mających DOS-owe końce linii, pozostawienie pozostałych bez zmian: dos2unix -ic *.txt | xargs dos2unix Wyszukanie plików tekstowych zawierających DOS-owe końce linii: find -name '*.txt' | xargs dos2unix -ic =item B<-k, --keepdate> Zachowanie znacznika czasu pliku wyjściowego takiego samego, jak pliku wejściowego. =item B<-L, --license> Wyświetlenie licencji programu. =item B<-l, --newline> Dodanie dodatkowego znaku końca linii. B: tylko DOS-owe znaki końca linii są zamieniane na dwa uniksowe. W trybie Mac tylko macowe znaki końca linii są zamieniane na dwa uniksowe. B: tylko uniksowe znaki końca linii są zamieniane na dwa DOS-owe. W trybie Mac uniksowe znaki końca linii są zamieniane na dwa macowe. =item B<-m, --add-bom> Zapisanie znacznika BOM (Byte Order Mark) w pliku wyjściowym. Domyślnie zapisywany jest BOM UTF-8. Jeśli plik wejściowy jest w kodowaniu UTF-16 i użyto opcji C<-u>, zostanie zapisany BOM UTF-16. Nigdy nie należy używać tej opcji, jeśli kodowanie wyjściowe jest inne niż UTF-8, UTF-16 lub GB18030. Więcej w sekcji UNICODE. =item B<-n, --newfile PLIK_WEJ PLIK_WYJ ...> Tryb nowego pliku. Konwersja PLIKU_WEJ z zapisem wyjścia do PLIKU_WYJ. Nazwy plików muszą być podane parami, a masek I należy używać, gdyż I to utratę plików. Osoba uruchamiająca konwersję w trybie nowego pliku (par) będzie właścicielem przekonwertowanego pliku. Prawa odczytu/zapisu nowego pliku będą pochodziły z praw pliku oryginalnego po odjęciu umask(1) osoby uruchamiającej konwersję. =item B<-o, --oldfile PLIK ...> Tryb starego pliku. Konwersja PLIKU i nadpisanie go wyjściem. Program działa domyślnie w tym trybie. Można używać masek. W trybie starego pliku (w miejscu) przekonwertowany plik otrzymuje tego samego właściciela, grupę oraz prawa odczytu/zapisu, jak plik oryginalny - także wtedy, gdy plik jest konwertowany przez innego użytkownika, mającego prawo zapisu do pliku (np. przez użytkownika root). Konwersja zostanie przerwana, jeśli nie będzie możliwe zachowanie oryginalnych wartości. Zmiana właściciela mogłaby oznaczać, że pierwotny właściciel nie może już odczytać pliku. Zmiana grupy mogłaby być zagrożeniem bezpieczeństwa, plik mógłby być czytelny dla nie zamierzonych osób. Zachowanie właściciela, grupy i praw odczytu/zapisu jest obsługiwane tylko na Uniksie. =item B<-q, --quiet> Tryb cichy. Pominięcie wszystkich ostrzeżeń i komunikatów. Zwracanym kodem jest zero, chyba że podano błędne opcje linii poleceń. =item B<-r, --remove-bom> Usunięcie znaków BOM (Byte Order Mark). Bez zapisywania BOM do pliku wyjściowego. Jest to domyślne zachowanie przy konwersji na uniksowe końce linii. P. także opcja C<-b>. =item B<-s, --safe> Pominięcie plików binarnych (domyślne). Pomijanie plików binarnych ma na celu zapobieżenie przypadkowym błędom. Uwaga: wykrywanie plików binarnych nie jest w 100% odporne na błędy. Pliki wejściowe są przeszukiwane pod kątem symboli binarnych, które zwykle nie występują w plikach tekstowych. Może się zdarzyć, że plik binarny zawiera tylko zwykłe znaki tekstowe. Taki plik binarny będzie błędnie widziany jako plik tekstowy. =item B<-u, --keep-utf16> Zachowanie oryginalnego kodowania pliku wejściowego UTF-16. Plik wyjściowy zostanie zapisany w tym samym kodowaniu UTF-16 (little lub big endian), co plik wejściowy. Zapobiega to przekształceniu do UTF-8. Do pliku zostanie zapisany odpowiedni znacznik BOM UTF-16. Tę opcję można wyłączyć opcją C<-ascii>. =item B<-ul, --assume-utf16le> Przyjęcie, że format pliku wejściowego to UTF-16LE. Jeśli w pliku wejściowym jest znacznik BOM (Byte Order Mark), ma on priorytet nad tą opcją. Jeśli przyjęto błędne założenie (plik wejściowy nie jest w formacie UTF-16LE), a konwersja się uda, wynikiem będzie plik wyjściowy UTF-8 ze złym tekstem. Konwersję tę można odwrócić przy użyciu polecenia iconv(1) do konwersji wyjścia UTF-8 z powrotem do UTF-16LE. Przywróci to plik oryginalny. Przyjęcie UTF-16LE działa jako I. Przy przełączeniu na domyślny tryb I przyjęcie UTF-16LE jest wyłączane. =item B<-ub, --assume-utf16be> Przyjęcie, że format pliku wejściowego to UTF-16BE. Ta opcja działa analogicznie do C<-ul>. =item B<-v, --verbose> Wyświetlanie szczegółowych komunikatów. Wyświetlane śa dodatkowe informacje o znacznikach BOM (Byte Order Mark) oraz liczbie przekonwertowanych końców linii. =item B<-F, --follow-symlink> Podążanie za dowiązaniami symbolicznymi i konwertowanie ich celów =item B<-R, --replace-symlink> Zastępowanie dowiązań symbolicznych przekonwertowanymi plikami (oryginalne pliki docelowe pozostają bez zmian). =item B<-S, --skip-symlink> Pozostawienie dowiązań symbolicznych i celów bez zmian (domyślne). =item B<-V, --version> Wyświetlenie informacji o wersji i zakończenie. =back =head1 TRYB MAC W zwykłym trybie znaki końca linii są konwertowane z DOS-a do Uniksa i odwrotnie. Znaki końca linii systemu Mac nie są konwertowane. W trybie Mac znaki końca linii są konwertowane z formatu Maca do Uniksa i odwrotnie. Znaki końca linii systemu DOS nie są zmieniane. Aby uruchomić program w trybie Mac, należy użyć opcji linii poleceń C<-c mac> albo użyć poleceń C lub C. =head1 TRYBY KONWERSJI =over 4 =item B W trybie C konwertowane są tylko końce linii. Jest to domyślny tryb konwersji. Mimo że nazwa tego trybu to ASCII, które jest standardem 7-bitowym, jest to tryb 8-bitowy. Należy zawsze używać tego trybu przy konwersji plików Unicode UTF-8. =item B<7bit> W tym trybie wszystkie znaki 8-bitowe spoza ASCII (o wartościach od 128 do 255) są konwertowane do przestrzeni 7-bitowej. =item B W tym trybie znaki są konwertowane między zestawem znaków DOS (stroną kodową) a zestawem znaków ISO-8859-1 (Latin-1) używanym na Uniksie. Znaki DOS-owe nie mające odpowiednika w ISO-8859-1, których nie da się przekonwertować, są zamieniane na kropkę. To samo dotyczy znaków ISO-8859-1 bez odpowiednika w DOS-ie. Jeśli używana jest tylko opcja C<-iso>, dos2unix próbuje wykryć aktywną stronę kodową. Jeśli nie jest to możliwe, dos2unix używa domyślnej strony kodowej CP437, stosowanej głównie w USA. Aby wymusić określoną stronę kodową, należy użyć opcji C<-437> (US), C<-850> (zachodnioeuropejska), C<-860> (portugalska), C<-863> (kanadyjska francuska) lub C<-865> (nordycka). Ponadto obsługiwana jest strona kodowa Windows CP1252 (zachodnioeuropejska) przy użyciu opcji C<-1252>. W przypadku innych stron kodowych można użyć narzędzia dos2unix wraz z iconv(1). Iconv potrafi konwertować między wieloma kodowaniami znaków. Nigdy nie należy używać konwersji ISO na plikach tekstowych w Unicode. Uszkodziłaby pliki kodowane UTF-8. Kilka przykładów: Konwersja z domyślnej strony kodowej DOS do uniksowego Latin-1: dos2unix -iso -n in.txt out.txt Konwersja ze strony kodowej DOS CP850 do uniksowego Latin-1: dos2unix -850 -n in.txt out.txt Konwersja ze strony kodowej Windows CP1252 do uniksowego Latin-1: dos2unix -1252 -n in.txt out.txt Konwersja ze strony kodowej Windows CP1252 do uniksowego UTF-8 (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Konwersa z uniksowego Latin-1 do domyślnej strony kodowej DOS: unix2dos -iso -n in.txt out.txt Konwersja z uniksowego Latin-1 do strony kodowej DOS CP850: unix2dos -850 -n in.txt out.txt Konwersja z uniksowego Latin-1 do strony kodowej Windows CP1252: unix2dos -1252 -n in.txt out.txt Konwersja z uniksowego UTF-8 (Unicode) do strony kodowej Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt Więcej pod adresem L oraz L. =back =head1 UNICODE =head2 Kodowania Istnieją różne kodowania Unicode. Pod Uniksem i Linuksem pliki Unicode są zwykle kodowane z użyciem UTF-8. Pod Windows pliki tekstowe Unicode mogą być kodowane w UTF-8, UTF-16, UTF-16 big-endian, ale przeważnie są kodowane w UTF-16. =head2 Konwersje Pliki tekstowe Unicode mogą mieć znaki końca linii systemu DOS, Unix lub Mac, podobnie jak zwykłe pliki tekstowe. Wszystkie wersje dos2unix i unix2dos potrafią konwertować pliki kodowane UTF-8, ponieważ UTF-8 jest wstecznie zgodne z ASCII. Dos2unix i unix2dos z obsługą Unicode UTF-16 potrafią odczytywać pliki tekstowe kodowane UTF-16 little- oraz big-endian. Aby sprawdzić, czy dos2unix został zbudowany z obsługą UTF-16, należy napisać C. Pod Uniksem/Linuksem pliki w kodowaniu UTF-16 są konwertowane do kodowania znaków ustawionej lokalizacji. Kodowanie znaków dla lokalizacji można sprawdzić poleceniem locale(1). Jeśli konwersja nie jest możliwa, wystąpi błąd, a plik zostanie pominięty. Pod Windows pliki UTF-16 są domyślnie konwertowane do UTF-8. Pliki tekstkowe w kodowaniu UTF-8 są dobrze obsługiwane zarówno pod Windows, jak i Uniksem/Linuksem. Kodowania UTF-16 i UTF-8 są w pełni zgodne, konwersja nie spowoduje utraty żadnej części tekstu. W przypadku wystąpienia błędu konwersji, na przykład w przypadku błędu w pliku wejściowym UTF-16, plik zostanie pominięty. W przypadku użycia opcji C<-u>, plik wejściowy zostanie zapisany w tym samym kodowaniu UTF-16, co plik wejściowy. Opcja C<-u> zapobiega konwersji do UTF-8. Dos2unix oraz unix2dos nie mają opcji pozwalającej na konwersję plików UTF-8 do UTF-16. Tryby konwersji ISO i 7-bit nie działają na plikach UTF-16. =head2 Znacznik BOM W systemie Windows pliki tekstowe zwykle zawierają znacznik BOM (Byte Order Mark), ponieważ wiele programów dla Windows (w tym Notepad) dodaje domyślnie znaczniki BOM. Więcej informacji można znaleźć pod adresem L. Pod Uniksem pliki Unicode zwykle nie mają znacznika BOM. Pliki tekstowe są traktowane jako kodowane zgodnie z kodowaniem znaków ustawionej lokalizacji. Dos2unix potrafi wykryć tylko, czy plik jest w formacie UTF-16, jeśli zawiera znacznik BOM. Jeśli plik UTF-16 nie ma tego znacznika, dos2unix potraktuje plik jako binarny. Do konwersji pliku UTF-16 bez znacznika BOM można użyć opcji C<-ul> lub C<-ub>. Dos2unix nie zapisuje domyślnie znaku BOM w pliku wyjściowym. Z opcją C<-b> Dos2unix zapisuje BOM, jeśli plik wejściowy zawiera BOM. Unix2dos domyślnie zapisuje znaczniki BOM w pliku wyjściowym, jeśli plik wejściowy ma BOM. Aby usunąć BOM, można użyć opcji C<-r>. Dos2unix oraz unix2dos zawsze zapisują znaczniki BOM, jeśli użyta zostanie opcja C<-m>. =head2 Unikodowe nazwy plików w Windows Dos2unix ma opcjonalną obsługę odczytu i zapisu nazw plików Unicode w linii poleceń Windows. Oznacza to, że dos2unix potrafi otwierać pliki zawierające w nazwie znaki spoza domyślnej systemowej strony kodowej ANSI. Aby sprawdzić, czy dos2unix dla Windows został zbudowany z obsługą nazw plików Unicode, można wpisać C. Przy wyświetlaniu nazw plików Unicode w konsoli Windows występuje kilka problemów. Więcej informacji w opisie opcji C<-D>, C<--display-enc>. Nazwy plików mogą być wyświetlane błędnie na konsoli, ale pliki będą zapisywane z poprawną nazwą. =head2 Przykłady Unicode Konwersja pliku UTF-16 (z BOM) z formatu Windows do uniksowego UTF-8: dos2unix -n in.txt out.txt Konwersja pliku UTF-16LE (bez BOM) z formatu Windows do uniksowego UTF-8: dos2unix -ul -n in.txt out.txt Konwersja z uniksowego UTF-8 do UTF-8 z BOM dla Windows: unix2dos -m -n in.txt out.txt Konwersja z uniksowego UTF-8 do UTF-16 dla Windows: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt =head1 GB18030 GB18030 to standard urzędowy w Chinach. Obowiązkowy podzbiór standardu GB18030 jest oficjalnym wymaganiem każdego oprogramowania sprzedawanego w Chinach. Więcej pod adresem L. GB18030 jest w pełni zgodny z Unicode i może być uważany za format transformacji unikodu. Podobnie jak UTF-8, GB18030 jest zgodny z ASCII. Jest także zgodny ze stroną kodową Windows 936, znaną też jako GBK. Pod Uniksem/Linuksem pliki UTF-16 są konwertowane do GB18030, jeśli kodowanie dla lokalizacji jest ustawione na GB18030. Uwaga: będzie to działać tylko, jeśli lokalizacja jest obsługiwana przez system. Listę obsługiwanych lokalizacji można sprawdzić poleceniem C. Pod Windows w celu konwersji plików UTF-16 do GB18030 należy użyć opcji C<-gb>. Pliki w kodowaniu GB18030 mogą mieć znacznik BOM, podobnie jak pliki w Unicode. =head1 PRZYKŁADY Odczyt ze standardowego wejścia i zapis na standardowe wyjście: dos2unix < a.txt cat a.txt | dos2unix Konwersja i zastąpienie a.txt; konwersja i zastąpienie b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Konwersja i zastąpienie a.txt w trybie ascii: dos2unix a.txt Konwersja i zastąpienie a.txt w trybie ascii; konwersja i zastąpienie b.txt w trybie 7-bitowym: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Konwersja a.txt z formatu Mac do formatu uniksowego: dos2unix -c mac a.txt mac2unix a.txt Konwersja a.txt z formatu uniksowego do formatu Mac: unix2dos -c mac a.txt unix2mac a.txt Konwersja i zastąpienie a.txt z zachowaniem oryginalnego znacznika czasu: dos2unix -k a.txt dos2unix -k -o a.txt Konwersja a.txt i zapis do e.txt: dos2unix -n a.txt e.txt Konwersja a.txt i zapis do e.txt z zachowaniem znacznika czasu e.txt takiego, jak a.txt: dos2unix -k -n a.txt e.txt Konwersja i zastąpienie a.txt; konwersja b.txt i zapis do e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Konwersja c.txt i zapis do e.txt; konwersja i zastąpienie a.txt; konwersja i zastąpienie b.txt; konwersja d.txt i zapis do f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 KONWERSJA REKURENCYJNA Można użyć dos2unix w połączeniu z poleceniami find(1) i xargs(1) do rekurencyjnej konwersji plików tekstowych w strukturze drzewa katalogów. Na przykład, aby przekonwertować wszystkie pliki .txt w drzewie katalogów poniżej katalogu bieżącego, należy napisać: find . -name '*.txt' |xargs dos2unix Z poziomu linii poleceń Windows można użyć następującego polecenia: for /R %G in (*.txt) do dos2unix "%G" Użytkownicy powłoki PowerShell mogą użyć następującego polecenia w Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} =head1 LOKALIZACJA =over 4 =item B Główny język wybiera się zmienną środowiskową LANG. Zmienna LANG składa się z kilku części. Pierwsza część to małe litery oznaczające kod języka. Druga część jest opcjonalna i zawiera kod kraju pisany wielkimi literami, poprzedzony podkreśleniem. Jest także opcjonalna trzecia część: kodowanie znaków, poprzedzone kropką. Kilka przykładów dla powłok zgodnych ze standardem POSIX: export LANG=nl holenderski export LANG=nl_NL holenderski, Holandia export LANG=nl_BE holenderski, Belgia export LANG=es_ES hiszpański, Hiszpania export LANG=es_MX hiszpański, Meksyk export LANG=en_US.iso88591 angielski, USA, kodowanie Latin-1 export LANG=en_GB.UTF-8 angielski, Wlk. Brytania, kodowanie UTF-8 Pełną listę kodów języków i krajów można znaleźć w podręczniku do gettexta: L W systemach uniksowych do uzyskania informacji dotyczących lokalizacji można użyć polecenia locale(1). =item B Przy użyciu zmiennej środowiskowej LANGUAGE można określić listę języków wg priorytetu, oddzielonych dwukropkami. Dos2unix przyjmuje pierwszeństwo zmiennej LANGUAGE nad LANG. Na przykład, najpierw holenderski, następnie niemiecki: C. Aby skorzystać z listy wg priorytetów ze zmiennej LANGUAGE, trzeba najpierw włączyć lokalizację przez ustawienie zmiennej LANG (lub LC_ALL) na wartość inną niż "C". Więcej informacji znajduje się w podręczniku do gettexta: L W przypadku wybrania niedostępnego języka, otrzymamy standardowe, angielskie komunikaty. =item B Przy użyciu zmiennej środowiskowej DOS2UNIX_LOCALEDIR, można nadpisać ustawienie LOCALEDIR z czasu kompilacji. LOCALEDIR to katalog używany do znalezienia plików lokalizacji. Domyślną wartością dla GNU jest C. Opcja B<--version> wyświetla używaną wartość LOCALEDIR. Przykład (dla powłoki POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 WARTOŚĆ ZWRACANA W przypadku powodzenia zwracane jest zero. Jeśli wystąpi błąd systemowy, zwracany jest ostatni błąd systemowy. W przypadku innych błędów zwracane jest 1. Wartość zwracana w trybie cichym to zawsze zero, z wyjątkiem sytuacji podania błędnych opcji linii poleceń. =head1 STANDARDY L L L L =head1 AUTORZY Benjamin Lin ; Bernd Johannes Wuebben (tryb mac2unix) ; Christian Wurll (dodawanie dodatkowej nowej linii) ; Erwin Waterlander (prowadzący) Strona projektu: L Strona SourceForge: L =head1 ZOBACZ TAKŻE file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/pl/man1/dos2unix.txt0000644000175500010010000007155012721132571017116 0ustar waterlanGeenNAZWA dos2unix - konwerter formatu plików tekstowych między systemami DOS/Mac a Uniksem SKŁADNIA dos2unix [opcje] [PLIK ...] [-n PLIK_WEJ PLIK_WYJ ...] unix2dos [opcje] [PLIK ...] [-n PLIK_WEJ PLIK_WYJ ...] OPIS Pakiet Dos2unix zawiera narzędzia "dos2unix" oraz "unix2dos" do konwersji zwykłych plików tekstowych między formatami używanymi w systemach DOS lub Mac a formatem uniksowym. W plikach tekstowych systemu DOS/Windows oznaczenie końca linii to połączenie dwóch znaków: powrotu karetki (CR) i przesunięcia linii (LF). W uniksowych plikach tekstowych koniec linii to pojedynczy znak LF. W plikach tekstowych systemu Mac sprzed Mac OS X koniec linii był pojedynczym znakiem CR. Obecnie Mac OS wykorzystuje uniksowe końce linii (LF). Oprócz oznaczeń końców linii Dos2unix potrafi konwertować także kodowanie plików. Kilko stron kodowych DOS-a może być przekonwertowanych do uniksowego Latin-1, a windowsowy Unicode (UTF-16) do powszechniejszego pod Uniksem kodowania Unicode UTF-8. Pliki binarne są pomijane automatycznie, chyba że konwersja zostanie wymuszona. Pliki inne niż zwykłe, np. katalogi lub FIFO, są pomijane automatycznie. Dowiązania symboliczne i ich cele są domyślnie pozostawiane bez zmian. Dowiązania symboliczne mogą być opcjonalnie zastępowane, albo wyjście może być zapisywane do celu dowiązania. Zapis do celu dowiązania symbolicznego nie jest obsługiwane pod Windows. Dos2unix powstał na podstawie narzędzia dos2unix z systemu SunOS/Solaris. Jest jedna istotna różnica w stosunku do oryginalnej wersji z SunOS-a/Solarisa: ta wersja domyślnie wykonuje konwersję w miejscu (tryb starego pliku), podczas gdy oryginalna obsługiwała tylko konwersję parami (tryb nowego pliku) - p. także opcje "-o" i "-n". Ponadto wersja z SunOS-a/Solarisa domyślnie wykonuje konwersję w trybie *iso*, podczas gdy ta wersja domyślnie wykonuje konwersję w trybie *ascii*. OPCJE -- Potraktowanie wszystkich kolejnych opcji jako nazw plików. Tej opcji należy użyć, aby przekonwertować pliki, których nazwy zaczynają się od minusa. Przykładowo, aby przekonwertować plik o nazwie "-foo", można użyć polecenia: dos2unix -- -foo Lub w trybie nowego pliku: dos2unix -n -- -foo out.txt -ascii Konwersja tylko znaków końca linii. Jest to domyślny tryb konwersji. -iso Konwersja między zestawami znaków DOS i ISO-8859-1. Więcej w sekcji TRYBY KONWERSJI. -1252 Użycie strony kodowej Windows 1252 (zachodnioeuropejskiej). -437 Użycie strony kodowej DOS 437 (US). Jest to domyślna strona kodowa używana przy konwersji ISO. -850 Użycie strony kodowej DOS 850 (zachodnioeuropejskiej). -860 Użycie strony kodowej DOS 860 (portugalskiej). -863 Użycie strony kodowej DOS 863 (kanadyjskiej francuskiej). -865 Użycie strony kodowej DOS 865 (nordyckiej). -7 Konwersja znaków 8-bitowych do przestrzeni 7-bitowej. -b, --keep-bom Zachowanie znaku BOM (Byte Order Makr). Jeżeli plik wejściowy zawiera BOM, powoduje zapisanie go w pliku wyjściowym. Jest to domyślne zachowanie przy konwersji na DOS-owe końce linii. P. także opcja "-r". -c, --convmode TRYB_KONW Ustawienie trybu konwersji. TRYB_KONW to jeden z: *ascii*, *7bit*, *iso*, *mac*, przy czym domyślny jest ascii. -D, --display-enc KODOWANIE Ustawienie kodowania wyświetlanego tekstu. KODOWANIE to jedno z: *ansi*, *unicode*, *unicodebom*, *utf8*, *utf8bom*, przy czym domyślne to ansi. Ta opcja jest dostępna wyłączenie w programie dos2unix dla Windows z obsługą nazw plików Unicode. Nie ma wpływu na same nawy odczytywanych i zapisywanych plików, a jedynie na sposób ich wyświetlania. Istnieje kilka sposobów wyświetlania tekstu w konsoli Windows w zależności od kodowania tekstu. Wszystkie mają swoje zalety i wady. ansi Domyślna metoda programu dos2unix to stosowanie tekstu kodowanego w ANSI. Zaletą jest wsteczna zgodność. Działa z fontami rastrowymi, jak i TrueType. W niektórych rejonach może być potrzeba zmiany aktywnej strony kodowej DOS OEM na systemową stronę kodową Windows ANSI przy użyciu polecenia "chcp", ponieważ dos2unix wykorzystuje systemową stronę kodową Windows. Wadą kodowania ansi jest fakt, że międzynarodowe nazwy plików ze znakami spoza domyślnej systemowej strony kodowej nie są wyświetlane właściwie. Można zamiast tego zobaczyć znak zapytania albo niewłaściwy symbol. Jeżeli nie pracujemy z obcymi nazwami plików, ta metoda jest poprawna. unicode, unicodebom Zaletą kodowania unicode (windowsową nazwą dla UTF-16) jest (zwykle) właściwe wyświetlanie tekstu. Nie ma potrzeby zmiany aktywnej strony kodowej. Może być potrzeba zmiany fontu konsoli na font TrueType, aby znaki międzynarodowe były wyświetlane poprawnie. Jeśli znak nie jest obecny w foncie TrueType, zwykle widać mały kwadrat, czasami ze znakiem zapytania w środku. W przypadku używania konsoli ConEmu cały tekst jest wyświetlany poprawnie, ponieważ ConEmu automatycznie wybiera dobry font. Wadą kodowania unicode jest niezgodność z ASCII. Wyjście nie jest łatwe do obsłużenia w przypadku przekierowania do innego programu lub pliku. W przypadku użycia metody "unicodebom", tekst w unikodzie jest poprzedzony znakiem BOM (Byte Order Mark). BOM jest wymagany do poprawnego przekierowania lub przekazywania przez potok w powłoce PowerShell. utf8, utf8bom Zaletą kodowania utf8 jest zgodność z ASCII. Trzeba ustawić font konsoli na font TrueType. Przy użyciu fontu TrueType tekst jest wyświetlany podobnie do kodowania "unicode". Wadą jest fakt, że w przypadku używania domyślnego fontu rastrowego, wszystkie znaki spoza ASCII są wyświetlane niepoprawnie. Nie tylko unikodowe nazwy plików, ale także przetłumaczone komunikaty stają się nieczytelne. W Windows skonfigurowanym dla rejonu Azji Wschodniej widać dużo migotania konsoli w trakcie wyświetlania komunikatów. W konsoli ConEmu metoda kodowania utf8 działa dobrze. W przypadku użycia metody "utf8bom", tekst w UTF-8 jest poprzedzony znakiem BOM (Byte Order Mark). BOM jest wymagany do poprawnego przekierowania lub przekazywania przez potok w powłoce PowerShell. Domyślne kodowanie można zmienić przy użyciu zmiennej środowiskowej DOS2UNIX_DISPLAY_ENC, ustawiając ją na "unicode", "unicodebom", "utf8" lub "utf8bom". -f, --force Wymuszenie konwersji plików binarnych. -gb, --gb18030 Pod Windows pliki w UTF-16 są domyślnie konwertowane do UTF-8, niezależnie od ustawienia lokalizacji. Ta opcja pozwala przekonwertować pliki w UTF-16 do GB18030. Opcja jest dostępna tylko pod Windows, więcej w sekcji dotyczącej GB18030. -h, --help Wyświetlenie opisu i zakończenie. -i[FLAGI], --info[=FLAGI] PLIK ... Wyświetlenie informacji o pliku. Konwersja nie jest wykonywana. Wypisywane są następujące informacje, w tej kolejności: liczba DOS-owych końców linii, liczba uniksowych końców linii, liczba macowych końców linii, znacznik BOM, tekstowy lub binarny, nazwa pliku. Przykładowe wyjście: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Uwaga: czasami plik binarny może być błędnie rozpoznany jako tekstowy. P. także opcja "-s". Opcjonalnie można ustawić dodatkowe flagi, aby zmienić wyjście. Można dodać jedną lub więcej flag. d Wypisanie liczby DOS-owych końców linii. u Wypisanie liczby uniksowych końców linii. m Wypisanie liczby macowych końców linii. b Wypisanie znacznika BOM. t Wypisanie, czy plik jest tekstowy, czy binarny. c Wypisanie tylko plików, które zostałyby przekonwertowane. Z flagą "c" dos2unix wypisze tylko pliki zawierające DOS-owe końce linii, a unix2dos wypisze tylko nazwy plików zawierających uniksowe końce linii. h Wypisanie nagłówka. p Wyświetlanie nazw plików bez ścieżki. Przykłady: Pokazanie informacji o wszystkich plikach *.txt: dos2unix -i *.txt Pokazanie tylko liczby DOS-owych i uniksowych końców linii: dos2unix -idu *.txt Pokazanie tylko znacznika BOM: dos2unix --info=b *.txt Wypisanie listy plików zawierających DOS-owe końce linii: dos2unix -ic *.txt Wypisanie listy plików zawierających uniksowe końce linii: unix2dos -ic *.txt Konwersja tylko plików mających DOS-owe końce linii, pozostawienie pozostałych bez zmian: dos2unix -ic *.txt | xargs dos2unix Wyszukanie plików tekstowych zawierających DOS-owe końce linii: find -name '*.txt' | xargs dos2unix -ic -k, --keepdate Zachowanie znacznika czasu pliku wyjściowego takiego samego, jak pliku wejściowego. -L, --license Wyświetlenie licencji programu. -l, --newline Dodanie dodatkowego znaku końca linii. dos2unix: tylko DOS-owe znaki końca linii są zamieniane na dwa uniksowe. W trybie Mac tylko macowe znaki końca linii są zamieniane na dwa uniksowe. unix2dos: tylko uniksowe znaki końca linii są zamieniane na dwa DOS-owe. W trybie Mac uniksowe znaki końca linii są zamieniane na dwa macowe. -m, --add-bom Zapisanie znacznika BOM (Byte Order Mark) w pliku wyjściowym. Domyślnie zapisywany jest BOM UTF-8. Jeśli plik wejściowy jest w kodowaniu UTF-16 i użyto opcji "-u", zostanie zapisany BOM UTF-16. Nigdy nie należy używać tej opcji, jeśli kodowanie wyjściowe jest inne niż UTF-8, UTF-16 lub GB18030. Więcej w sekcji UNICODE. -n, --newfile PLIK_WEJ PLIK_WYJ ... Tryb nowego pliku. Konwersja PLIKU_WEJ z zapisem wyjścia do PLIKU_WYJ. Nazwy plików muszą być podane parami, a masek *nie* należy używać, gdyż *spowoduje* to utratę plików. Osoba uruchamiająca konwersję w trybie nowego pliku (par) będzie właścicielem przekonwertowanego pliku. Prawa odczytu/zapisu nowego pliku będą pochodziły z praw pliku oryginalnego po odjęciu umask(1) osoby uruchamiającej konwersję. -o, --oldfile PLIK ... Tryb starego pliku. Konwersja PLIKU i nadpisanie go wyjściem. Program działa domyślnie w tym trybie. Można używać masek. W trybie starego pliku (w miejscu) przekonwertowany plik otrzymuje tego samego właściciela, grupę oraz prawa odczytu/zapisu, jak plik oryginalny - także wtedy, gdy plik jest konwertowany przez innego użytkownika, mającego prawo zapisu do pliku (np. przez użytkownika root). Konwersja zostanie przerwana, jeśli nie będzie możliwe zachowanie oryginalnych wartości. Zmiana właściciela mogłaby oznaczać, że pierwotny właściciel nie może już odczytać pliku. Zmiana grupy mogłaby być zagrożeniem bezpieczeństwa, plik mógłby być czytelny dla nie zamierzonych osób. Zachowanie właściciela, grupy i praw odczytu/zapisu jest obsługiwane tylko na Uniksie. -q, --quiet Tryb cichy. Pominięcie wszystkich ostrzeżeń i komunikatów. Zwracanym kodem jest zero, chyba że podano błędne opcje linii poleceń. -r, --remove-bom Usunięcie znaków BOM (Byte Order Mark). Bez zapisywania BOM do pliku wyjściowego. Jest to domyślne zachowanie przy konwersji na uniksowe końce linii. P. także opcja "-b". -s, --safe Pominięcie plików binarnych (domyślne). Pomijanie plików binarnych ma na celu zapobieżenie przypadkowym błędom. Uwaga: wykrywanie plików binarnych nie jest w 100% odporne na błędy. Pliki wejściowe są przeszukiwane pod kątem symboli binarnych, które zwykle nie występują w plikach tekstowych. Może się zdarzyć, że plik binarny zawiera tylko zwykłe znaki tekstowe. Taki plik binarny będzie błędnie widziany jako plik tekstowy. -u, --keep-utf16 Zachowanie oryginalnego kodowania pliku wejściowego UTF-16. Plik wyjściowy zostanie zapisany w tym samym kodowaniu UTF-16 (little lub big endian), co plik wejściowy. Zapobiega to przekształceniu do UTF-8. Do pliku zostanie zapisany odpowiedni znacznik BOM UTF-16. Tę opcję można wyłączyć opcją "-ascii". -ul, --assume-utf16le Przyjęcie, że format pliku wejściowego to UTF-16LE. Jeśli w pliku wejściowym jest znacznik BOM (Byte Order Mark), ma on priorytet nad tą opcją. Jeśli przyjęto błędne założenie (plik wejściowy nie jest w formacie UTF-16LE), a konwersja się uda, wynikiem będzie plik wyjściowy UTF-8 ze złym tekstem. Konwersję tę można odwrócić przy użyciu polecenia iconv(1) do konwersji wyjścia UTF-8 z powrotem do UTF-16LE. Przywróci to plik oryginalny. Przyjęcie UTF-16LE działa jako *tryb konwersji*. Przy przełączeniu na domyślny tryb *ascii* przyjęcie UTF-16LE jest wyłączane. -ub, --assume-utf16be Przyjęcie, że format pliku wejściowego to UTF-16BE. Ta opcja działa analogicznie do "-ul". -v, --verbose Wyświetlanie szczegółowych komunikatów. Wyświetlane śa dodatkowe informacje o znacznikach BOM (Byte Order Mark) oraz liczbie przekonwertowanych końców linii. -F, --follow-symlink Podążanie za dowiązaniami symbolicznymi i konwertowanie ich celów -R, --replace-symlink Zastępowanie dowiązań symbolicznych przekonwertowanymi plikami (oryginalne pliki docelowe pozostają bez zmian). -S, --skip-symlink Pozostawienie dowiązań symbolicznych i celów bez zmian (domyślne). -V, --version Wyświetlenie informacji o wersji i zakończenie. TRYB MAC W zwykłym trybie znaki końca linii są konwertowane z DOS-a do Uniksa i odwrotnie. Znaki końca linii systemu Mac nie są konwertowane. W trybie Mac znaki końca linii są konwertowane z formatu Maca do Uniksa i odwrotnie. Znaki końca linii systemu DOS nie są zmieniane. Aby uruchomić program w trybie Mac, należy użyć opcji linii poleceń "-c mac" albo użyć poleceń "mac2unix" lub "unix2mac". TRYBY KONWERSJI ascii W trybie "ascii" konwertowane są tylko końce linii. Jest to domyślny tryb konwersji. Mimo że nazwa tego trybu to ASCII, które jest standardem 7-bitowym, jest to tryb 8-bitowy. Należy zawsze używać tego trybu przy konwersji plików Unicode UTF-8. 7bit W tym trybie wszystkie znaki 8-bitowe spoza ASCII (o wartościach od 128 do 255) są konwertowane do przestrzeni 7-bitowej. iso W tym trybie znaki są konwertowane między zestawem znaków DOS (stroną kodową) a zestawem znaków ISO-8859-1 (Latin-1) używanym na Uniksie. Znaki DOS-owe nie mające odpowiednika w ISO-8859-1, których nie da się przekonwertować, są zamieniane na kropkę. To samo dotyczy znaków ISO-8859-1 bez odpowiednika w DOS-ie. Jeśli używana jest tylko opcja "-iso", dos2unix próbuje wykryć aktywną stronę kodową. Jeśli nie jest to możliwe, dos2unix używa domyślnej strony kodowej CP437, stosowanej głównie w USA. Aby wymusić określoną stronę kodową, należy użyć opcji -437 (US), -850 (zachodnioeuropejska), -860 (portugalska), -863 (kanadyjska francuska) lub -865 (nordycka). Ponadto obsługiwana jest strona kodowa Windows CP1252 (zachodnioeuropejska) przy użyciu opcji -1252. W przypadku innych stron kodowych można użyć narzędzia dos2unix wraz z iconv(1). Iconv potrafi konwertować między wieloma kodowaniami znaków. Nigdy nie należy używać konwersji ISO na plikach tekstowych w Unicode. Uszkodziłaby pliki kodowane UTF-8. Kilka przykładów: Konwersja z domyślnej strony kodowej DOS do uniksowego Latin-1: dos2unix -iso -n in.txt out.txt Konwersja ze strony kodowej DOS CP850 do uniksowego Latin-1: dos2unix -850 -n in.txt out.txt Konwersja ze strony kodowej Windows CP1252 do uniksowego Latin-1: dos2unix -1252 -n in.txt out.txt Konwersja ze strony kodowej Windows CP1252 do uniksowego UTF-8 (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Konwersa z uniksowego Latin-1 do domyślnej strony kodowej DOS: unix2dos -iso -n in.txt out.txt Konwersja z uniksowego Latin-1 do strony kodowej DOS CP850: unix2dos -850 -n in.txt out.txt Konwersja z uniksowego Latin-1 do strony kodowej Windows CP1252: unix2dos -1252 -n in.txt out.txt Konwersja z uniksowego UTF-8 (Unicode) do strony kodowej Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt Więcej pod adresem oraz . UNICODE Kodowania Istnieją różne kodowania Unicode. Pod Uniksem i Linuksem pliki Unicode są zwykle kodowane z użyciem UTF-8. Pod Windows pliki tekstowe Unicode mogą być kodowane w UTF-8, UTF-16, UTF-16 big-endian, ale przeważnie są kodowane w UTF-16. Konwersje Pliki tekstowe Unicode mogą mieć znaki końca linii systemu DOS, Unix lub Mac, podobnie jak zwykłe pliki tekstowe. Wszystkie wersje dos2unix i unix2dos potrafią konwertować pliki kodowane UTF-8, ponieważ UTF-8 jest wstecznie zgodne z ASCII. Dos2unix i unix2dos z obsługą Unicode UTF-16 potrafią odczytywać pliki tekstowe kodowane UTF-16 little- oraz big-endian. Aby sprawdzić, czy dos2unix został zbudowany z obsługą UTF-16, należy napisać "dos2unix -V". Pod Uniksem/Linuksem pliki w kodowaniu UTF-16 są konwertowane do kodowania znaków ustawionej lokalizacji. Kodowanie znaków dla lokalizacji można sprawdzić poleceniem locale(1). Jeśli konwersja nie jest możliwa, wystąpi błąd, a plik zostanie pominięty. Pod Windows pliki UTF-16 są domyślnie konwertowane do UTF-8. Pliki tekstkowe w kodowaniu UTF-8 są dobrze obsługiwane zarówno pod Windows, jak i Uniksem/Linuksem. Kodowania UTF-16 i UTF-8 są w pełni zgodne, konwersja nie spowoduje utraty żadnej części tekstu. W przypadku wystąpienia błędu konwersji, na przykład w przypadku błędu w pliku wejściowym UTF-16, plik zostanie pominięty. W przypadku użycia opcji "-u", plik wejściowy zostanie zapisany w tym samym kodowaniu UTF-16, co plik wejściowy. Opcja "-u" zapobiega konwersji do UTF-8. Dos2unix oraz unix2dos nie mają opcji pozwalającej na konwersję plików UTF-8 do UTF-16. Tryby konwersji ISO i 7-bit nie działają na plikach UTF-16. Znacznik BOM W systemie Windows pliki tekstowe zwykle zawierają znacznik BOM (Byte Order Mark), ponieważ wiele programów dla Windows (w tym Notepad) dodaje domyślnie znaczniki BOM. Więcej informacji można znaleźć pod adresem . Pod Uniksem pliki Unicode zwykle nie mają znacznika BOM. Pliki tekstowe są traktowane jako kodowane zgodnie z kodowaniem znaków ustawionej lokalizacji. Dos2unix potrafi wykryć tylko, czy plik jest w formacie UTF-16, jeśli zawiera znacznik BOM. Jeśli plik UTF-16 nie ma tego znacznika, dos2unix potraktuje plik jako binarny. Do konwersji pliku UTF-16 bez znacznika BOM można użyć opcji "-ul" lub "-ub". Dos2unix nie zapisuje domyślnie znaku BOM w pliku wyjściowym. Z opcją "-b" Dos2unix zapisuje BOM, jeśli plik wejściowy zawiera BOM. Unix2dos domyślnie zapisuje znaczniki BOM w pliku wyjściowym, jeśli plik wejściowy ma BOM. Aby usunąć BOM, można użyć opcji "-r". Dos2unix oraz unix2dos zawsze zapisują znaczniki BOM, jeśli użyta zostanie opcja "-m". Unikodowe nazwy plików w Windows Dos2unix ma opcjonalną obsługę odczytu i zapisu nazw plików Unicode w linii poleceń Windows. Oznacza to, że dos2unix potrafi otwierać pliki zawierające w nazwie znaki spoza domyślnej systemowej strony kodowej ANSI. Aby sprawdzić, czy dos2unix dla Windows został zbudowany z obsługą nazw plików Unicode, można wpisać "dos2unix -V". Przy wyświetlaniu nazw plików Unicode w konsoli Windows występuje kilka problemów. Więcej informacji w opisie opcji "-D", "--display-enc". Nazwy plików mogą być wyświetlane błędnie na konsoli, ale pliki będą zapisywane z poprawną nazwą. Przykłady Unicode Konwersja pliku UTF-16 (z BOM) z formatu Windows do uniksowego UTF-8: dos2unix -n in.txt out.txt Konwersja pliku UTF-16LE (bez BOM) z formatu Windows do uniksowego UTF-8: dos2unix -ul -n in.txt out.txt Konwersja z uniksowego UTF-8 do UTF-8 z BOM dla Windows: unix2dos -m -n in.txt out.txt Konwersja z uniksowego UTF-8 do UTF-16 dla Windows: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt GB18030 GB18030 to standard urzędowy w Chinach. Obowiązkowy podzbiór standardu GB18030 jest oficjalnym wymaganiem każdego oprogramowania sprzedawanego w Chinach. Więcej pod adresem . GB18030 jest w pełni zgodny z Unicode i może być uważany za format transformacji unikodu. Podobnie jak UTF-8, GB18030 jest zgodny z ASCII. Jest także zgodny ze stroną kodową Windows 936, znaną też jako GBK. Pod Uniksem/Linuksem pliki UTF-16 są konwertowane do GB18030, jeśli kodowanie dla lokalizacji jest ustawione na GB18030. Uwaga: będzie to działać tylko, jeśli lokalizacja jest obsługiwana przez system. Listę obsługiwanych lokalizacji można sprawdzić poleceniem "locale -a". Pod Windows w celu konwersji plików UTF-16 do GB18030 należy użyć opcji "-gb". Pliki w kodowaniu GB18030 mogą mieć znacznik BOM, podobnie jak pliki w Unicode. PRZYKŁADY Odczyt ze standardowego wejścia i zapis na standardowe wyjście: dos2unix < a.txt cat a.txt | dos2unix Konwersja i zastąpienie a.txt; konwersja i zastąpienie b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Konwersja i zastąpienie a.txt w trybie ascii: dos2unix a.txt Konwersja i zastąpienie a.txt w trybie ascii; konwersja i zastąpienie b.txt w trybie 7-bitowym: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Konwersja a.txt z formatu Mac do formatu uniksowego: dos2unix -c mac a.txt mac2unix a.txt Konwersja a.txt z formatu uniksowego do formatu Mac: unix2dos -c mac a.txt unix2mac a.txt Konwersja i zastąpienie a.txt z zachowaniem oryginalnego znacznika czasu: dos2unix -k a.txt dos2unix -k -o a.txt Konwersja a.txt i zapis do e.txt: dos2unix -n a.txt e.txt Konwersja a.txt i zapis do e.txt z zachowaniem znacznika czasu e.txt takiego, jak a.txt: dos2unix -k -n a.txt e.txt Konwersja i zastąpienie a.txt; konwersja b.txt i zapis do e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Konwersja c.txt i zapis do e.txt; konwersja i zastąpienie a.txt; konwersja i zastąpienie b.txt; konwersja d.txt i zapis do f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt KONWERSJA REKURENCYJNA Można użyć dos2unix w połączeniu z poleceniami find(1) i xargs(1) do rekurencyjnej konwersji plików tekstowych w strukturze drzewa katalogów. Na przykład, aby przekonwertować wszystkie pliki .txt w drzewie katalogów poniżej katalogu bieżącego, należy napisać: find . -name '*.txt' |xargs dos2unix Z poziomu linii poleceń Windows można użyć następującego polecenia: for /R %G in (*.txt) do dos2unix "%G" Użytkownicy powłoki PowerShell mogą użyć następującego polecenia w Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} LOKALIZACJA LANG Główny język wybiera się zmienną środowiskową LANG. Zmienna LANG składa się z kilku części. Pierwsza część to małe litery oznaczające kod języka. Druga część jest opcjonalna i zawiera kod kraju pisany wielkimi literami, poprzedzony podkreśleniem. Jest także opcjonalna trzecia część: kodowanie znaków, poprzedzone kropką. Kilka przykładów dla powłok zgodnych ze standardem POSIX: export LANG=nl holenderski export LANG=nl_NL holenderski, Holandia export LANG=nl_BE holenderski, Belgia export LANG=es_ES hiszpański, Hiszpania export LANG=es_MX hiszpański, Meksyk export LANG=en_US.iso88591 angielski, USA, kodowanie Latin-1 export LANG=en_GB.UTF-8 angielski, Wlk. Brytania, kodowanie UTF-8 Pełną listę kodów języków i krajów można znaleźć w podręczniku do gettexta: W systemach uniksowych do uzyskania informacji dotyczących lokalizacji można użyć polecenia locale(1). LANGUAGE Przy użyciu zmiennej środowiskowej LANGUAGE można określić listę języków wg priorytetu, oddzielonych dwukropkami. Dos2unix przyjmuje pierwszeństwo zmiennej LANGUAGE nad LANG. Na przykład, najpierw holenderski, następnie niemiecki: "LANGUAGE=nl:de". Aby skorzystać z listy wg priorytetów ze zmiennej LANGUAGE, trzeba najpierw włączyć lokalizację przez ustawienie zmiennej LANG (lub LC_ALL) na wartość inną niż "C". Więcej informacji znajduje się w podręczniku do gettexta: W przypadku wybrania niedostępnego języka, otrzymamy standardowe, angielskie komunikaty. DOS2UNIX_LOCALEDIR Przy użyciu zmiennej środowiskowej DOS2UNIX_LOCALEDIR, można nadpisać ustawienie LOCALEDIR z czasu kompilacji. LOCALEDIR to katalog używany do znalezienia plików lokalizacji. Domyślną wartością dla GNU jest "/usr/local/share/locale". Opcja --version wyświetla używaną wartość LOCALEDIR. Przykład (dla powłoki POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale WARTOŚĆ ZWRACANA W przypadku powodzenia zwracane jest zero. Jeśli wystąpi błąd systemowy, zwracany jest ostatni błąd systemowy. W przypadku innych błędów zwracane jest 1. Wartość zwracana w trybie cichym to zawsze zero, z wyjątkiem sytuacji podania błędnych opcji linii poleceń. STANDARDY AUTORZY Benjamin Lin ; Bernd Johannes Wuebben (tryb mac2unix) ; Christian Wurll (dodawanie dodatkowej nowej linii) ; Erwin Waterlander (prowadzący) Strona projektu: Strona SourceForge: ZOBACZ TAKŻE file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/pt_BR/0000755000175500010010000000000012721132561014330 5ustar waterlanGeendos2unix-7.3.4/man/pt_BR/man1/0000755000175500010010000000000012721132613015162 5ustar waterlanGeendos2unix-7.3.4/man/pt_BR/man1/dos2unix.10000644000175500010010000010411012721132562017017 0ustar waterlanGeen.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dos2unix 1" .TH dos2unix 1 "2016-05-24" "dos2unix" "2016-05-24" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NOME" .IX Header "NOME" dos2unix \- Conversor de formato de arquivo texto de DOS/Mac para Unix e vice-versa .SH "SINOPSE" .IX Header "SINOPSE" .Vb 2 \& dos2unix [opções] [ARQUIVO ...] [\-n ARQENT ARQSAÍDA ...] \& unix2dos [opções] [ARQUIVO ...] [\-n ARQENT ARQSAÍDA ...] .Ve .SH "DESCRIÇÃO" .IX Header "DESCRIÇÃO" O pacote Dos2unix inclui utilitários de \f(CW\*(C`dos2unix\*(C'\fR e \f(CW\*(C`unix2dos\*(C'\fR para converter arquivos texto nos formatos \s-1DOS\s0 ou Mac para formato Unix e vice-versa. .PP Em arquivos texto DOS/Windows uma quebra de linha, também conhecida como nova linha, é uma combinação de dois caracteres: um Carriage Return (\s-1CR\s0) seguido por um Line Feed (\s-1LF\s0). Em arquivos texto do Unix uma quebra de linha é um único caractere: o Line Feed (\s-1LF\s0). Em arquivos texto do Mac, anteriores ao Mac \s-1OS X,\s0 uma quebra de linha era um único caractere Carriage Return (\s-1CR\s0). Hoje em dia, Mac \s-1OS\s0 usa quebras de linha no estilo do Unix (\s-1LF\s0). .PP Além das quebras de linhas, Dos2unix também pode converter as codificações de arquivos. Algumas poucas páginas podem ser convertidos para Latin\-1 para Unix. E arquivos Unicode do Windows (\s-1UTF\-16\s0) podem ser convertidos para arquivos Unicode do Unix (\s-1UTF\-8\s0). .PP Arquivos binários são ignorados automaticamente, a menos que a conversão seja forçada. .PP Arquivos não regulares, tais como diretórios e FIFOs, são ignorados automaticamente. .PP Ligações simbólicas e seus alvos são por padrão mantidas intocáveis. Ligações simbólicas podem opcionalmente ser substituídas, ou a saída pode ser escrita para o alvo das ligações simbólicas. Não há suporte às ligações simbólicas do Windows. .PP Dos2unix foi modelado seguindo dos2unix do SunOS/Solaris. Há uma diferença importante em relação à versão original do SunOS/Solaris. Essa versão faz conversão no-lugar (modo arquivo antigo) por padrão, enquanto a versão original do SunOS/Solaris fornecia suporte apenas a conversão pareada (modo de novo arquivo). Veja também as opções \f(CW\*(C`\-o\*(C'\fR e \f(CW\*(C`\-n\*(C'\fR. Uma outra diferença é que a versão SunOS/Solaris usa, por padrão, a conversão de modo do \fIiso\fR enquanto esta versão usa o do \fIascii\fR. .SH "OPÇÕES" .IX Header "OPÇÕES" .IP "\fB\-\-\fR" 4 .IX Item "--" Trata as opções seguintes como nomes de arquivos. Use essa opção se você quiser converter arquivos cujos nomes iniciam com um traço. Por exemplo, para converter um arquivo chamado \*(L"foo\*(R", você pode usar este comando: .Sp .Vb 1 \& dos2unix \-\- \-foo .Ve .Sp Ou em modo de novo arquivo: .Sp .Vb 1 \& dos2unix \-n \-\- \-foo saída.txt .Ve .IP "\fB\-ascii\fR" 4 .IX Item "-ascii" Converte apenas as quebras de linhas. Esse é o modo de conversão padrão. .IP "\fB\-iso\fR" 4 .IX Item "-iso" Conversão entre conjunto de caractere do \s-1DOS\s0 e \s-1ISO\-8859\-1.\s0 Veja também a seção \s-1MODOS DE\s0 CONVERSÃO. .IP "\fB\-1252\fR" 4 .IX Item "-1252" Usa a página de código 1252 do Windows (Europa ocidental). .IP "\fB\-437\fR" 4 .IX Item "-437" Usa a página de código 437 do \s-1DOS \s0(\s-1EUA\s0). Essa é a página de código padrão usada para conversão \s-1ISO.\s0 .IP "\fB\-850\fR" 4 .IX Item "-850" Usa a página de código 850 do \s-1DOS \s0(Europa ocidental). .IP "\fB\-860\fR" 4 .IX Item "-860" Usa a página de código 860 do \s-1DOS \s0(Português). .IP "\fB\-863\fR" 4 .IX Item "-863" Usa a página de código 863 do \s-1DOS \s0(Francês do Canadá). .IP "\fB\-865\fR" 4 .IX Item "-865" Usa a página de código 865 do \s-1DOS \s0(Nórdico). .IP "\fB\-7\fR" 4 .IX Item "-7" Converte caracteres de 8 bits para espaço de 7 bits. .IP "\fB\-b, \-\-keep\-bom\fR" 4 .IX Item "-b, --keep-bom" Mantém marca de ordem de bytes (\s-1BOM\s0). Quando o arquivo de entrada possuir um \&\s-1BOM,\s0 escreve um \s-1BOM\s0 no arquivo de saída. Esse é o comportamento padrão ao converter para quebras de linha do \s-1DOS.\s0 Veja também a opção \f(CW\*(C`\-r\*(C'\fR. .IP "\fB\-c, \-\-convmode \s-1MODOCONV\s0\fR" 4 .IX Item "-c, --convmode MODOCONV" Define o modo de conversão, sendo \s-1MODOCONV\s0 um dentre: \fIascii\fR, \fI7bit\fR, \&\fIiso\fR, \fImac\fR com ascii sendo o padrão. .IP "\fB\-D, \-\-display\-enc CODIFICAÇÃO\fR" 4 .IX Item "-D, --display-enc CODIFICAÇÃO" Define a codificação do texto exibido, sendo CODIFICAÇÃO um dentre: \fIansi\fR, \&\fIunicode\fR, \fIutf8\fR, \fIutf8bom\fR com ansi sendo o padrão. .Sp Essa opção está disponível apenas no dos2unix para Windows com suporte a nome de arquivo em Unicode. Essa opção não possui efeito nos nomes de arquivos lidos e escritos, apenas em como eles são exibidos. .Sp Há vários métodos para exibir texto em um console Windows baseado na codificação do texto. Todos eles possuem suas próprias vantagens e desvantagens. .RS 4 .IP "\fBansi\fR" 4 .IX Item "ansi" O método padrão do dos2unix é usar o texto codificado em \s-1ANSI. A\s0 sua vantagem é a compatibilidade reversa. Ele funciona com fontes raster e TrueType. Em algumas regiões você pode precisar alterar a página de código \&\s-1OEM\s0 do \s-1DOS\s0 para \s-1ANSI\s0 do sistema Windows usando o comando \f(CW\*(C`chcp\*(C'\fR, porque dos2unix usa a página de código do sistema Windows. .Sp A desvantagem do ansi é que nomes de arquivos internacionais com caracteres fora a página de código padrão do sistema não são exibidos apropriadamente. Você verá um sinal de interrogação, ou um símbolo incorreto. Quando você não utiliza nomes de arquivos estrangeiros, esse método funciona bem. .IP "\fBunicode, unicodebom\fR" 4 .IX Item "unicode, unicodebom" A vantagem da codificação do unicode (o nome Windows para \s-1UTF\-16\s0) é que o texto é normalmente exibido apropriadamente. Não há necessidade para alterar a página de código ativa. Você pode precisar definir a fonte do console para uma fonte TrueType para que caracteres internacionais sejam exibidos apropriadamente. Quando um caractere não está incluído na fonte TrueType, geralmente você vê um pequeno quadrado, algumas vezes com um sinal de interrogação nele. .Sp Quando você usa o console ConEmu todo texto é exibido apropriadamente, porque o ConEmu seleciona automaticamente um fonte boa. .Sp A desvantagem do unicode é que ele não é compatível com \s-1ASCII. A\s0 saída não é fácil de lidar quando você o redireciona para um outro programa. .Sp Quando o método é usado, o texto Unicode será precedido com um \&\s-1BOM \s0(Byte Order Mark, ou marca de ordem de byte). Um \s-1BOM\s0 é necessário para o redirecionamento, ou \*(L"piping\*(R", correto no PowerShell. .IP "\fButf8, utf8bom\fR" 4 .IX Item "utf8, utf8bom" A vantagem do utf8 é que ele é compatível com \s-1ASCII.\s0 Você precisa definir a fonte do console para uma fonte TrueType. Com uma fonte TrueType, o texto é exibido similar a uma codificação \f(CW\*(C`unicode\*(C'\fR. .Sp A desvantagem é que quando você usa a fonte \*(L"raster\*(R" padrão, caracteres não\-ASCII são exibidos incorretamente. Não apenas nomes de arquivos unicode, mas também mensagens traduzidas ficam ilegíveis. No Windows configurado para uma região leste da Ásia, você pode ver muitas falhas no console quando as mensagens são exibidas. .Sp Em um console ConEmu, o método de codificação utf8 funciona bem. .Sp Quando o método é usado, o texto \s-1UTF\-8\s0 será precedido com um \s-1BOM \&\s0(Byte Order Mark, ou marca de ordem de byte). Um \s-1BOM\s0 é necessário para o redirecionamento, ou \*(L"piping\*(R", correto no PowerShell. .RE .RS 4 .Sp A codificação padrão pode ser alterada com a variável de ambiente \&\s-1DOS2UNIX_DISPLAY_ENC\s0 definindo-a para \f(CW\*(C`unicode\*(C'\fR, \f(CW\*(C`unicodebom\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR ou \&\f(CW\*(C`utf8bom\*(C'\fR. .RE .IP "\fB\-f, \-\-force\fR" 4 .IX Item "-f, --force" Força a conversão de arquivos binários. .IP "\fB\-gb, \-\-gb18030\fR" 4 .IX Item "-gb, --gb18030" No Windows, arquivos \s-1UTF\-16\s0 são convertidos, por padrão, para \s-1UTF\-8,\s0 independentemente da localização definida. Use esta opção para converter arquivos \s-1UTF\-16\s0 para \s-1GB18030.\s0 Essa opção está disponível apenas no Windows. Veja também a seção \s-1GB18030.\s0 .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Exibe ajuda e sai. .IP "\fB\-i[OPÇÕES], \-\-info[=OPÇÕES] \s-1ARQUIVO ...\s0\fR" 4 .IX Item "-i[OPÇÕES], --info[=OPÇÕES] ARQUIVO ..." Exibe informação do arquivo. Nenhuma conversão é feita. .Sp A seguinte informação é exibida, nesta ordem: número de quebras de linha do \&\s-1DOS,\s0 número de quebras de linha do Unix, número de quebras de linha do Mac, marca de ordem de byte, \*(L"text\*(R" ou \*(L"binary\*(R", nome de arquivo. .Sp Exemplo de saída: .Sp .Vb 8 \& 6 0 0 no_bom text dos.txt \& 0 6 0 no_bom text unix.txt \& 0 0 6 no_bom text mac.txt \& 6 6 6 no_bom text mixed.txt \& 50 0 0 UTF\-16LE text utf16le.txt \& 0 50 0 no_bom text utf8unix.txt \& 50 0 0 UTF\-8 text utf8dos.txt \& 2 418 219 no_bom binary dos2unix.exe .Ve .Sp Note que em algumas vezes um arquivo binário pode ser confundido com um arquivo texto. Veja também a opção \f(CW\*(C`\-s\*(C'\fR. .Sp Opcionalmente, opções extra podem ser definidas para alterar a saída. Uma ou mais opções podem ser adicionadas. .RS 4 .IP "\fBd\fR" 4 .IX Item "d" Exibe o número de quebras de linhas do \s-1DOS.\s0 .IP "\fBu\fR" 4 .IX Item "u" Exibe o número de quebras de linhas do Unix. .IP "\fBm\fR" 4 .IX Item "m" Exibe o número de quebras de linhas do Mac. .IP "\fBb\fR" 4 .IX Item "b" Exibe a marca de ordem de byte. .IP "\fBt\fR" 4 .IX Item "t" Exibe se arquivo é texto ou binário. .IP "\fBc\fR" 4 .IX Item "c" Exibe apenas os arquivos que seriam convertidos. .Sp Com a opção \f(CW\*(C`c\*(C'\fR, dos2unix vai exibir apenas os arquivos que contêm quebras de linha do \s-1DOS,\s0 unix2dos vai exibir apenas os nomes de arquivos que contêm quebras de linha do Unix. .IP "\fBh\fR" 4 .IX Item "h" Exibe um cabeçalho. .IP "\fBp\fR" 4 .IX Item "p" Mostra nomes de arquivos sem caminho. .RE .RS 4 .Sp Exemplos: .Sp Mostra informação sobre todos os arquivos *.txt: .Sp .Vb 1 \& dos2unix \-i *.txt .Ve .Sp Mostra apenas o número de quebras de linha \s-1DOS\s0 e Unix: .Sp .Vb 1 \& dos2unix \-idu *.txt .Ve .Sp Mostra apenas a marca de ordem de byte: .Sp .Vb 1 \& dos2unix \-\-info=b *.txt .Ve .Sp Lista os arquivos que possuem quebras de linha do \s-1DOS:\s0 .Sp .Vb 1 \& dos2unix \-ic *.txt .Ve .Sp Lista os arquivos que possuem quebras de linha do Unix: .Sp .Vb 1 \& unix2dos \-ic *.txt .Ve .Sp Converte apenas arquivos que possuem quebras de linha do \s-1DOS\s0 e não altera outros arquivos: .Sp .Vb 1 \& dos2unix \-ic *.txt | xargs dos2unix .Ve .Sp Localiza arquivos de texto que possuam quebras de linha do \s-1DOS:\s0 .Sp .Vb 1 \& find \-name \*(Aq*.txt\*(Aq | xargs dos2unix \-ic .Ve .RE .IP "\fB\-k, \-\-keepdate\fR" 4 .IX Item "-k, --keepdate" Mantém a marca da data do arquivo de saída igual ao do arquivo de entrada. .IP "\fB\-L, \-\-license\fR" 4 .IX Item "-L, --license" Exibe a licença do programa. .IP "\fB\-l, \-\-newline\fR" 4 .IX Item "-l, --newline" Adiciona nova linha adicional. .Sp \&\fBdos2unix\fR: Apenas quebras de linha do \s-1DOS\s0 são alteradas para duas quebras de linha do Unix. No modo Mac, apenas quebras de linha do Mac são alterados para duas quebras de linha do Unix. .Sp \&\fBunix2dos\fR: Apenas quebras de linha do Unix são alteradas para duas quebras de linha do \s-1DOS.\s0 No modo Mac, quebras de linha do Unix são alteradas para duas quebras de linha do Mac. .IP "\fB\-m, \-\-add\-bom\fR" 4 .IX Item "-m, --add-bom" Escreve uma marca de ordem de byte (\s-1BOM\s0) no arquivo de saída. Por padrão, um \&\s-1BOM UTF\-8\s0 é escrito. .Sp Quando o arquivo de entrada é \s-1UTF\-16,\s0 e a opção \f(CW\*(C`\-u\*(C'\fR é usada, um \s-1BOM UTF\-16\s0 será escrito. .Sp Nunca use essa opção quando a codificação de saída é outra além de \s-1UTF\-8, UTF\-16\s0 ou \s-1GB18030.\s0 Veja também a seção \s-1UNICODE.\s0 .IP "\fB\-n, \-\-newfile \s-1ARQENT\s0 ARQSAÍDA ...\fR" 4 .IX Item "-n, --newfile ARQENT ARQSAÍDA ..." Modo de novo arquivo. Converte o arquivo \s-1ARQENT\s0 e escreve a saída para o arquivo ARQSAÍDA. Os nomes de arquivos devem ser fornecidos em pares e nome coringa \fInão\fR deveriam ser usados ou você \fIvai\fR perder seus arquivos. .Sp A pessoa que começa a conversão em modo novo arquivo (pareado) será o dono do arquivo convertido. As permissões de leitura/escrita do novo arquivo serão as permissões do arquivo original menos a \fIumask\fR\|(1) da pessoa que executa a conversão. .IP "\fB\-o, \-\-oldfile \s-1ARQUIVO ...\s0\fR" 4 .IX Item "-o, --oldfile ARQUIVO ..." Modo arquivo antigo. Converte o arquivo \s-1ARQUIVO\s0 e o sobrescreve com a saída. O programa, por padrão, executa neste modo. Nomes coringas podem ser usados. .Sp No modo de arquivo antigo (no-lugar) o arquivo convertido recebe no mesmo dono, grupo e permissões de leitura/escrita que o arquivo original. Também, quando o arquivo é convertido por outro usuário que tenha permissões de escrita no arquivo (ex.: usuário root). A conversão será abortada quando não for possível preservar os valores originais. Alteração do dono pode significar que o dono original não é mais capaz de ler o arquivo. Alteração do grupo pode ser um risco para a segurança, pois o arquivo pode ficar legível para pessoas cujo acesso não é desejado. Preservação do dono, grupo e permissões de leitura/escrita tem suporte apenas no Unix. .IP "\fB\-q, \-\-quiet\fR" 4 .IX Item "-q, --quiet" Modo quieto. Suprime todos os avios e mensagens. O valor retornado é zero. Exceto quando opções de linha de comando erradas forem usadas. .IP "\fB\-r, \-\-remove\-bom\fR" 4 .IX Item "-r, --remove-bom" remove marca de ordem de bytes (\s-1BOM\s0). Não escreve um \s-1BOM\s0 no arquivo de saída. Esse é o comportamento padrão ao converter para quebras de linha Unix. Veja também a opção \f(CW\*(C`\-b\*(C'\fR. .IP "\fB\-s, \-\-safe\fR" 4 .IX Item "-s, --safe" Ignora arquivo binários (padrão). .Sp A ação de ignorar arquivos binários é feita para evitar equívocos acidentais. Fique ciente de que a detecção de arquivos binários não é 100% à prova de erros. Arquivos de entrada são analisados por símbolos binários que, geralmente, não são encontrados em arquivos textos. É possível que um arquivo binário contenha apenas caracteres de texto normais. tal arquivo binário pode ser acidentalmente visto como um arquivo de texto. .IP "\fB\-u, \-\-keep\-utf16\fR" 4 .IX Item "-u, --keep-utf16" Mantém a codificação \s-1UTF\-16\s0 original do arquivo de entrada. O arquivo de saída será escrito na mesma codificação \s-1UTF\-16,\s0 em little ou big endian, como o arquivo de entrada. Isso evita transformação para \s-1UTF\-8.\s0 Como consequência, um \s-1BOM UTF\-16\s0 será escrito. Essa opção pode ser desabilitada com a opção \f(CW\*(C`\-ascii\*(C'\fR. .IP "\fB\-ul, \-\-assume\-utf16le\fR" 4 .IX Item "-ul, --assume-utf16le" Presume que o formato de arquivo de entrada é \s-1UTF\-16LE.\s0 .Sp Quando há uma marca de ordem de byte no arquivo de entrada, esta tem prioridade sobre essa opção. .Sp Quando você fizer uma presunção equivocada (o arquivo de entrada não estava no formato \s-1UTF\-16LE\s0) e a conversão funcionar, você terá um arquivo de saída \&\s-1UTF\-8\s0 com texto errado. Você pode desfazer a conversão errada com \fIiconv\fR\|(1) pela conversão do arquivo de saída \s-1UTF\-8\s0 de volta para \s-1UTF\-16LE.\s0 Isso vai trazer de volta o arquivo para o original. .Sp A presunção de \s-1UTF\-16LE\s0 funciona como um \fImodo de conversão\fR. Ao alternara o modo \fIascii\fR padrão, a presunção de \s-1UTF\-16LE\s0 é desativada. .IP "\fB\-ub, \-\-assume\-utf16be\fR" 4 .IX Item "-ub, --assume-utf16be" Presume que o formato de arquivo de entrada é \s-1UTF\-16BE.\s0 .Sp Essa opção funciona o mesmo que a opção \f(CW\*(C`\-ul\*(C'\fR. .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Exibe mensagens detalhadas. Informação extra é exibida sobre marcas de ordem de byte e a quantidade de quebras de linha convertidas. .IP "\fB\-F, \-\-follow\-symlink\fR" 4 .IX Item "-F, --follow-symlink" Segue ligações simbólicas e converte os alvos. .IP "\fB\-R, \-\-replace\-symlink\fR" 4 .IX Item "-R, --replace-symlink" Substitui ligações simbólicas com arquivos convertidos (arquivos alvo originais permanecem inalterados). .IP "\fB\-S, \-\-skip\-symlink\fR" 4 .IX Item "-S, --skip-symlink" Mentém ligações simbólicas e alvos inalterados (padrão). .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" Exibe informação da versão e sai. .SH "MODO MAC" .IX Header "MODO MAC" No modo normal, as quebras de linhas são convertidas de \s-1DOS\s0 para Unix e vice-versa. Quebras de linha do Mac não são convertidas. .PP No modo Mac, quebras de linha são convertidas de Mac para Unix e vice-versa. Quebras de linha do \s-1DOS\s0 não são alteradas. .PP Para executar no modo Mac, use a opção de linha de comando \f(CW\*(C`\-c mac\*(C'\fR ou use os comandos \f(CW\*(C`mac2unix\*(C'\fR ou \f(CW\*(C`unix2mac\*(C'\fR. .SH "MODOS DE CONVERSÃO" .IX Header "MODOS DE CONVERSÃO" .IP "\fBascii\fR" 4 .IX Item "ascii" No modo \f(CW\*(C`ascii\*(C'\fR, apenas as quebras de linha são convertidas. Esse é o modo de conversão padrão. .Sp Apesar do nome deste modo ser \s-1ASCII,\s0 o qual é um padrão de 7 bits, o modo é em verdade 8 bits. Sempre use este modo quando quiser converter arquivos Unicode \s-1UTF\-8.\s0 .IP "\fB7bit\fR" 4 .IX Item "7bit" Neste modo todos os caracteres não\-ASCII de 8 bits (com valores entre 128 e 255) são convertidos para um espaço de 7 bits. .IP "\fBiso\fR" 4 .IX Item "iso" Caracteres são convertidos entre um conjunto de caracteres do \s-1DOS \s0(página de código) e conjunto de caracteres \s-1ISO\-8859\-1 \s0(Latin\-1) no Unix. Caracteres de \&\s-1DOS\s0 sem um equivalente \s-1ISO\-8859\-1,\s0 para os quais a conversão não é possível, são convertidos para um ponto. O mesmo vale para caracteres \s-1ISO\-8859\-1\s0 sem a contraparte \s-1DOS.\s0 .Sp Quando apenas a opção \f(CW\*(C`\-iso\*(C'\fR for usada, dos2unix vai tentar determinar a página de código ativa. Quando isso não for possível, dos2unix vai usar a página de código padrão \s-1CP437,\s0 a qual é usada principalmente nos \s-1EUA.\s0 Para forçar uma página de código específica, use as opções \f(CW\*(C`\-437\*(C'\fR (\s-1EUA\s0), \f(CW\*(C`\-850\*(C'\fR (Europeu oriental), \f(CW\*(C`\-860\*(C'\fR (Português), \f(CW\*(C`\-863\*(C'\fR (Franco-canadense) ou \&\f(CW\*(C`\-865\*(C'\fR (Nórdico). Também há suporte à página de código do Windows \s-1CP1252 \&\s0(Europeu ocidental) com a opção \f(CW\*(C`\-1252\*(C'\fR. Para outras páginas de código, use dos2unix em combinação cm \fIiconv\fR\|(1). Iconv pode converter entre uma lista grande de codificações de caracteres. .Sp Nunca use conversão \s-1ISO\s0 em arquivos textos Unicode. Isso vai corromper os arquivos codificados em \s-1UTF\-8.\s0 .Sp Alguns exemplos: .Sp Conversão da página de código padrão do \s-1DOS\s0 para Latin\-1 do Unix: .Sp .Vb 1 \& dos2unix \-iso \-n entrada.txt saída.txt .Ve .Sp Conversão da \s-1CP850\s0 do \s-1DOS\s0 para Latin\-1 do Unix: .Sp .Vb 1 \& dos2unix \-850 \-n entrada.txt saída.txt .Ve .Sp Conversão da \s-1CP1252\s0 do Windows para Latin\-1 do Unix: .Sp .Vb 1 \& dos2unix \-1252 \-n entrada.txt saída.txt .Ve .Sp Conversão da \s-1CP1252\s0 do Windows para \s-1UTF\-8 \s0(Unicode) do Unix: .Sp .Vb 1 \& iconv \-f CP1252 \-t UTF\-8 entrada.txt | dos2unix > saída.txt .Ve .Sp Conversão de Latin\-1 do Unix para página de código padrão do \s-1DOS:\s0 .Sp .Vb 1 \& unix2dos \-iso \-n entrada.txt saída.txt .Ve .Sp Conversão do Latin\-1 do Unix para \s-1CP850\s0 do \s-1DOS:\s0 .Sp .Vb 1 \& unix2dos \-850 \-n entrada.txt saída.txt .Ve .Sp Conversão do Latin\-1 do unix para \s-1CP1252\s0 do Windows: .Sp .Vb 1 \& unix2dos \-1252 \-n entrada.txt saída.txt .Ve .Sp Conversão do \s-1UTF\-8 \s0(Unicode) do Unix para \s-1CP1252\s0 do Windows: .Sp .Vb 1 \& unix2dos < entrada.txt | iconv \-f UTF\-8 \-t CP1252 > saída.txt .Ve .Sp Veja também e . .SH "UNICODE" .IX Header "UNICODE" .SS "Codificações" .IX Subsection "Codificações" Exitem codificações Unicode diferentes. No Unix e no Linux, arquivos Unicode são geralmente codificados em \s-1UTF\-8.\s0 No Windows, arquivos texto Unicode podem ser codificados em \s-1UTF\-8, UTF\-16\s0 ou \s-1UTF\-16\s0 big endian, mas na maioria das vezes são codificados no formato \s-1UTF\-16.\s0 .SS "Conversão" .IX Subsection "Conversão" Arquivos texto em Unicode pode ter quebras de linha \s-1DOS,\s0 Unix ou Mac, como arquivos texto comuns. .PP Todas as versões do dos2unix e unix2dos podem converter arquivos codificados em \s-1UTF\-8\s0 porque \s-1UTF\-8\s0 foi projetado para ter compatibilidade reversa com \&\s-1ASCII.\s0 .PP Dos2unix e unix2dos com suporte a Unicode \s-1UTF\-16\s0 podem ler arquivos texto codificados em little e big endian \s-1UTF\-16.\s0 Para ver se dos2unix foi compilado com suporte a \s-1UTF\-16,\s0 digite \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP No Unix/Linux, arquivos codificados em \s-1UTF\-16\s0 são convertidos para a codificação de caracteres do localização. Use o comando \fIlocale\fR\|(1) para descobrir qual é a codificação de caracteres da localização. Quando a conversão não for possível, ocorrerá um erro e o arquivo será ignorado. .PP No Windows, arquivos \s-1UTF\-16\s0 são convertidos, por padrão, para \&\s-1UTF\-8.\s0 Arquivos texto formatados em \s-1UTF\-8\s0 possuem ótimo suporte em ambos Windows e Unix/Linux. .PP Codificações \s-1UTF\-16\s0 e \s-1UTF\-8\s0 são completamente compatíveis, não havendo qualquer perda de texto na conversão. Quando um erro de conversão \s-1UTF\-16\s0 para \s-1UTF\-8\s0 ocorre, por exemplo quando o arquivo de entrada \s-1UTF\-16 \s0 contém um erro, o arquivo será ignorado. .PP Quando a opção \f(CW\*(C`\-u\*(C'\fR é usada, o arquivo de saída será escrito na mesma codificação \s-1UTF\-16\s0 que o arquivo de saída. A opção \f(CW\*(C`\-u\*(C'\fR evita conversão para \s-1UTF\-8.\s0 .PP Dos2unix e unix2dos não possuem opção para converter arquivos \s-1UTF\-8\s0 para \&\s-1UTF\-16.\s0 .PP Modo de conversão \s-1ISO\s0 e 7 bits não funcionam em arquivos \s-1UTF\-16.\s0 .SS "Marca de ordem de byte" .IX Subsection "Marca de ordem de byte" No Windows, arquivos Unicode normalmente têm uma Marca de Ordem de Byte (\s-1BOM\s0), porque muitos programas (incluindo o Bloco de Notas) adiciona BOMs por padrão. Veja também . .PP No Unix, arquivos Unicode normalmente não têm \s-1BOM.\s0 Presume-se que arquivos texto são codificados na codificação de caracteres da localização. .PP Dos2unix pode detectar apenas se um arquivo está no formato \s-1UTF\-16\s0 se o arquivo tiver \s-1BOM.\s0 Quando um arquivo \s-1UTF\-16\s0 não tiver \s-1BOM,\s0 dos2unix vai ver se o arquivo é um arquivo binário. .PP Use a opção \f(CW\*(C`\-ul\*(C'\fR ou \f(CW\*(C`\-ub\*(C'\fR para converter um arquivo \s-1UTF\-16\s0 sem \s-1BOM.\s0 .PP Dos2unix escreve por padrão nenhum \s-1BOM\s0 no arquivo de saída. Com a opção \&\f(CW\*(C`\-b\*(C'\fR, o Dos2unix escreve um \s-1BOM\s0 quando o arquivo de entrada possuir \s-1BOM.\s0 .PP Unix2dos escreve por padrão um \s-1BOM\s0 no arquivo de saída quando o arquivo de entrada tem \s-1BOM.\s0 Use a opção \f(CW\*(C`\-m\*(C'\fR para remover \s-1BOM.\s0 .PP Dos2unix e unix2dos sempre escrevem \s-1BOM\s0 quando a opção \f(CW\*(C`\-m\*(C'\fR é usada. .SS "Nomes de arquivos Unicode no Windows" .IX Subsection "Nomes de arquivos Unicode no Windows" Dos2unix possui um suporte opcional para leitura e escrita de nomes de arquivos Unicode no Prompt de Comando Windows. Isso significa que dos2unix pode abrir arquivos que possuam caracteres no nome que não são parte da página de código \s-1ANSI\s0 padrão do sistema. Para ver ser dosunix para Windows foi compilado com suporte a nomes de arquivos Unicode, digite \f(CW\*(C`dos2unix \&\-V\*(C'\fR. .PP Há alguns problemas com a exibição de nomes de arquivos Unicode em um console Windows. Veja a opção \f(CW\*(C`\-D\*(C'\fR, \f(CW\*(C`\-\-display\-enc\*(C'\fR. Para nomes de arquivos pode ser exibido incorretamente, mas os arquivos serão escritos com o nome correto. .SS "Exemplos de Unicode" .IX Subsection "Exemplos de Unicode" Conversão de \s-1UTF\-16\s0 do Windows (com \s-1BOM\s0) para \s-1UTF\-8\s0 do Unix: .PP .Vb 1 \& dos2unix \-n entrada.txt saída.txt .Ve .PP Conversão de \s-1UTF\-16LE\s0 do Windows (sem \s-1BOM\s0) para \s-1UTF\-8\s0 do Unix: .PP .Vb 1 \& dos2unix \-ul \-n entrada.txt saída.txt .Ve .PP Conversão de \s-1UTF\-8\s0 Unix para \s-1UTF\-8\s0 do Windows com \s-1BOM:\s0 .PP .Vb 1 \& unix2dos \-m \-n entrada.txt saída.txt .Ve .PP Conversão de \s-1UTF\-8\s0 do Unix para \s-1UTF\-16\s0 do Windows: .PP .Vb 1 \& unix2dos < entrada.txt | iconv \-f UTF\-8 \-t UTF\-16 > saída.txt .Ve .SH "GB18030" .IX Header "GB18030" \&\s-1GB18030\s0 é um padrão governamental chinês. Um subconjunto obrigatório do padrão \s-1GB18030\s0 é exigido oficialmente para todos os produtos de software vendidos na China. Veja também . .PP \&\s-1GB18030\s0 é completamente compatível com Unicode e pode ser considerado um formato de transformação de unicode. Assim como \s-1UTF\-8, GB18030\s0 é compatível com \s-1ASCII. GB18030\s0 também é compatível com a página de código 936 do Windows, também conhecida como \s-1GBK.\s0 .PP No Unix/Linux, arquivos \s-1UTF\-16\s0 são convertidos para \s-1GB18030\s0 quando a codificação da localização é definida para \s-1GB18030.\s0 Note que isso vai funcionar apenas se o sistemas oferecer suporte à localização. Use o comando \&\f(CW\*(C`locale \-a\*(C'\fR para obter a lista de localizações às quais há suporte. .PP No Windows, você precisa usar a opção \f(CW\*(C`\-gb\*(C'\fR para converter arquivos \s-1UTF\-16\s0 para \s-1GB18030.\s0 .PP Arquivos codificados em \s-1GB18030\s0 possuem uma marca de ordem de bytes, como arquivos Unicode. .SH "EXEMPLOS" .IX Header "EXEMPLOS" Lê a entrada da \*(L"stdin\*(R" e escreve a saída para \*(L"stdout\*(R": .PP .Vb 2 \& dos2unix < a.txt \& cat a.txt | dos2unix .Ve .PP Converte e substitui a.txt. Converte e substitui b.txt: .PP .Vb 2 \& dos2unix a.txt b.txt \& dos2unix \-o a.txt b.txt .Ve .PP Converte e substitui a.txt no modo de conversão ascii: .PP .Vb 1 \& dos2unix a.txt .Ve .PP Converte e substitui a.txt no modo de conversão ascii. Converte e substitui b.txt no modo de conversão 7bit: .PP .Vb 3 \& dos2unix a.txt \-c 7bit b.txt \& dos2unix \-c ascii a.txt \-c 7bit b.txt \& dos2unix \-ascii a.txt \-7 b.txt .Ve .PP Converte a.txt do formato do Mac para Unix: .PP .Vb 2 \& dos2unix \-c mac a.txt \& mac2unix a.txt .Ve .PP Converte a.txt do formato do Unix para Mac: .PP .Vb 2 \& unix2dos \-c mac a.txt \& unix2mac a.txt .Ve .PP Converte e substitui a.txt enquanto mantém a marca de data original: .PP .Vb 2 \& dos2unix \-k a.txt \& dos2unix \-k \-o a.txt .Ve .PP Converte a.txt e escreve para e.txt: .PP .Vb 1 \& dos2unix \-n a.txt e.txt .Ve .PP Converte a.txt e escreve para e.txt, mantém a marca de data de e.txt igual a a.txt: .PP .Vb 1 \& dos2unix \-k \-n a.txt e.txt .Ve .PP Converte e substitui a.txt. Converte b.txt e escreve para e.txt: .PP .Vb 2 \& dos2unix a.txt \-n b.txt e.txt \& dos2unix \-o a.txt \-n b.txt e.txt .Ve .PP Converte c.txt e escreve para e.txt. Converte e substitui a.txt. Converte e substitui b.txt. Converte d.txt e escreve para f.txt: .PP .Vb 1 \& dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt .Ve .SH "CONVERSÃO RECURSIVA" .IX Header "CONVERSÃO RECURSIVA" Use dos2unix em combinação com os comandos \fIfind\fR\|(1) e \fIxargs\fR\|(1) para converter recursivamente arquivos texto em uma estrutura de árvore de diretórios. Por exemplo, para converter todos os arquivos .txt na árvore de diretórios sob o diretório atual, digite: .PP .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .PP Em um Prompt de Comando do Windows o seguinte comando pode ser usado: .PP .Vb 1 \& for /R %G in (*.txt) do dos2unix "%G" .Ve .PP Usuários do PowerShell podem usar o seguinte comando no Windows PowerShell: .PP .Vb 1 \& get\-childitem \-path . \-filter \*(Aq*.txt\*(Aq \-recurse | foreach\-object {dos2unix $_.Fullname} .Ve .SH "LOCALIZAÇÃO" .IX Header "LOCALIZAÇÃO" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" O idioma primário é selecionado com a variável de ambiente \s-1LANG. A\s0 variável \&\s-1LANG\s0 consiste em várias partes. A primeira parte está em letras pequenas no código do idioma. A segunda parte é opcional e é o código do país em letras maiúsculo, precedido de um ponto. Alguns exemplos para shells do tipo padrão \&\s-1POSIX:\s0 .Sp .Vb 7 \& export LANG=nl Holandês \& export LANG=nl_NL Holandês, Holanda \& export LANG=nl_BE Holandês, Bélgica \& export LANG=es_ES Espanhol, Espanha \& export LANG=es_MX Espanhol, México \& export LANG=en_US.iso88591 Inglês, EUA, codificação Latin\-1 \& export LANG=en_GB.UTF\-8 Inglês, Reino Unido, codificação UTF\-8 .Ve .Sp Para a lista completa de códigos de idioma e país, veja o manual do gettext: .Sp Nos sistemas Unix, você pode usar o comando \fIlocale\fR\|(1) para obter informação específica da localização. .IP "\fB\s-1LANGUAGE\s0\fR" 4 .IX Item "LANGUAGE" Com a variável de ambiente \s-1LANGUAGE,\s0 você pode especificar uma lista de prioridades de idiomas, separada por vírgulas. Dos2unix fornece preferência à \s-1LANGUAGE\s0 sobre \s-1LANG.\s0 Por exemplo, primeiro holandês e, então, alemão: \&\f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. Você primeiro tem que habilitar localização, definindo \&\s-1LANG \s0(ou \s-1LC_ALL\s0) para um valor diferente de \*(L"C\*(R", antes que você possa usar uma lista de prioridade de idioma por meio da variável \s-1LANGUAGE.\s0 Veja também o manual do gettext: .Sp Se você selecionou um idioma que não está disponível, você vai terá as mensagens em inglês (padrão). .IP "\fB\s-1DOS2UNIX_LOCALEDIR\s0\fR" 4 .IX Item "DOS2UNIX_LOCALEDIR" Com a variável de ambiente \s-1DOS2UNIX_LOCALEDIR,\s0 o \s-1LOCALEDIR\s0 definido durante a compilação pode ser sobrescrito. \s-1LOCALEDIR\s0 é usada para localizar os arquivos de idioma. O valor padrão do \s-1GNU\s0 é \f(CW\*(C`/usr/local/share/locale\*(C'\fR. A opção \fB\-\-version\fR vai exibir o \s-1LOCALEDIR\s0 que é usado. .Sp Exemplo (shell \s-1POSIX\s0): .Sp .Vb 1 \& export DOS2UNIX_LOCALEDIR=$HOME/share/locale .Ve .SH "VALOR RETORNADO" .IX Header "VALOR RETORNADO" No sucesso, zero é retornado. Quando um erro de sistema ocorre, o último erro de sistema será retornado. Para outros erros, 1 é retornado. .PP O valor retornado é sempre zero no modo quieto, exceto quando opções de linha de comando erradas são usadas. .SH "PADRÕES" .IX Header "PADRÕES" .PP .PP .PP .SH "AUTORES" .IX Header "AUTORES" Benjamin Lin \- Bernd Johannes Wuebben (modo mac2unix) \&\- , Christian Wurll (adiciona nova linha extra) \- , Erwin Waterlander \- (mantenedor) .PP Página do projeto: .PP Página do SourceForge: .SH "Veja também" .IX Header "Veja também" \&\fIfile\fR\|(1) \fIfind\fR\|(1) \fIiconv\fR\|(1) \fIlocale\fR\|(1) \fIxargs\fR\|(1) dos2unix-7.3.4/man/pt_BR/man1/dos2unix.htm0000644000175500010010000011421712721132573017462 0ustar waterlanGeen dos2unix 7.3.4 - Conversor de formato de arquivo texto de DOS/Mac para Unix e vice-versa

NOME

dos2unix - Conversor de formato de arquivo texto de DOS/Mac para Unix e vice-versa

SINOPSE

    dos2unix [opções] [ARQUIVO ...] [-n ARQENT ARQSAÍDA ...]
    unix2dos [opções] [ARQUIVO ...] [-n ARQENT ARQSAÍDA ...]

DESCRIÇÃO

O pacote Dos2unix inclui utilitários de dos2unix e unix2dos para converter arquivos texto nos formatos DOS ou Mac para formato Unix e vice-versa.

Em arquivos texto DOS/Windows uma quebra de linha, também conhecida como nova linha, é uma combinação de dois caracteres: um Carriage Return (CR) seguido por um Line Feed (LF). Em arquivos texto do Unix uma quebra de linha é um único caractere: o Line Feed (LF). Em arquivos texto do Mac, anteriores ao Mac OS X, uma quebra de linha era um único caractere Carriage Return (CR). Hoje em dia, Mac OS usa quebras de linha no estilo do Unix (LF).

Além das quebras de linhas, Dos2unix também pode converter as codificações de arquivos. Algumas poucas páginas podem ser convertidos para Latin-1 para Unix. E arquivos Unicode do Windows (UTF-16) podem ser convertidos para arquivos Unicode do Unix (UTF-8).

Arquivos binários são ignorados automaticamente, a menos que a conversão seja forçada.

Arquivos não regulares, tais como diretórios e FIFOs, são ignorados automaticamente.

Ligações simbólicas e seus alvos são por padrão mantidas intocáveis. Ligações simbólicas podem opcionalmente ser substituídas, ou a saída pode ser escrita para o alvo das ligações simbólicas. Não há suporte às ligações simbólicas do Windows.

Dos2unix foi modelado seguindo dos2unix do SunOS/Solaris. Há uma diferença importante em relação à versão original do SunOS/Solaris. Essa versão faz conversão no-lugar (modo arquivo antigo) por padrão, enquanto a versão original do SunOS/Solaris fornecia suporte apenas a conversão pareada (modo de novo arquivo). Veja também as opções -o e -n. Uma outra diferença é que a versão SunOS/Solaris usa, por padrão, a conversão de modo do iso enquanto esta versão usa o do ascii.

OPÇÕES

--

Trata as opções seguintes como nomes de arquivos. Use essa opção se você quiser converter arquivos cujos nomes iniciam com um traço. Por exemplo, para converter um arquivo chamado "foo", você pode usar este comando:

    dos2unix -- -foo

Ou em modo de novo arquivo:

    dos2unix -n -- -foo saída.txt
-ascii

Converte apenas as quebras de linhas. Esse é o modo de conversão padrão.

-iso

Conversão entre conjunto de caractere do DOS e ISO-8859-1. Veja também a seção MODOS DE CONVERSÃO.

-1252

Usa a página de código 1252 do Windows (Europa ocidental).

-437

Usa a página de código 437 do DOS (EUA). Essa é a página de código padrão usada para conversão ISO.

-850

Usa a página de código 850 do DOS (Europa ocidental).

-860

Usa a página de código 860 do DOS (Português).

-863

Usa a página de código 863 do DOS (Francês do Canadá).

-865

Usa a página de código 865 do DOS (Nórdico).

-7

Converte caracteres de 8 bits para espaço de 7 bits.

-b, --keep-bom

Mantém marca de ordem de bytes (BOM). Quando o arquivo de entrada possuir um BOM, escreve um BOM no arquivo de saída. Esse é o comportamento padrão ao converter para quebras de linha do DOS. Veja também a opção -r.

-c, --convmode MODOCONV

Define o modo de conversão, sendo MODOCONV um dentre: ascii, 7bit, iso, mac com ascii sendo o padrão.

-D, --display-enc CODIFICAÇÃO

Define a codificação do texto exibido, sendo CODIFICAÇÃO um dentre: ansi, unicode, utf8, utf8bom com ansi sendo o padrão.

Essa opção está disponível apenas no dos2unix para Windows com suporte a nome de arquivo em Unicode. Essa opção não possui efeito nos nomes de arquivos lidos e escritos, apenas em como eles são exibidos.

Há vários métodos para exibir texto em um console Windows baseado na codificação do texto. Todos eles possuem suas próprias vantagens e desvantagens.

ansi

O método padrão do dos2unix é usar o texto codificado em ANSI. A sua vantagem é a compatibilidade reversa. Ele funciona com fontes raster e TrueType. Em algumas regiões você pode precisar alterar a página de código OEM do DOS para ANSI do sistema Windows usando o comando chcp, porque dos2unix usa a página de código do sistema Windows.

A desvantagem do ansi é que nomes de arquivos internacionais com caracteres fora a página de código padrão do sistema não são exibidos apropriadamente. Você verá um sinal de interrogação, ou um símbolo incorreto. Quando você não utiliza nomes de arquivos estrangeiros, esse método funciona bem.

unicode, unicodebom

A vantagem da codificação do unicode (o nome Windows para UTF-16) é que o texto é normalmente exibido apropriadamente. Não há necessidade para alterar a página de código ativa. Você pode precisar definir a fonte do console para uma fonte TrueType para que caracteres internacionais sejam exibidos apropriadamente. Quando um caractere não está incluído na fonte TrueType, geralmente você vê um pequeno quadrado, algumas vezes com um sinal de interrogação nele.

Quando você usa o console ConEmu todo texto é exibido apropriadamente, porque o ConEmu seleciona automaticamente um fonte boa.

A desvantagem do unicode é que ele não é compatível com ASCII. A saída não é fácil de lidar quando você o redireciona para um outro programa.

Quando o método <unicodebom> é usado, o texto Unicode será precedido com um BOM (Byte Order Mark, ou marca de ordem de byte). Um BOM é necessário para o redirecionamento, ou "piping", correto no PowerShell.

utf8, utf8bom

A vantagem do utf8 é que ele é compatível com ASCII. Você precisa definir a fonte do console para uma fonte TrueType. Com uma fonte TrueType, o texto é exibido similar a uma codificação unicode.

A desvantagem é que quando você usa a fonte "raster" padrão, caracteres não-ASCII são exibidos incorretamente. Não apenas nomes de arquivos unicode, mas também mensagens traduzidas ficam ilegíveis. No Windows configurado para uma região leste da Ásia, você pode ver muitas falhas no console quando as mensagens são exibidas.

Em um console ConEmu, o método de codificação utf8 funciona bem.

Quando o método <utf8bom> é usado, o texto UTF-8 será precedido com um BOM (Byte Order Mark, ou marca de ordem de byte). Um BOM é necessário para o redirecionamento, ou "piping", correto no PowerShell.

A codificação padrão pode ser alterada com a variável de ambiente DOS2UNIX_DISPLAY_ENC definindo-a para unicode, unicodebom, utf8 ou utf8bom.

-f, --force

Força a conversão de arquivos binários.

-gb, --gb18030

No Windows, arquivos UTF-16 são convertidos, por padrão, para UTF-8, independentemente da localização definida. Use esta opção para converter arquivos UTF-16 para GB18030. Essa opção está disponível apenas no Windows. Veja também a seção GB18030.

-h, --help

Exibe ajuda e sai.

-i[OPÇÕES], --info[=OPÇÕES] ARQUIVO ...

Exibe informação do arquivo. Nenhuma conversão é feita.

A seguinte informação é exibida, nesta ordem: número de quebras de linha do DOS, número de quebras de linha do Unix, número de quebras de linha do Mac, marca de ordem de byte, "text" ou "binary", nome de arquivo.

Exemplo de saída:

     6       0       0  no_bom    text    dos.txt
     0       6       0  no_bom    text    unix.txt
     0       0       6  no_bom    text    mac.txt
     6       6       6  no_bom    text    mixed.txt
    50       0       0  UTF-16LE  text    utf16le.txt
     0      50       0  no_bom    text    utf8unix.txt
    50       0       0  UTF-8     text    utf8dos.txt
     2     418     219  no_bom    binary  dos2unix.exe

Note que em algumas vezes um arquivo binário pode ser confundido com um arquivo texto. Veja também a opção -s.

Opcionalmente, opções extra podem ser definidas para alterar a saída. Uma ou mais opções podem ser adicionadas.

d

Exibe o número de quebras de linhas do DOS.

u

Exibe o número de quebras de linhas do Unix.

m

Exibe o número de quebras de linhas do Mac.

b

Exibe a marca de ordem de byte.

t

Exibe se arquivo é texto ou binário.

c

Exibe apenas os arquivos que seriam convertidos.

Com a opção c, dos2unix vai exibir apenas os arquivos que contêm quebras de linha do DOS, unix2dos vai exibir apenas os nomes de arquivos que contêm quebras de linha do Unix.

h

Exibe um cabeçalho.

p

Mostra nomes de arquivos sem caminho.

Exemplos:

Mostra informação sobre todos os arquivos *.txt:

    dos2unix -i *.txt

Mostra apenas o número de quebras de linha DOS e Unix:

    dos2unix -idu *.txt

Mostra apenas a marca de ordem de byte:

    dos2unix --info=b *.txt

Lista os arquivos que possuem quebras de linha do DOS:

    dos2unix -ic *.txt

Lista os arquivos que possuem quebras de linha do Unix:

    unix2dos -ic *.txt

Converte apenas arquivos que possuem quebras de linha do DOS e não altera outros arquivos:

    dos2unix -ic *.txt | xargs dos2unix

Localiza arquivos de texto que possuam quebras de linha do DOS:

    find -name '*.txt' | xargs dos2unix -ic
-k, --keepdate

Mantém a marca da data do arquivo de saída igual ao do arquivo de entrada.

-L, --license

Exibe a licença do programa.

-l, --newline

Adiciona nova linha adicional.

dos2unix: Apenas quebras de linha do DOS são alteradas para duas quebras de linha do Unix. No modo Mac, apenas quebras de linha do Mac são alterados para duas quebras de linha do Unix.

unix2dos: Apenas quebras de linha do Unix são alteradas para duas quebras de linha do DOS. No modo Mac, quebras de linha do Unix são alteradas para duas quebras de linha do Mac.

-m, --add-bom

Escreve uma marca de ordem de byte (BOM) no arquivo de saída. Por padrão, um BOM UTF-8 é escrito.

Quando o arquivo de entrada é UTF-16, e a opção -u é usada, um BOM UTF-16 será escrito.

Nunca use essa opção quando a codificação de saída é outra além de UTF-8, UTF-16 ou GB18030. Veja também a seção UNICODE.

-n, --newfile ARQENT ARQSAÍDA ...

Modo de novo arquivo. Converte o arquivo ARQENT e escreve a saída para o arquivo ARQSAÍDA. Os nomes de arquivos devem ser fornecidos em pares e nome coringa não deveriam ser usados ou você vai perder seus arquivos.

A pessoa que começa a conversão em modo novo arquivo (pareado) será o dono do arquivo convertido. As permissões de leitura/escrita do novo arquivo serão as permissões do arquivo original menos a umask(1) da pessoa que executa a conversão.

-o, --oldfile ARQUIVO ...

Modo arquivo antigo. Converte o arquivo ARQUIVO e o sobrescreve com a saída. O programa, por padrão, executa neste modo. Nomes coringas podem ser usados.

No modo de arquivo antigo (no-lugar) o arquivo convertido recebe no mesmo dono, grupo e permissões de leitura/escrita que o arquivo original. Também, quando o arquivo é convertido por outro usuário que tenha permissões de escrita no arquivo (ex.: usuário root). A conversão será abortada quando não for possível preservar os valores originais. Alteração do dono pode significar que o dono original não é mais capaz de ler o arquivo. Alteração do grupo pode ser um risco para a segurança, pois o arquivo pode ficar legível para pessoas cujo acesso não é desejado. Preservação do dono, grupo e permissões de leitura/escrita tem suporte apenas no Unix.

-q, --quiet

Modo quieto. Suprime todos os avios e mensagens. O valor retornado é zero. Exceto quando opções de linha de comando erradas forem usadas.

-r, --remove-bom

remove marca de ordem de bytes (BOM). Não escreve um BOM no arquivo de saída. Esse é o comportamento padrão ao converter para quebras de linha Unix. Veja também a opção -b.

-s, --safe

Ignora arquivo binários (padrão).

A ação de ignorar arquivos binários é feita para evitar equívocos acidentais. Fique ciente de que a detecção de arquivos binários não é 100% à prova de erros. Arquivos de entrada são analisados por símbolos binários que, geralmente, não são encontrados em arquivos textos. É possível que um arquivo binário contenha apenas caracteres de texto normais. tal arquivo binário pode ser acidentalmente visto como um arquivo de texto.

-u, --keep-utf16

Mantém a codificação UTF-16 original do arquivo de entrada. O arquivo de saída será escrito na mesma codificação UTF-16, em little ou big endian, como o arquivo de entrada. Isso evita transformação para UTF-8. Como consequência, um BOM UTF-16 será escrito. Essa opção pode ser desabilitada com a opção -ascii.

-ul, --assume-utf16le

Presume que o formato de arquivo de entrada é UTF-16LE.

Quando há uma marca de ordem de byte no arquivo de entrada, esta tem prioridade sobre essa opção.

Quando você fizer uma presunção equivocada (o arquivo de entrada não estava no formato UTF-16LE) e a conversão funcionar, você terá um arquivo de saída UTF-8 com texto errado. Você pode desfazer a conversão errada com iconv(1) pela conversão do arquivo de saída UTF-8 de volta para UTF-16LE. Isso vai trazer de volta o arquivo para o original.

A presunção de UTF-16LE funciona como um modo de conversão. Ao alternara o modo ascii padrão, a presunção de UTF-16LE é desativada.

-ub, --assume-utf16be

Presume que o formato de arquivo de entrada é UTF-16BE.

Essa opção funciona o mesmo que a opção -ul.

-v, --verbose

Exibe mensagens detalhadas. Informação extra é exibida sobre marcas de ordem de byte e a quantidade de quebras de linha convertidas.

Segue ligações simbólicas e converte os alvos.

Substitui ligações simbólicas com arquivos convertidos (arquivos alvo originais permanecem inalterados).

Mentém ligações simbólicas e alvos inalterados (padrão).

-V, --version

Exibe informação da versão e sai.

MODO MAC

No modo normal, as quebras de linhas são convertidas de DOS para Unix e vice-versa. Quebras de linha do Mac não são convertidas.

No modo Mac, quebras de linha são convertidas de Mac para Unix e vice-versa. Quebras de linha do DOS não são alteradas.

Para executar no modo Mac, use a opção de linha de comando -c mac ou use os comandos mac2unix ou unix2mac.

MODOS DE CONVERSÃO

ascii

No modo ascii, apenas as quebras de linha são convertidas. Esse é o modo de conversão padrão.

Apesar do nome deste modo ser ASCII, o qual é um padrão de 7 bits, o modo é em verdade 8 bits. Sempre use este modo quando quiser converter arquivos Unicode UTF-8.

7bit

Neste modo todos os caracteres não-ASCII de 8 bits (com valores entre 128 e 255) são convertidos para um espaço de 7 bits.

iso

Caracteres são convertidos entre um conjunto de caracteres do DOS (página de código) e conjunto de caracteres ISO-8859-1 (Latin-1) no Unix. Caracteres de DOS sem um equivalente ISO-8859-1, para os quais a conversão não é possível, são convertidos para um ponto. O mesmo vale para caracteres ISO-8859-1 sem a contraparte DOS.

Quando apenas a opção -iso for usada, dos2unix vai tentar determinar a página de código ativa. Quando isso não for possível, dos2unix vai usar a página de código padrão CP437, a qual é usada principalmente nos EUA. Para forçar uma página de código específica, use as opções -437 (EUA), -850 (Europeu oriental), -860 (Português), -863 (Franco-canadense) ou -865 (Nórdico). Também há suporte à página de código do Windows CP1252 (Europeu ocidental) com a opção -1252. Para outras páginas de código, use dos2unix em combinação cm iconv(1). Iconv pode converter entre uma lista grande de codificações de caracteres.

Nunca use conversão ISO em arquivos textos Unicode. Isso vai corromper os arquivos codificados em UTF-8.

Alguns exemplos:

Conversão da página de código padrão do DOS para Latin-1 do Unix:

    dos2unix -iso -n entrada.txt saída.txt

Conversão da CP850 do DOS para Latin-1 do Unix:

    dos2unix -850 -n entrada.txt saída.txt

Conversão da CP1252 do Windows para Latin-1 do Unix:

    dos2unix -1252 -n entrada.txt saída.txt

Conversão da CP1252 do Windows para UTF-8 (Unicode) do Unix:

    iconv -f CP1252 -t UTF-8 entrada.txt | dos2unix > saída.txt

Conversão de Latin-1 do Unix para página de código padrão do DOS:

    unix2dos -iso -n entrada.txt saída.txt

Conversão do Latin-1 do Unix para CP850 do DOS:

    unix2dos -850 -n entrada.txt saída.txt

Conversão do Latin-1 do unix para CP1252 do Windows:

    unix2dos -1252 -n entrada.txt saída.txt

Conversão do UTF-8 (Unicode) do Unix para CP1252 do Windows:

    unix2dos < entrada.txt | iconv -f UTF-8 -t CP1252 > saída.txt

Veja também http://czyborra.com/charsets/codepages.html e http://czyborra.com/charsets/iso8859.html.

UNICODE

Codificações

Exitem codificações Unicode diferentes. No Unix e no Linux, arquivos Unicode são geralmente codificados em UTF-8. No Windows, arquivos texto Unicode podem ser codificados em UTF-8, UTF-16 ou UTF-16 big endian, mas na maioria das vezes são codificados no formato UTF-16.

Conversão

Arquivos texto em Unicode pode ter quebras de linha DOS, Unix ou Mac, como arquivos texto comuns.

Todas as versões do dos2unix e unix2dos podem converter arquivos codificados em UTF-8 porque UTF-8 foi projetado para ter compatibilidade reversa com ASCII.

Dos2unix e unix2dos com suporte a Unicode UTF-16 podem ler arquivos texto codificados em little e big endian UTF-16. Para ver se dos2unix foi compilado com suporte a UTF-16, digite dos2unix -V.

No Unix/Linux, arquivos codificados em UTF-16 são convertidos para a codificação de caracteres do localização. Use o comando locale(1) para descobrir qual é a codificação de caracteres da localização. Quando a conversão não for possível, ocorrerá um erro e o arquivo será ignorado.

No Windows, arquivos UTF-16 são convertidos, por padrão, para UTF-8. Arquivos texto formatados em UTF-8 possuem ótimo suporte em ambos Windows e Unix/Linux.

Codificações UTF-16 e UTF-8 são completamente compatíveis, não havendo qualquer perda de texto na conversão. Quando um erro de conversão UTF-16 para UTF-8 ocorre, por exemplo quando o arquivo de entrada UTF-16 contém um erro, o arquivo será ignorado.

Quando a opção -u é usada, o arquivo de saída será escrito na mesma codificação UTF-16 que o arquivo de saída. A opção -u evita conversão para UTF-8.

Dos2unix e unix2dos não possuem opção para converter arquivos UTF-8 para UTF-16.

Modo de conversão ISO e 7 bits não funcionam em arquivos UTF-16.

Marca de ordem de byte

No Windows, arquivos Unicode normalmente têm uma Marca de Ordem de Byte (BOM), porque muitos programas (incluindo o Bloco de Notas) adiciona BOMs por padrão. Veja também http://en.wikipedia.org/wiki/Byte_order_mark.

No Unix, arquivos Unicode normalmente não têm BOM. Presume-se que arquivos texto são codificados na codificação de caracteres da localização.

Dos2unix pode detectar apenas se um arquivo está no formato UTF-16 se o arquivo tiver BOM. Quando um arquivo UTF-16 não tiver BOM, dos2unix vai ver se o arquivo é um arquivo binário.

Use a opção -ul ou -ub para converter um arquivo UTF-16 sem BOM.

Dos2unix escreve por padrão nenhum BOM no arquivo de saída. Com a opção -b, o Dos2unix escreve um BOM quando o arquivo de entrada possuir BOM.

Unix2dos escreve por padrão um BOM no arquivo de saída quando o arquivo de entrada tem BOM. Use a opção -m para remover BOM.

Dos2unix e unix2dos sempre escrevem BOM quando a opção -m é usada.

Nomes de arquivos Unicode no Windows

Dos2unix possui um suporte opcional para leitura e escrita de nomes de arquivos Unicode no Prompt de Comando Windows. Isso significa que dos2unix pode abrir arquivos que possuam caracteres no nome que não são parte da página de código ANSI padrão do sistema. Para ver ser dosunix para Windows foi compilado com suporte a nomes de arquivos Unicode, digite dos2unix -V.

Há alguns problemas com a exibição de nomes de arquivos Unicode em um console Windows. Veja a opção -D, --display-enc. Para nomes de arquivos pode ser exibido incorretamente, mas os arquivos serão escritos com o nome correto.

Exemplos de Unicode

Conversão de UTF-16 do Windows (com BOM) para UTF-8 do Unix:

    dos2unix -n entrada.txt saída.txt

Conversão de UTF-16LE do Windows (sem BOM) para UTF-8 do Unix:

    dos2unix -ul -n entrada.txt saída.txt

Conversão de UTF-8 Unix para UTF-8 do Windows com BOM:

    unix2dos -m -n entrada.txt saída.txt

Conversão de UTF-8 do Unix para UTF-16 do Windows:

    unix2dos < entrada.txt | iconv -f UTF-8 -t UTF-16 > saída.txt

GB18030

GB18030 é um padrão governamental chinês. Um subconjunto obrigatório do padrão GB18030 é exigido oficialmente para todos os produtos de software vendidos na China. Veja também http://en.wikipedia.org/wiki/GB_18030.

GB18030 é completamente compatível com Unicode e pode ser considerado um formato de transformação de unicode. Assim como UTF-8, GB18030 é compatível com ASCII. GB18030 também é compatível com a página de código 936 do Windows, também conhecida como GBK.

No Unix/Linux, arquivos UTF-16 são convertidos para GB18030 quando a codificação da localização é definida para GB18030. Note que isso vai funcionar apenas se o sistemas oferecer suporte à localização. Use o comando locale -a para obter a lista de localizações às quais há suporte.

No Windows, você precisa usar a opção -gb para converter arquivos UTF-16 para GB18030.

Arquivos codificados em GB18030 possuem uma marca de ordem de bytes, como arquivos Unicode.

EXEMPLOS

Lê a entrada da "stdin" e escreve a saída para "stdout":

    dos2unix < a.txt
    cat a.txt | dos2unix

Converte e substitui a.txt. Converte e substitui b.txt:

    dos2unix a.txt b.txt
    dos2unix -o a.txt b.txt

Converte e substitui a.txt no modo de conversão ascii:

    dos2unix a.txt

Converte e substitui a.txt no modo de conversão ascii. Converte e substitui b.txt no modo de conversão 7bit:

    dos2unix a.txt -c 7bit b.txt
    dos2unix -c ascii a.txt -c 7bit b.txt
    dos2unix -ascii a.txt -7 b.txt

Converte a.txt do formato do Mac para Unix:

    dos2unix -c mac a.txt
    mac2unix a.txt

Converte a.txt do formato do Unix para Mac:

    unix2dos -c mac a.txt
    unix2mac a.txt

Converte e substitui a.txt enquanto mantém a marca de data original:

    dos2unix -k a.txt
    dos2unix -k -o a.txt

Converte a.txt e escreve para e.txt:

    dos2unix -n a.txt e.txt

Converte a.txt e escreve para e.txt, mantém a marca de data de e.txt igual a a.txt:

    dos2unix -k -n a.txt e.txt

Converte e substitui a.txt. Converte b.txt e escreve para e.txt:

    dos2unix a.txt -n b.txt e.txt
    dos2unix -o a.txt -n b.txt e.txt

Converte c.txt e escreve para e.txt. Converte e substitui a.txt. Converte e substitui b.txt. Converte d.txt e escreve para f.txt:

    dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt

CONVERSÃO RECURSIVA

Use dos2unix em combinação com os comandos find(1) e xargs(1) para converter recursivamente arquivos texto em uma estrutura de árvore de diretórios. Por exemplo, para converter todos os arquivos .txt na árvore de diretórios sob o diretório atual, digite:

    find . -name '*.txt' |xargs dos2unix

Em um Prompt de Comando do Windows o seguinte comando pode ser usado:

    for /R %G in (*.txt) do dos2unix "%G"

Usuários do PowerShell podem usar o seguinte comando no Windows PowerShell:

    get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}

LOCALIZAÇÃO

LANG

O idioma primário é selecionado com a variável de ambiente LANG. A variável LANG consiste em várias partes. A primeira parte está em letras pequenas no código do idioma. A segunda parte é opcional e é o código do país em letras maiúsculo, precedido de um ponto. Alguns exemplos para shells do tipo padrão POSIX:

    export LANG=nl               Holandês
    export LANG=nl_NL            Holandês, Holanda
    export LANG=nl_BE            Holandês, Bélgica
    export LANG=es_ES            Espanhol, Espanha
    export LANG=es_MX            Espanhol, México
    export LANG=en_US.iso88591   Inglês, EUA, codificação Latin-1
    export LANG=en_GB.UTF-8      Inglês, Reino Unido, codificação UTF-8

Para a lista completa de códigos de idioma e país, veja o manual do gettext: http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

Nos sistemas Unix, você pode usar o comando locale(1) para obter informação específica da localização.

LANGUAGE

Com a variável de ambiente LANGUAGE, você pode especificar uma lista de prioridades de idiomas, separada por vírgulas. Dos2unix fornece preferência à LANGUAGE sobre LANG. Por exemplo, primeiro holandês e, então, alemão: LANGUAGE=nl:de. Você primeiro tem que habilitar localização, definindo LANG (ou LC_ALL) para um valor diferente de "C", antes que você possa usar uma lista de prioridade de idioma por meio da variável LANGUAGE. Veja também o manual do gettext: http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

Se você selecionou um idioma que não está disponível, você vai terá as mensagens em inglês (padrão).

DOS2UNIX_LOCALEDIR

Com a variável de ambiente DOS2UNIX_LOCALEDIR, o LOCALEDIR definido durante a compilação pode ser sobrescrito. LOCALEDIR é usada para localizar os arquivos de idioma. O valor padrão do GNU é /usr/local/share/locale. A opção --version vai exibir o LOCALEDIR que é usado.

Exemplo (shell POSIX):

    export DOS2UNIX_LOCALEDIR=$HOME/share/locale

VALOR RETORNADO

No sucesso, zero é retornado. Quando um erro de sistema ocorre, o último erro de sistema será retornado. Para outros erros, 1 é retornado.

O valor retornado é sempre zero no modo quieto, exceto quando opções de linha de comando erradas são usadas.

PADRÕES

http://en.wikipedia.org/wiki/Text_file

http://en.wikipedia.org/wiki/Carriage_return

http://en.wikipedia.org/wiki/Newline

http://en.wikipedia.org/wiki/Unicode

AUTORES

Benjamin Lin - <blin@socs.uts.edu.au> Bernd Johannes Wuebben (modo mac2unix) - <wuebben@kde.org>, Christian Wurll (adiciona nova linha extra) - <wurll@ira.uka.de>, Erwin Waterlander - <waterlan@xs4all.nl> (mantenedor)

Página do projeto: http://waterlan.home.xs4all.nl/dos2unix.html

Página do SourceForge: http://sourceforge.net/projects/dos2unix/

Veja também

file(1) find(1) iconv(1) locale(1) xargs(1)

dos2unix-7.3.4/man/pt_BR/man1/dos2unix.pod0000644000175500010010000006656212721132561017462 0ustar waterlanGeen ***************************************************** * GENERATED FILE, DO NOT EDIT * * THIS IS NO SOURCE FILE, BUT RESULT OF COMPILATION * ***************************************************** This file was generated by po4a(7). Do not store it (in VCS, for example), but store the PO file used as source file by po4a-translate. In fact, consider this as a binary, and the PO file as a regular .c file: If the PO get lost, keeping this translation up-to-date will be harder. =pod =encoding UTF-8 =head1 NOME dos2unix - Conversor de formato de arquivo texto de DOS/Mac para Unix e vice-versa =head1 SINOPSE dos2unix [opções] [ARQUIVO ...] [-n ARQENT ARQSAÍDA ...] unix2dos [opções] [ARQUIVO ...] [-n ARQENT ARQSAÍDA ...] =head1 DESCRIÇÃO O pacote Dos2unix inclui utilitários de C e C para converter arquivos texto nos formatos DOS ou Mac para formato Unix e vice-versa. Em arquivos texto DOS/Windows uma quebra de linha, também conhecida como nova linha, é uma combinação de dois caracteres: um Carriage Return (CR) seguido por um Line Feed (LF). Em arquivos texto do Unix uma quebra de linha é um único caractere: o Line Feed (LF). Em arquivos texto do Mac, anteriores ao Mac OS X, uma quebra de linha era um único caractere Carriage Return (CR). Hoje em dia, Mac OS usa quebras de linha no estilo do Unix (LF). Além das quebras de linhas, Dos2unix também pode converter as codificações de arquivos. Algumas poucas páginas podem ser convertidos para Latin-1 para Unix. E arquivos Unicode do Windows (UTF-16) podem ser convertidos para arquivos Unicode do Unix (UTF-8). Arquivos binários são ignorados automaticamente, a menos que a conversão seja forçada. Arquivos não regulares, tais como diretórios e FIFOs, são ignorados automaticamente. Ligações simbólicas e seus alvos são por padrão mantidas intocáveis. Ligações simbólicas podem opcionalmente ser substituídas, ou a saída pode ser escrita para o alvo das ligações simbólicas. Não há suporte às ligações simbólicas do Windows. Dos2unix foi modelado seguindo dos2unix do SunOS/Solaris. Há uma diferença importante em relação à versão original do SunOS/Solaris. Essa versão faz conversão no-lugar (modo arquivo antigo) por padrão, enquanto a versão original do SunOS/Solaris fornecia suporte apenas a conversão pareada (modo de novo arquivo). Veja também as opções C<-o> e C<-n>. Uma outra diferença é que a versão SunOS/Solaris usa, por padrão, a conversão de modo do I enquanto esta versão usa o do I. =head1 OPÇÕES =over 4 =item B<--> Trata as opções seguintes como nomes de arquivos. Use essa opção se você quiser converter arquivos cujos nomes iniciam com um traço. Por exemplo, para converter um arquivo chamado "foo", você pode usar este comando: dos2unix -- -foo Ou em modo de novo arquivo: dos2unix -n -- -foo saída.txt =item B<-ascii> Converte apenas as quebras de linhas. Esse é o modo de conversão padrão. =item B<-iso> Conversão entre conjunto de caractere do DOS e ISO-8859-1. Veja também a seção MODOS DE CONVERSÃO. =item B<-1252> Usa a página de código 1252 do Windows (Europa ocidental). =item B<-437> Usa a página de código 437 do DOS (EUA). Essa é a página de código padrão usada para conversão ISO. =item B<-850> Usa a página de código 850 do DOS (Europa ocidental). =item B<-860> Usa a página de código 860 do DOS (Português). =item B<-863> Usa a página de código 863 do DOS (Francês do Canadá). =item B<-865> Usa a página de código 865 do DOS (Nórdico). =item B<-7> Converte caracteres de 8 bits para espaço de 7 bits. =item B<-b, --keep-bom> Mantém marca de ordem de bytes (BOM). Quando o arquivo de entrada possuir um BOM, escreve um BOM no arquivo de saída. Esse é o comportamento padrão ao converter para quebras de linha do DOS. Veja também a opção C<-r>. =item B<-c, --convmode MODOCONV> Define o modo de conversão, sendo MODOCONV um dentre: I, I<7bit>, I, I com ascii sendo o padrão. =item B<-D, --display-enc CODIFICAÇÃO> Define a codificação do texto exibido, sendo CODIFICAÇÃO um dentre: I, I, I, I com ansi sendo o padrão. Essa opção está disponível apenas no dos2unix para Windows com suporte a nome de arquivo em Unicode. Essa opção não possui efeito nos nomes de arquivos lidos e escritos, apenas em como eles são exibidos. Há vários métodos para exibir texto em um console Windows baseado na codificação do texto. Todos eles possuem suas próprias vantagens e desvantagens. =over 4 =item B O método padrão do dos2unix é usar o texto codificado em ANSI. A sua vantagem é a compatibilidade reversa. Ele funciona com fontes raster e TrueType. Em algumas regiões você pode precisar alterar a página de código OEM do DOS para ANSI do sistema Windows usando o comando C, porque dos2unix usa a página de código do sistema Windows. A desvantagem do ansi é que nomes de arquivos internacionais com caracteres fora a página de código padrão do sistema não são exibidos apropriadamente. Você verá um sinal de interrogação, ou um símbolo incorreto. Quando você não utiliza nomes de arquivos estrangeiros, esse método funciona bem. =item B A vantagem da codificação do unicode (o nome Windows para UTF-16) é que o texto é normalmente exibido apropriadamente. Não há necessidade para alterar a página de código ativa. Você pode precisar definir a fonte do console para uma fonte TrueType para que caracteres internacionais sejam exibidos apropriadamente. Quando um caractere não está incluído na fonte TrueType, geralmente você vê um pequeno quadrado, algumas vezes com um sinal de interrogação nele. Quando você usa o console ConEmu todo texto é exibido apropriadamente, porque o ConEmu seleciona automaticamente um fonte boa. A desvantagem do unicode é que ele não é compatível com ASCII. A saída não é fácil de lidar quando você o redireciona para um outro programa. Quando o método é usado, o texto Unicode será precedido com um BOM (Byte Order Mark, ou marca de ordem de byte). Um BOM é necessário para o redirecionamento, ou "piping", correto no PowerShell. =item B A vantagem do utf8 é que ele é compatível com ASCII. Você precisa definir a fonte do console para uma fonte TrueType. Com uma fonte TrueType, o texto é exibido similar a uma codificação C. A desvantagem é que quando você usa a fonte "raster" padrão, caracteres não-ASCII são exibidos incorretamente. Não apenas nomes de arquivos unicode, mas também mensagens traduzidas ficam ilegíveis. No Windows configurado para uma região leste da Ásia, você pode ver muitas falhas no console quando as mensagens são exibidas. Em um console ConEmu, o método de codificação utf8 funciona bem. Quando o método é usado, o texto UTF-8 será precedido com um BOM (Byte Order Mark, ou marca de ordem de byte). Um BOM é necessário para o redirecionamento, ou "piping", correto no PowerShell. =back A codificação padrão pode ser alterada com a variável de ambiente DOS2UNIX_DISPLAY_ENC definindo-a para C, C, C ou C. =item B<-f, --force> Força a conversão de arquivos binários. =item B<-gb, --gb18030> No Windows, arquivos UTF-16 são convertidos, por padrão, para UTF-8, independentemente da localização definida. Use esta opção para converter arquivos UTF-16 para GB18030. Essa opção está disponível apenas no Windows. Veja também a seção GB18030. =item B<-h, --help> Exibe ajuda e sai. =item B<-i[OPÇÕES], --info[=OPÇÕES] ARQUIVO ...> Exibe informação do arquivo. Nenhuma conversão é feita. A seguinte informação é exibida, nesta ordem: número de quebras de linha do DOS, número de quebras de linha do Unix, número de quebras de linha do Mac, marca de ordem de byte, "text" ou "binary", nome de arquivo. Exemplo de saída: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Note que em algumas vezes um arquivo binário pode ser confundido com um arquivo texto. Veja também a opção C<-s>. Opcionalmente, opções extra podem ser definidas para alterar a saída. Uma ou mais opções podem ser adicionadas. =over 4 =item B Exibe o número de quebras de linhas do DOS. =item B Exibe o número de quebras de linhas do Unix. =item B Exibe o número de quebras de linhas do Mac. =item B Exibe a marca de ordem de byte. =item B Exibe se arquivo é texto ou binário. =item B Exibe apenas os arquivos que seriam convertidos. Com a opção C, dos2unix vai exibir apenas os arquivos que contêm quebras de linha do DOS, unix2dos vai exibir apenas os nomes de arquivos que contêm quebras de linha do Unix. =item B Exibe um cabeçalho. =item B

Mostra nomes de arquivos sem caminho. =back Exemplos: Mostra informação sobre todos os arquivos *.txt: dos2unix -i *.txt Mostra apenas o número de quebras de linha DOS e Unix: dos2unix -idu *.txt Mostra apenas a marca de ordem de byte: dos2unix --info=b *.txt Lista os arquivos que possuem quebras de linha do DOS: dos2unix -ic *.txt Lista os arquivos que possuem quebras de linha do Unix: unix2dos -ic *.txt Converte apenas arquivos que possuem quebras de linha do DOS e não altera outros arquivos: dos2unix -ic *.txt | xargs dos2unix Localiza arquivos de texto que possuam quebras de linha do DOS: find -name '*.txt' | xargs dos2unix -ic =item B<-k, --keepdate> Mantém a marca da data do arquivo de saída igual ao do arquivo de entrada. =item B<-L, --license> Exibe a licença do programa. =item B<-l, --newline> Adiciona nova linha adicional. B: Apenas quebras de linha do DOS são alteradas para duas quebras de linha do Unix. No modo Mac, apenas quebras de linha do Mac são alterados para duas quebras de linha do Unix. B: Apenas quebras de linha do Unix são alteradas para duas quebras de linha do DOS. No modo Mac, quebras de linha do Unix são alteradas para duas quebras de linha do Mac. =item B<-m, --add-bom> Escreve uma marca de ordem de byte (BOM) no arquivo de saída. Por padrão, um BOM UTF-8 é escrito. Quando o arquivo de entrada é UTF-16, e a opção C<-u> é usada, um BOM UTF-16 será escrito. Nunca use essa opção quando a codificação de saída é outra além de UTF-8, UTF-16 ou GB18030. Veja também a seção UNICODE. =item B<-n, --newfile ARQENT ARQSAÍDA ...> Modo de novo arquivo. Converte o arquivo ARQENT e escreve a saída para o arquivo ARQSAÍDA. Os nomes de arquivos devem ser fornecidos em pares e nome coringa I deveriam ser usados ou você I perder seus arquivos. A pessoa que começa a conversão em modo novo arquivo (pareado) será o dono do arquivo convertido. As permissões de leitura/escrita do novo arquivo serão as permissões do arquivo original menos a umask(1) da pessoa que executa a conversão. =item B<-o, --oldfile ARQUIVO ...> Modo arquivo antigo. Converte o arquivo ARQUIVO e o sobrescreve com a saída. O programa, por padrão, executa neste modo. Nomes coringas podem ser usados. No modo de arquivo antigo (no-lugar) o arquivo convertido recebe no mesmo dono, grupo e permissões de leitura/escrita que o arquivo original. Também, quando o arquivo é convertido por outro usuário que tenha permissões de escrita no arquivo (ex.: usuário root). A conversão será abortada quando não for possível preservar os valores originais. Alteração do dono pode significar que o dono original não é mais capaz de ler o arquivo. Alteração do grupo pode ser um risco para a segurança, pois o arquivo pode ficar legível para pessoas cujo acesso não é desejado. Preservação do dono, grupo e permissões de leitura/escrita tem suporte apenas no Unix. =item B<-q, --quiet> Modo quieto. Suprime todos os avios e mensagens. O valor retornado é zero. Exceto quando opções de linha de comando erradas forem usadas. =item B<-r, --remove-bom> remove marca de ordem de bytes (BOM). Não escreve um BOM no arquivo de saída. Esse é o comportamento padrão ao converter para quebras de linha Unix. Veja também a opção C<-b>. =item B<-s, --safe> Ignora arquivo binários (padrão). A ação de ignorar arquivos binários é feita para evitar equívocos acidentais. Fique ciente de que a detecção de arquivos binários não é 100% à prova de erros. Arquivos de entrada são analisados por símbolos binários que, geralmente, não são encontrados em arquivos textos. É possível que um arquivo binário contenha apenas caracteres de texto normais. tal arquivo binário pode ser acidentalmente visto como um arquivo de texto. =item B<-u, --keep-utf16> Mantém a codificação UTF-16 original do arquivo de entrada. O arquivo de saída será escrito na mesma codificação UTF-16, em little ou big endian, como o arquivo de entrada. Isso evita transformação para UTF-8. Como consequência, um BOM UTF-16 será escrito. Essa opção pode ser desabilitada com a opção C<-ascii>. =item B<-ul, --assume-utf16le> Presume que o formato de arquivo de entrada é UTF-16LE. Quando há uma marca de ordem de byte no arquivo de entrada, esta tem prioridade sobre essa opção. Quando você fizer uma presunção equivocada (o arquivo de entrada não estava no formato UTF-16LE) e a conversão funcionar, você terá um arquivo de saída UTF-8 com texto errado. Você pode desfazer a conversão errada com iconv(1) pela conversão do arquivo de saída UTF-8 de volta para UTF-16LE. Isso vai trazer de volta o arquivo para o original. A presunção de UTF-16LE funciona como um I. Ao alternara o modo I padrão, a presunção de UTF-16LE é desativada. =item B<-ub, --assume-utf16be> Presume que o formato de arquivo de entrada é UTF-16BE. Essa opção funciona o mesmo que a opção C<-ul>. =item B<-v, --verbose> Exibe mensagens detalhadas. Informação extra é exibida sobre marcas de ordem de byte e a quantidade de quebras de linha convertidas. =item B<-F, --follow-symlink> Segue ligações simbólicas e converte os alvos. =item B<-R, --replace-symlink> Substitui ligações simbólicas com arquivos convertidos (arquivos alvo originais permanecem inalterados). =item B<-S, --skip-symlink> Mentém ligações simbólicas e alvos inalterados (padrão). =item B<-V, --version> Exibe informação da versão e sai. =back =head1 MODO MAC No modo normal, as quebras de linhas são convertidas de DOS para Unix e vice-versa. Quebras de linha do Mac não são convertidas. No modo Mac, quebras de linha são convertidas de Mac para Unix e vice-versa. Quebras de linha do DOS não são alteradas. Para executar no modo Mac, use a opção de linha de comando C<-c mac> ou use os comandos C ou C. =head1 MODOS DE CONVERSÃO =over 4 =item B No modo C, apenas as quebras de linha são convertidas. Esse é o modo de conversão padrão. Apesar do nome deste modo ser ASCII, o qual é um padrão de 7 bits, o modo é em verdade 8 bits. Sempre use este modo quando quiser converter arquivos Unicode UTF-8. =item B<7bit> Neste modo todos os caracteres não-ASCII de 8 bits (com valores entre 128 e 255) são convertidos para um espaço de 7 bits. =item B Caracteres são convertidos entre um conjunto de caracteres do DOS (página de código) e conjunto de caracteres ISO-8859-1 (Latin-1) no Unix. Caracteres de DOS sem um equivalente ISO-8859-1, para os quais a conversão não é possível, são convertidos para um ponto. O mesmo vale para caracteres ISO-8859-1 sem a contraparte DOS. Quando apenas a opção C<-iso> for usada, dos2unix vai tentar determinar a página de código ativa. Quando isso não for possível, dos2unix vai usar a página de código padrão CP437, a qual é usada principalmente nos EUA. Para forçar uma página de código específica, use as opções C<-437> (EUA), C<-850> (Europeu oriental), C<-860> (Português), C<-863> (Franco-canadense) ou C<-865> (Nórdico). Também há suporte à página de código do Windows CP1252 (Europeu ocidental) com a opção C<-1252>. Para outras páginas de código, use dos2unix em combinação cm iconv(1). Iconv pode converter entre uma lista grande de codificações de caracteres. Nunca use conversão ISO em arquivos textos Unicode. Isso vai corromper os arquivos codificados em UTF-8. Alguns exemplos: Conversão da página de código padrão do DOS para Latin-1 do Unix: dos2unix -iso -n entrada.txt saída.txt Conversão da CP850 do DOS para Latin-1 do Unix: dos2unix -850 -n entrada.txt saída.txt Conversão da CP1252 do Windows para Latin-1 do Unix: dos2unix -1252 -n entrada.txt saída.txt Conversão da CP1252 do Windows para UTF-8 (Unicode) do Unix: iconv -f CP1252 -t UTF-8 entrada.txt | dos2unix > saída.txt Conversão de Latin-1 do Unix para página de código padrão do DOS: unix2dos -iso -n entrada.txt saída.txt Conversão do Latin-1 do Unix para CP850 do DOS: unix2dos -850 -n entrada.txt saída.txt Conversão do Latin-1 do unix para CP1252 do Windows: unix2dos -1252 -n entrada.txt saída.txt Conversão do UTF-8 (Unicode) do Unix para CP1252 do Windows: unix2dos < entrada.txt | iconv -f UTF-8 -t CP1252 > saída.txt Veja também L e L. =back =head1 UNICODE =head2 Codificações Exitem codificações Unicode diferentes. No Unix e no Linux, arquivos Unicode são geralmente codificados em UTF-8. No Windows, arquivos texto Unicode podem ser codificados em UTF-8, UTF-16 ou UTF-16 big endian, mas na maioria das vezes são codificados no formato UTF-16. =head2 Conversão Arquivos texto em Unicode pode ter quebras de linha DOS, Unix ou Mac, como arquivos texto comuns. Todas as versões do dos2unix e unix2dos podem converter arquivos codificados em UTF-8 porque UTF-8 foi projetado para ter compatibilidade reversa com ASCII. Dos2unix e unix2dos com suporte a Unicode UTF-16 podem ler arquivos texto codificados em little e big endian UTF-16. Para ver se dos2unix foi compilado com suporte a UTF-16, digite C. No Unix/Linux, arquivos codificados em UTF-16 são convertidos para a codificação de caracteres do localização. Use o comando locale(1) para descobrir qual é a codificação de caracteres da localização. Quando a conversão não for possível, ocorrerá um erro e o arquivo será ignorado. No Windows, arquivos UTF-16 são convertidos, por padrão, para UTF-8. Arquivos texto formatados em UTF-8 possuem ótimo suporte em ambos Windows e Unix/Linux. Codificações UTF-16 e UTF-8 são completamente compatíveis, não havendo qualquer perda de texto na conversão. Quando um erro de conversão UTF-16 para UTF-8 ocorre, por exemplo quando o arquivo de entrada UTF-16 contém um erro, o arquivo será ignorado. Quando a opção C<-u> é usada, o arquivo de saída será escrito na mesma codificação UTF-16 que o arquivo de saída. A opção C<-u> evita conversão para UTF-8. Dos2unix e unix2dos não possuem opção para converter arquivos UTF-8 para UTF-16. Modo de conversão ISO e 7 bits não funcionam em arquivos UTF-16. =head2 Marca de ordem de byte No Windows, arquivos Unicode normalmente têm uma Marca de Ordem de Byte (BOM), porque muitos programas (incluindo o Bloco de Notas) adiciona BOMs por padrão. Veja também L. No Unix, arquivos Unicode normalmente não têm BOM. Presume-se que arquivos texto são codificados na codificação de caracteres da localização. Dos2unix pode detectar apenas se um arquivo está no formato UTF-16 se o arquivo tiver BOM. Quando um arquivo UTF-16 não tiver BOM, dos2unix vai ver se o arquivo é um arquivo binário. Use a opção C<-ul> ou C<-ub> para converter um arquivo UTF-16 sem BOM. Dos2unix escreve por padrão nenhum BOM no arquivo de saída. Com a opção C<-b>, o Dos2unix escreve um BOM quando o arquivo de entrada possuir BOM. Unix2dos escreve por padrão um BOM no arquivo de saída quando o arquivo de entrada tem BOM. Use a opção C<-m> para remover BOM. Dos2unix e unix2dos sempre escrevem BOM quando a opção C<-m> é usada. =head2 Nomes de arquivos Unicode no Windows Dos2unix possui um suporte opcional para leitura e escrita de nomes de arquivos Unicode no Prompt de Comando Windows. Isso significa que dos2unix pode abrir arquivos que possuam caracteres no nome que não são parte da página de código ANSI padrão do sistema. Para ver ser dosunix para Windows foi compilado com suporte a nomes de arquivos Unicode, digite C. Há alguns problemas com a exibição de nomes de arquivos Unicode em um console Windows. Veja a opção C<-D>, C<--display-enc>. Para nomes de arquivos pode ser exibido incorretamente, mas os arquivos serão escritos com o nome correto. =head2 Exemplos de Unicode Conversão de UTF-16 do Windows (com BOM) para UTF-8 do Unix: dos2unix -n entrada.txt saída.txt Conversão de UTF-16LE do Windows (sem BOM) para UTF-8 do Unix: dos2unix -ul -n entrada.txt saída.txt Conversão de UTF-8 Unix para UTF-8 do Windows com BOM: unix2dos -m -n entrada.txt saída.txt Conversão de UTF-8 do Unix para UTF-16 do Windows: unix2dos < entrada.txt | iconv -f UTF-8 -t UTF-16 > saída.txt =head1 GB18030 GB18030 é um padrão governamental chinês. Um subconjunto obrigatório do padrão GB18030 é exigido oficialmente para todos os produtos de software vendidos na China. Veja também L. GB18030 é completamente compatível com Unicode e pode ser considerado um formato de transformação de unicode. Assim como UTF-8, GB18030 é compatível com ASCII. GB18030 também é compatível com a página de código 936 do Windows, também conhecida como GBK. No Unix/Linux, arquivos UTF-16 são convertidos para GB18030 quando a codificação da localização é definida para GB18030. Note que isso vai funcionar apenas se o sistemas oferecer suporte à localização. Use o comando C para obter a lista de localizações às quais há suporte. No Windows, você precisa usar a opção C<-gb> para converter arquivos UTF-16 para GB18030. Arquivos codificados em GB18030 possuem uma marca de ordem de bytes, como arquivos Unicode. =head1 EXEMPLOS Lê a entrada da "stdin" e escreve a saída para "stdout": dos2unix < a.txt cat a.txt | dos2unix Converte e substitui a.txt. Converte e substitui b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Converte e substitui a.txt no modo de conversão ascii: dos2unix a.txt Converte e substitui a.txt no modo de conversão ascii. Converte e substitui b.txt no modo de conversão 7bit: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Converte a.txt do formato do Mac para Unix: dos2unix -c mac a.txt mac2unix a.txt Converte a.txt do formato do Unix para Mac: unix2dos -c mac a.txt unix2mac a.txt Converte e substitui a.txt enquanto mantém a marca de data original: dos2unix -k a.txt dos2unix -k -o a.txt Converte a.txt e escreve para e.txt: dos2unix -n a.txt e.txt Converte a.txt e escreve para e.txt, mantém a marca de data de e.txt igual a a.txt: dos2unix -k -n a.txt e.txt Converte e substitui a.txt. Converte b.txt e escreve para e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Converte c.txt e escreve para e.txt. Converte e substitui a.txt. Converte e substitui b.txt. Converte d.txt e escreve para f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 CONVERSÃO RECURSIVA Use dos2unix em combinação com os comandos find(1) e xargs(1) para converter recursivamente arquivos texto em uma estrutura de árvore de diretórios. Por exemplo, para converter todos os arquivos .txt na árvore de diretórios sob o diretório atual, digite: find . -name '*.txt' |xargs dos2unix Em um Prompt de Comando do Windows o seguinte comando pode ser usado: for /R %G in (*.txt) do dos2unix "%G" Usuários do PowerShell podem usar o seguinte comando no Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} =head1 LOCALIZAÇÃO =over 4 =item B O idioma primário é selecionado com a variável de ambiente LANG. A variável LANG consiste em várias partes. A primeira parte está em letras pequenas no código do idioma. A segunda parte é opcional e é o código do país em letras maiúsculo, precedido de um ponto. Alguns exemplos para shells do tipo padrão POSIX: export LANG=nl Holandês export LANG=nl_NL Holandês, Holanda export LANG=nl_BE Holandês, Bélgica export LANG=es_ES Espanhol, Espanha export LANG=es_MX Espanhol, México export LANG=en_US.iso88591 Inglês, EUA, codificação Latin-1 export LANG=en_GB.UTF-8 Inglês, Reino Unido, codificação UTF-8 Para a lista completa de códigos de idioma e país, veja o manual do gettext: L Nos sistemas Unix, você pode usar o comando locale(1) para obter informação específica da localização. =item B Com a variável de ambiente LANGUAGE, você pode especificar uma lista de prioridades de idiomas, separada por vírgulas. Dos2unix fornece preferência à LANGUAGE sobre LANG. Por exemplo, primeiro holandês e, então, alemão: C. Você primeiro tem que habilitar localização, definindo LANG (ou LC_ALL) para um valor diferente de "C", antes que você possa usar uma lista de prioridade de idioma por meio da variável LANGUAGE. Veja também o manual do gettext: L Se você selecionou um idioma que não está disponível, você vai terá as mensagens em inglês (padrão). =item B Com a variável de ambiente DOS2UNIX_LOCALEDIR, o LOCALEDIR definido durante a compilação pode ser sobrescrito. LOCALEDIR é usada para localizar os arquivos de idioma. O valor padrão do GNU é C. A opção B<--version> vai exibir o LOCALEDIR que é usado. Exemplo (shell POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 VALOR RETORNADO No sucesso, zero é retornado. Quando um erro de sistema ocorre, o último erro de sistema será retornado. Para outros erros, 1 é retornado. O valor retornado é sempre zero no modo quieto, exceto quando opções de linha de comando erradas são usadas. =head1 PADRÕES L L L L =head1 AUTORES Benjamin Lin - Bernd Johannes Wuebben (modo mac2unix) - , Christian Wurll (adiciona nova linha extra) - , Erwin Waterlander - (mantenedor) Página do projeto: L Página do SourceForge: L =head1 Veja também file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/pt_BR/man1/dos2unix.txt0000644000175500010010000007243112721132570017507 0ustar waterlanGeenNOME dos2unix - Conversor de formato de arquivo texto de DOS/Mac para Unix e vice-versa SINOPSE dos2unix [opções] [ARQUIVO ...] [-n ARQENT ARQSAÍDA ...] unix2dos [opções] [ARQUIVO ...] [-n ARQENT ARQSAÍDA ...] DESCRIÇÃO O pacote Dos2unix inclui utilitários de "dos2unix" e "unix2dos" para converter arquivos texto nos formatos DOS ou Mac para formato Unix e vice-versa. Em arquivos texto DOS/Windows uma quebra de linha, também conhecida como nova linha, é uma combinação de dois caracteres: um Carriage Return (CR) seguido por um Line Feed (LF). Em arquivos texto do Unix uma quebra de linha é um único caractere: o Line Feed (LF). Em arquivos texto do Mac, anteriores ao Mac OS X, uma quebra de linha era um único caractere Carriage Return (CR). Hoje em dia, Mac OS usa quebras de linha no estilo do Unix (LF). Além das quebras de linhas, Dos2unix também pode converter as codificações de arquivos. Algumas poucas páginas podem ser convertidos para Latin-1 para Unix. E arquivos Unicode do Windows (UTF-16) podem ser convertidos para arquivos Unicode do Unix (UTF-8). Arquivos binários são ignorados automaticamente, a menos que a conversão seja forçada. Arquivos não regulares, tais como diretórios e FIFOs, são ignorados automaticamente. Ligações simbólicas e seus alvos são por padrão mantidas intocáveis. Ligações simbólicas podem opcionalmente ser substituídas, ou a saída pode ser escrita para o alvo das ligações simbólicas. Não há suporte às ligações simbólicas do Windows. Dos2unix foi modelado seguindo dos2unix do SunOS/Solaris. Há uma diferença importante em relação à versão original do SunOS/Solaris. Essa versão faz conversão no-lugar (modo arquivo antigo) por padrão, enquanto a versão original do SunOS/Solaris fornecia suporte apenas a conversão pareada (modo de novo arquivo). Veja também as opções "-o" e "-n". Uma outra diferença é que a versão SunOS/Solaris usa, por padrão, a conversão de modo do *iso* enquanto esta versão usa o do *ascii*. OPÇÕES -- Trata as opções seguintes como nomes de arquivos. Use essa opção se você quiser converter arquivos cujos nomes iniciam com um traço. Por exemplo, para converter um arquivo chamado "foo", você pode usar este comando: dos2unix -- -foo Ou em modo de novo arquivo: dos2unix -n -- -foo saída.txt -ascii Converte apenas as quebras de linhas. Esse é o modo de conversão padrão. -iso Conversão entre conjunto de caractere do DOS e ISO-8859-1. Veja também a seção MODOS DE CONVERSÃO. -1252 Usa a página de código 1252 do Windows (Europa ocidental). -437 Usa a página de código 437 do DOS (EUA). Essa é a página de código padrão usada para conversão ISO. -850 Usa a página de código 850 do DOS (Europa ocidental). -860 Usa a página de código 860 do DOS (Português). -863 Usa a página de código 863 do DOS (Francês do Canadá). -865 Usa a página de código 865 do DOS (Nórdico). -7 Converte caracteres de 8 bits para espaço de 7 bits. -b, --keep-bom Mantém marca de ordem de bytes (BOM). Quando o arquivo de entrada possuir um BOM, escreve um BOM no arquivo de saída. Esse é o comportamento padrão ao converter para quebras de linha do DOS. Veja também a opção "-r". -c, --convmode MODOCONV Define o modo de conversão, sendo MODOCONV um dentre: *ascii*, *7bit*, *iso*, *mac* com ascii sendo o padrão. -D, --display-enc CODIFICAÇÃO Define a codificação do texto exibido, sendo CODIFICAÇÃO um dentre: *ansi*, *unicode*, *utf8*, *utf8bom* com ansi sendo o padrão. Essa opção está disponível apenas no dos2unix para Windows com suporte a nome de arquivo em Unicode. Essa opção não possui efeito nos nomes de arquivos lidos e escritos, apenas em como eles são exibidos. Há vários métodos para exibir texto em um console Windows baseado na codificação do texto. Todos eles possuem suas próprias vantagens e desvantagens. ansi O método padrão do dos2unix é usar o texto codificado em ANSI. A sua vantagem é a compatibilidade reversa. Ele funciona com fontes raster e TrueType. Em algumas regiões você pode precisar alterar a página de código OEM do DOS para ANSI do sistema Windows usando o comando "chcp", porque dos2unix usa a página de código do sistema Windows. A desvantagem do ansi é que nomes de arquivos internacionais com caracteres fora a página de código padrão do sistema não são exibidos apropriadamente. Você verá um sinal de interrogação, ou um símbolo incorreto. Quando você não utiliza nomes de arquivos estrangeiros, esse método funciona bem. unicode, unicodebom A vantagem da codificação do unicode (o nome Windows para UTF-16) é que o texto é normalmente exibido apropriadamente. Não há necessidade para alterar a página de código ativa. Você pode precisar definir a fonte do console para uma fonte TrueType para que caracteres internacionais sejam exibidos apropriadamente. Quando um caractere não está incluído na fonte TrueType, geralmente você vê um pequeno quadrado, algumas vezes com um sinal de interrogação nele. Quando você usa o console ConEmu todo texto é exibido apropriadamente, porque o ConEmu seleciona automaticamente um fonte boa. A desvantagem do unicode é que ele não é compatível com ASCII. A saída não é fácil de lidar quando você o redireciona para um outro programa. Quando o método é usado, o texto Unicode será precedido com um BOM (Byte Order Mark, ou marca de ordem de byte). Um BOM é necessário para o redirecionamento, ou "piping", correto no PowerShell. utf8, utf8bom A vantagem do utf8 é que ele é compatível com ASCII. Você precisa definir a fonte do console para uma fonte TrueType. Com uma fonte TrueType, o texto é exibido similar a uma codificação "unicode". A desvantagem é que quando você usa a fonte "raster" padrão, caracteres não-ASCII são exibidos incorretamente. Não apenas nomes de arquivos unicode, mas também mensagens traduzidas ficam ilegíveis. No Windows configurado para uma região leste da Ásia, você pode ver muitas falhas no console quando as mensagens são exibidas. Em um console ConEmu, o método de codificação utf8 funciona bem. Quando o método é usado, o texto UTF-8 será precedido com um BOM (Byte Order Mark, ou marca de ordem de byte). Um BOM é necessário para o redirecionamento, ou "piping", correto no PowerShell. A codificação padrão pode ser alterada com a variável de ambiente DOS2UNIX_DISPLAY_ENC definindo-a para "unicode", "unicodebom", "utf8" ou "utf8bom". -f, --force Força a conversão de arquivos binários. -gb, --gb18030 No Windows, arquivos UTF-16 são convertidos, por padrão, para UTF-8, independentemente da localização definida. Use esta opção para converter arquivos UTF-16 para GB18030. Essa opção está disponível apenas no Windows. Veja também a seção GB18030. -h, --help Exibe ajuda e sai. -i[OPÇÕES], --info[=OPÇÕES] ARQUIVO ... Exibe informação do arquivo. Nenhuma conversão é feita. A seguinte informação é exibida, nesta ordem: número de quebras de linha do DOS, número de quebras de linha do Unix, número de quebras de linha do Mac, marca de ordem de byte, "text" ou "binary", nome de arquivo. Exemplo de saída: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Note que em algumas vezes um arquivo binário pode ser confundido com um arquivo texto. Veja também a opção "-s". Opcionalmente, opções extra podem ser definidas para alterar a saída. Uma ou mais opções podem ser adicionadas. d Exibe o número de quebras de linhas do DOS. u Exibe o número de quebras de linhas do Unix. m Exibe o número de quebras de linhas do Mac. b Exibe a marca de ordem de byte. t Exibe se arquivo é texto ou binário. c Exibe apenas os arquivos que seriam convertidos. Com a opção "c", dos2unix vai exibir apenas os arquivos que contêm quebras de linha do DOS, unix2dos vai exibir apenas os nomes de arquivos que contêm quebras de linha do Unix. h Exibe um cabeçalho. p Mostra nomes de arquivos sem caminho. Exemplos: Mostra informação sobre todos os arquivos *.txt: dos2unix -i *.txt Mostra apenas o número de quebras de linha DOS e Unix: dos2unix -idu *.txt Mostra apenas a marca de ordem de byte: dos2unix --info=b *.txt Lista os arquivos que possuem quebras de linha do DOS: dos2unix -ic *.txt Lista os arquivos que possuem quebras de linha do Unix: unix2dos -ic *.txt Converte apenas arquivos que possuem quebras de linha do DOS e não altera outros arquivos: dos2unix -ic *.txt | xargs dos2unix Localiza arquivos de texto que possuam quebras de linha do DOS: find -name '*.txt' | xargs dos2unix -ic -k, --keepdate Mantém a marca da data do arquivo de saída igual ao do arquivo de entrada. -L, --license Exibe a licença do programa. -l, --newline Adiciona nova linha adicional. dos2unix: Apenas quebras de linha do DOS são alteradas para duas quebras de linha do Unix. No modo Mac, apenas quebras de linha do Mac são alterados para duas quebras de linha do Unix. unix2dos: Apenas quebras de linha do Unix são alteradas para duas quebras de linha do DOS. No modo Mac, quebras de linha do Unix são alteradas para duas quebras de linha do Mac. -m, --add-bom Escreve uma marca de ordem de byte (BOM) no arquivo de saída. Por padrão, um BOM UTF-8 é escrito. Quando o arquivo de entrada é UTF-16, e a opção "-u" é usada, um BOM UTF-16 será escrito. Nunca use essa opção quando a codificação de saída é outra além de UTF-8, UTF-16 ou GB18030. Veja também a seção UNICODE. -n, --newfile ARQENT ARQSAÍDA ... Modo de novo arquivo. Converte o arquivo ARQENT e escreve a saída para o arquivo ARQSAÍDA. Os nomes de arquivos devem ser fornecidos em pares e nome coringa *não* deveriam ser usados ou você *vai* perder seus arquivos. A pessoa que começa a conversão em modo novo arquivo (pareado) será o dono do arquivo convertido. As permissões de leitura/escrita do novo arquivo serão as permissões do arquivo original menos a umask(1) da pessoa que executa a conversão. -o, --oldfile ARQUIVO ... Modo arquivo antigo. Converte o arquivo ARQUIVO e o sobrescreve com a saída. O programa, por padrão, executa neste modo. Nomes coringas podem ser usados. No modo de arquivo antigo (no-lugar) o arquivo convertido recebe no mesmo dono, grupo e permissões de leitura/escrita que o arquivo original. Também, quando o arquivo é convertido por outro usuário que tenha permissões de escrita no arquivo (ex.: usuário root). A conversão será abortada quando não for possível preservar os valores originais. Alteração do dono pode significar que o dono original não é mais capaz de ler o arquivo. Alteração do grupo pode ser um risco para a segurança, pois o arquivo pode ficar legível para pessoas cujo acesso não é desejado. Preservação do dono, grupo e permissões de leitura/escrita tem suporte apenas no Unix. -q, --quiet Modo quieto. Suprime todos os avios e mensagens. O valor retornado é zero. Exceto quando opções de linha de comando erradas forem usadas. -r, --remove-bom remove marca de ordem de bytes (BOM). Não escreve um BOM no arquivo de saída. Esse é o comportamento padrão ao converter para quebras de linha Unix. Veja também a opção "-b". -s, --safe Ignora arquivo binários (padrão). A ação de ignorar arquivos binários é feita para evitar equívocos acidentais. Fique ciente de que a detecção de arquivos binários não é 100% à prova de erros. Arquivos de entrada são analisados por símbolos binários que, geralmente, não são encontrados em arquivos textos. É possível que um arquivo binário contenha apenas caracteres de texto normais. tal arquivo binário pode ser acidentalmente visto como um arquivo de texto. -u, --keep-utf16 Mantém a codificação UTF-16 original do arquivo de entrada. O arquivo de saída será escrito na mesma codificação UTF-16, em little ou big endian, como o arquivo de entrada. Isso evita transformação para UTF-8. Como consequência, um BOM UTF-16 será escrito. Essa opção pode ser desabilitada com a opção "-ascii". -ul, --assume-utf16le Presume que o formato de arquivo de entrada é UTF-16LE. Quando há uma marca de ordem de byte no arquivo de entrada, esta tem prioridade sobre essa opção. Quando você fizer uma presunção equivocada (o arquivo de entrada não estava no formato UTF-16LE) e a conversão funcionar, você terá um arquivo de saída UTF-8 com texto errado. Você pode desfazer a conversão errada com iconv(1) pela conversão do arquivo de saída UTF-8 de volta para UTF-16LE. Isso vai trazer de volta o arquivo para o original. A presunção de UTF-16LE funciona como um *modo de conversão*. Ao alternara o modo *ascii* padrão, a presunção de UTF-16LE é desativada. -ub, --assume-utf16be Presume que o formato de arquivo de entrada é UTF-16BE. Essa opção funciona o mesmo que a opção "-ul". -v, --verbose Exibe mensagens detalhadas. Informação extra é exibida sobre marcas de ordem de byte e a quantidade de quebras de linha convertidas. -F, --follow-symlink Segue ligações simbólicas e converte os alvos. -R, --replace-symlink Substitui ligações simbólicas com arquivos convertidos (arquivos alvo originais permanecem inalterados). -S, --skip-symlink Mentém ligações simbólicas e alvos inalterados (padrão). -V, --version Exibe informação da versão e sai. MODO MAC No modo normal, as quebras de linhas são convertidas de DOS para Unix e vice-versa. Quebras de linha do Mac não são convertidas. No modo Mac, quebras de linha são convertidas de Mac para Unix e vice-versa. Quebras de linha do DOS não são alteradas. Para executar no modo Mac, use a opção de linha de comando "-c mac" ou use os comandos "mac2unix" ou "unix2mac". MODOS DE CONVERSÃO ascii No modo "ascii", apenas as quebras de linha são convertidas. Esse é o modo de conversão padrão. Apesar do nome deste modo ser ASCII, o qual é um padrão de 7 bits, o modo é em verdade 8 bits. Sempre use este modo quando quiser converter arquivos Unicode UTF-8. 7bit Neste modo todos os caracteres não-ASCII de 8 bits (com valores entre 128 e 255) são convertidos para um espaço de 7 bits. iso Caracteres são convertidos entre um conjunto de caracteres do DOS (página de código) e conjunto de caracteres ISO-8859-1 (Latin-1) no Unix. Caracteres de DOS sem um equivalente ISO-8859-1, para os quais a conversão não é possível, são convertidos para um ponto. O mesmo vale para caracteres ISO-8859-1 sem a contraparte DOS. Quando apenas a opção "-iso" for usada, dos2unix vai tentar determinar a página de código ativa. Quando isso não for possível, dos2unix vai usar a página de código padrão CP437, a qual é usada principalmente nos EUA. Para forçar uma página de código específica, use as opções -437 (EUA), -850 (Europeu oriental), -860 (Português), -863 (Franco-canadense) ou -865 (Nórdico). Também há suporte à página de código do Windows CP1252 (Europeu ocidental) com a opção -1252. Para outras páginas de código, use dos2unix em combinação cm iconv(1). Iconv pode converter entre uma lista grande de codificações de caracteres. Nunca use conversão ISO em arquivos textos Unicode. Isso vai corromper os arquivos codificados em UTF-8. Alguns exemplos: Conversão da página de código padrão do DOS para Latin-1 do Unix: dos2unix -iso -n entrada.txt saída.txt Conversão da CP850 do DOS para Latin-1 do Unix: dos2unix -850 -n entrada.txt saída.txt Conversão da CP1252 do Windows para Latin-1 do Unix: dos2unix -1252 -n entrada.txt saída.txt Conversão da CP1252 do Windows para UTF-8 (Unicode) do Unix: iconv -f CP1252 -t UTF-8 entrada.txt | dos2unix > saída.txt Conversão de Latin-1 do Unix para página de código padrão do DOS: unix2dos -iso -n entrada.txt saída.txt Conversão do Latin-1 do Unix para CP850 do DOS: unix2dos -850 -n entrada.txt saída.txt Conversão do Latin-1 do unix para CP1252 do Windows: unix2dos -1252 -n entrada.txt saída.txt Conversão do UTF-8 (Unicode) do Unix para CP1252 do Windows: unix2dos < entrada.txt | iconv -f UTF-8 -t CP1252 > saída.txt Veja também e . UNICODE Codificações Exitem codificações Unicode diferentes. No Unix e no Linux, arquivos Unicode são geralmente codificados em UTF-8. No Windows, arquivos texto Unicode podem ser codificados em UTF-8, UTF-16 ou UTF-16 big endian, mas na maioria das vezes são codificados no formato UTF-16. Conversão Arquivos texto em Unicode pode ter quebras de linha DOS, Unix ou Mac, como arquivos texto comuns. Todas as versões do dos2unix e unix2dos podem converter arquivos codificados em UTF-8 porque UTF-8 foi projetado para ter compatibilidade reversa com ASCII. Dos2unix e unix2dos com suporte a Unicode UTF-16 podem ler arquivos texto codificados em little e big endian UTF-16. Para ver se dos2unix foi compilado com suporte a UTF-16, digite "dos2unix -V". No Unix/Linux, arquivos codificados em UTF-16 são convertidos para a codificação de caracteres do localização. Use o comando locale(1) para descobrir qual é a codificação de caracteres da localização. Quando a conversão não for possível, ocorrerá um erro e o arquivo será ignorado. No Windows, arquivos UTF-16 são convertidos, por padrão, para UTF-8. Arquivos texto formatados em UTF-8 possuem ótimo suporte em ambos Windows e Unix/Linux. Codificações UTF-16 e UTF-8 são completamente compatíveis, não havendo qualquer perda de texto na conversão. Quando um erro de conversão UTF-16 para UTF-8 ocorre, por exemplo quando o arquivo de entrada UTF-16 contém um erro, o arquivo será ignorado. Quando a opção "-u" é usada, o arquivo de saída será escrito na mesma codificação UTF-16 que o arquivo de saída. A opção "-u" evita conversão para UTF-8. Dos2unix e unix2dos não possuem opção para converter arquivos UTF-8 para UTF-16. Modo de conversão ISO e 7 bits não funcionam em arquivos UTF-16. Marca de ordem de byte No Windows, arquivos Unicode normalmente têm uma Marca de Ordem de Byte (BOM), porque muitos programas (incluindo o Bloco de Notas) adiciona BOMs por padrão. Veja também . No Unix, arquivos Unicode normalmente não têm BOM. Presume-se que arquivos texto são codificados na codificação de caracteres da localização. Dos2unix pode detectar apenas se um arquivo está no formato UTF-16 se o arquivo tiver BOM. Quando um arquivo UTF-16 não tiver BOM, dos2unix vai ver se o arquivo é um arquivo binário. Use a opção "-ul" ou "-ub" para converter um arquivo UTF-16 sem BOM. Dos2unix escreve por padrão nenhum BOM no arquivo de saída. Com a opção "-b", o Dos2unix escreve um BOM quando o arquivo de entrada possuir BOM. Unix2dos escreve por padrão um BOM no arquivo de saída quando o arquivo de entrada tem BOM. Use a opção "-m" para remover BOM. Dos2unix e unix2dos sempre escrevem BOM quando a opção "-m" é usada. Nomes de arquivos Unicode no Windows Dos2unix possui um suporte opcional para leitura e escrita de nomes de arquivos Unicode no Prompt de Comando Windows. Isso significa que dos2unix pode abrir arquivos que possuam caracteres no nome que não são parte da página de código ANSI padrão do sistema. Para ver ser dosunix para Windows foi compilado com suporte a nomes de arquivos Unicode, digite "dos2unix -V". Há alguns problemas com a exibição de nomes de arquivos Unicode em um console Windows. Veja a opção "-D", "--display-enc". Para nomes de arquivos pode ser exibido incorretamente, mas os arquivos serão escritos com o nome correto. Exemplos de Unicode Conversão de UTF-16 do Windows (com BOM) para UTF-8 do Unix: dos2unix -n entrada.txt saída.txt Conversão de UTF-16LE do Windows (sem BOM) para UTF-8 do Unix: dos2unix -ul -n entrada.txt saída.txt Conversão de UTF-8 Unix para UTF-8 do Windows com BOM: unix2dos -m -n entrada.txt saída.txt Conversão de UTF-8 do Unix para UTF-16 do Windows: unix2dos < entrada.txt | iconv -f UTF-8 -t UTF-16 > saída.txt GB18030 GB18030 é um padrão governamental chinês. Um subconjunto obrigatório do padrão GB18030 é exigido oficialmente para todos os produtos de software vendidos na China. Veja também . GB18030 é completamente compatível com Unicode e pode ser considerado um formato de transformação de unicode. Assim como UTF-8, GB18030 é compatível com ASCII. GB18030 também é compatível com a página de código 936 do Windows, também conhecida como GBK. No Unix/Linux, arquivos UTF-16 são convertidos para GB18030 quando a codificação da localização é definida para GB18030. Note que isso vai funcionar apenas se o sistemas oferecer suporte à localização. Use o comando "locale -a" para obter a lista de localizações às quais há suporte. No Windows, você precisa usar a opção "-gb" para converter arquivos UTF-16 para GB18030. Arquivos codificados em GB18030 possuem uma marca de ordem de bytes, como arquivos Unicode. EXEMPLOS Lê a entrada da "stdin" e escreve a saída para "stdout": dos2unix < a.txt cat a.txt | dos2unix Converte e substitui a.txt. Converte e substitui b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Converte e substitui a.txt no modo de conversão ascii: dos2unix a.txt Converte e substitui a.txt no modo de conversão ascii. Converte e substitui b.txt no modo de conversão 7bit: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Converte a.txt do formato do Mac para Unix: dos2unix -c mac a.txt mac2unix a.txt Converte a.txt do formato do Unix para Mac: unix2dos -c mac a.txt unix2mac a.txt Converte e substitui a.txt enquanto mantém a marca de data original: dos2unix -k a.txt dos2unix -k -o a.txt Converte a.txt e escreve para e.txt: dos2unix -n a.txt e.txt Converte a.txt e escreve para e.txt, mantém a marca de data de e.txt igual a a.txt: dos2unix -k -n a.txt e.txt Converte e substitui a.txt. Converte b.txt e escreve para e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Converte c.txt e escreve para e.txt. Converte e substitui a.txt. Converte e substitui b.txt. Converte d.txt e escreve para f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt CONVERSÃO RECURSIVA Use dos2unix em combinação com os comandos find(1) e xargs(1) para converter recursivamente arquivos texto em uma estrutura de árvore de diretórios. Por exemplo, para converter todos os arquivos .txt na árvore de diretórios sob o diretório atual, digite: find . -name '*.txt' |xargs dos2unix Em um Prompt de Comando do Windows o seguinte comando pode ser usado: for /R %G in (*.txt) do dos2unix "%G" Usuários do PowerShell podem usar o seguinte comando no Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} LOCALIZAÇÃO LANG O idioma primário é selecionado com a variável de ambiente LANG. A variável LANG consiste em várias partes. A primeira parte está em letras pequenas no código do idioma. A segunda parte é opcional e é o código do país em letras maiúsculo, precedido de um ponto. Alguns exemplos para shells do tipo padrão POSIX: export LANG=nl Holandês export LANG=nl_NL Holandês, Holanda export LANG=nl_BE Holandês, Bélgica export LANG=es_ES Espanhol, Espanha export LANG=es_MX Espanhol, México export LANG=en_US.iso88591 Inglês, EUA, codificação Latin-1 export LANG=en_GB.UTF-8 Inglês, Reino Unido, codificação UTF-8 Para a lista completa de códigos de idioma e país, veja o manual do gettext: Nos sistemas Unix, você pode usar o comando locale(1) para obter informação específica da localização. LANGUAGE Com a variável de ambiente LANGUAGE, você pode especificar uma lista de prioridades de idiomas, separada por vírgulas. Dos2unix fornece preferência à LANGUAGE sobre LANG. Por exemplo, primeiro holandês e, então, alemão: "LANGUAGE=nl:de". Você primeiro tem que habilitar localização, definindo LANG (ou LC_ALL) para um valor diferente de "C", antes que você possa usar uma lista de prioridade de idioma por meio da variável LANGUAGE. Veja também o manual do gettext: Se você selecionou um idioma que não está disponível, você vai terá as mensagens em inglês (padrão). DOS2UNIX_LOCALEDIR Com a variável de ambiente DOS2UNIX_LOCALEDIR, o LOCALEDIR definido durante a compilação pode ser sobrescrito. LOCALEDIR é usada para localizar os arquivos de idioma. O valor padrão do GNU é "/usr/local/share/locale". A opção --version vai exibir o LOCALEDIR que é usado. Exemplo (shell POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale VALOR RETORNADO No sucesso, zero é retornado. Quando um erro de sistema ocorre, o último erro de sistema será retornado. Para outros erros, 1 é retornado. O valor retornado é sempre zero no modo quieto, exceto quando opções de linha de comando erradas são usadas. PADRÕES AUTORES Benjamin Lin - Bernd Johannes Wuebben (modo mac2unix) - , Christian Wurll (adiciona nova linha extra) - , Erwin Waterlander - (mantenedor) Página do projeto: Página do SourceForge: Veja também file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/sv/0000755000175500010010000000000012721132555013755 5ustar waterlanGeendos2unix-7.3.4/man/sv/man1/0000755000175500010010000000000012721132613014604 5ustar waterlanGeendos2unix-7.3.4/man/sv/man1/dos2unix.10000644000175500010010000010034212721132557016450 0ustar waterlanGeen.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dos2unix 1" .TH dos2unix 1 "2016-05-24" "dos2unix" "2016-05-24" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAMN" .IX Header "NAMN" dos2unix \- konverterare för textfilsformat från DOS/Mac till Unix och vice versa .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& dos2unix [flaggor] [FIL …] [\-n INFIL UTFIL …] \& unix2dos [flaggor] [FIL …] [\-n INFIL UTFIL …] .Ve .SH "BESKRIVNING" .IX Header "BESKRIVNING" Paketet Dos2unix inkluderar verktygen \f(CW\*(C`dos2unix\*(C'\fR och \f(CW\*(C`unix2dos\*(C'\fR som konverterar oformaterade textfiler i \s-1DOS\-\s0 eller Mac-format till Unix-format och vice versa. .PP Textfiler i DOS/Windows har en radbrytning, också känd som nyrad, som är en kombination av två tecken: vagnretur (Carriage Return, \s-1CR\s0) åtföljt av radmatning (Line Feed, \s-1LF\s0). Textfiler i Unix har en radbrytning som är ett enda tecken: radmatning (Line Feed, \s-1LF\s0). Textfiler för Mac, innan Mac \s-1OS X,\s0 hade en radbrytning som var en enda vagnretur (Carriage Return, \s-1CR\s0). Numera använder Mac \s-1OS\s0 radbrytning i Unix-stil (\s-1LF\s0). .PP Förutom radbrytningar så kan Dos2unix också konvertera filers kodning. Några DOS-teckentabeller kan konverteras till Unix Latin\-1. Och filer som använder Windows Unicode (\s-1UTF\-16\s0) kan konverteras till Unix Unicode (\s-1UTF\-8\s0). .PP Binära filer hoppas över automatiskt, om inte konvertering tvingas. .PP Kataloger och FIFOs och andra filer som inte är vanliga filer hoppas över automatiskt. .PP Symboliska länkar och deras mål förblir oförändrade som standard. Symboliska länkar kan valfritt bli ersatta eller så kan utmatningen skrivas till målet för den symboliska länken. På Windows saknas stöd för att skriva till målet för en symbolisk länk. .PP Dos2unix modellerades efter dos2unix från SunOS/Solaris. Det finns en viktig skillnad gentemot originalversionen för SunOS/Solaris. Denna versionen gör som standard konverteringen på plats (gammalfilsläge), medan originalversionen från SunOS/Solaris bara hade stöd för parad konvertering (nyfilsläge). Se vidare flaggorna \f(CW\*(C`\-o\*(C'\fR och \f(CW\*(C`\-n\*(C'\fR. En annan skillnad är att SunOS/Solaris\-versionen som standard använder \fIiso\fR\-lägeskonvertering medan denna version som standard använder \fIascii\fR\-lägeskonvertering. .SH "FLAGGOR" .IX Header "FLAGGOR" .IP "\fB\-\-\fR" 4 .IX Item "--" Behandla alla efterföljande flaggor som filnamn. Använd denna flagga om du vill konvertera filer vars namn börjar med bindestreck. För att till exempel konvertera en fil med namnet “\-foo“ kan du använda detta kommando: .Sp .Vb 1 \& dos2unix \-\- \-foo .Ve .Sp Eller i nyfilsläge: .Sp .Vb 1 \& dos2unix \-n \-\- \-foo out.txt .Ve .IP "\fB\-ascii\fR" 4 .IX Item "-ascii" Konvertera enbart radbrytningar. Detta är standardkonverteringsläget. .IP "\fB\-iso\fR" 4 .IX Item "-iso" Konvertering mellan \s-1DOS\-\s0 och ISO\-8859\-1\-teckentabeller. Se vidare stycket KONVERTERINGSLÄGEN. .IP "\fB\-1252\fR" 4 .IX Item "-1252" Använd Windows-teckentabell 1252 (Västeuropeisk). .IP "\fB\-437\fR" 4 .IX Item "-437" Använd DOS-teckentabell 437 (\s-1USA\s0). Detta är standardteckentabellen som används för ISO-konvertering. .IP "\fB\-850\fR" 4 .IX Item "-850" Använd DOS-teckentabell 850 (Västeuropeisk). .IP "\fB\-860\fR" 4 .IX Item "-860" Använd DOS-teckentabell 860 (Portugisisk). .IP "\fB\-863\fR" 4 .IX Item "-863" Använd DOS-teckentabell 863 (Fransk-kanadensisk). .IP "\fB\-865\fR" 4 .IX Item "-865" Använd DOS-teckentabell 865 (Nordisk). .IP "\fB\-7\fR" 4 .IX Item "-7" Konvertera 8\-bitars tecken till 7\-bitars blanksteg. .IP "\fB\-b, \-\-keep\-bom\fR" 4 .IX Item "-b, --keep-bom" Behåll byteordningsmarkering (Byte Order Mark, \s-1BOM\s0). Om infilen har en \s-1BOM,\s0 skriv en \s-1BOM\s0 i utfilen. Detta är standardbeteendet vid konvertering av DOS-radbrytningar. Se vidare flaggan \f(CW\*(C`\-r\*(C'\fR. .IP "\fB\-c, \-\-convmode KONVERTERINGSLÄGE\fR" 4 .IX Item "-c, --convmode KONVERTERINGSLÄGE" Ställer in konverteringsläge. Där KONVERTERINGSLÄGE är en av: \fIascii\fR, \&\fI7bit\fR, \fIiso\fR, \fImac\fR där ascii är standard. .IP "\fB\-D, \-\-display\-enc \s-1KODNING\s0\fR" 4 .IX Item "-D, --display-enc KODNING" Ställ in kodning för visad text. Där \s-1KODNING\s0 är en av: \fIansi\fR, \fIunicode\fR, \&\fIunicodebom\fR, \fIutf8\fR, \fIutf8bom\fR där ansi är standardvalet. .Sp Denna flagga finns bara tillgänglig i dos2unix för Windows med stöd för Unicode-filnamn. Denna flagga har ingen effekt på själva filnamnen som läses och skrivs, bara på hur de visas. .Sp Det finns flera metoder för att visa text i en Windows-konsol baserad på vilken kodning texten har. De har alla för\- och nackdelar. .RS 4 .IP "\fBansi\fR" 4 .IX Item "ansi" Dos2unix standardmetod är att använda ANSI-kodad text. Fördelen är att den är bakåtkompatibel. Det fungerar med raster\- och TrueType-teckensnitt. I vissa regioner kan du behöva ändra den aktiva \s-1DOS\s0 OEM-teckentabellen till Windows-systemets ANSI-teckentabell genom att använda kommandot \f(CW\*(C`chcp\*(C'\fR, eftersom dos2unix använder Windows-systemets teckentabell. .Sp Nackdelen med ansi är att internationella filnamn med tecken som inte finns i systemets standardteckentabell inte visas korrekt. Du kommer att se frågetecken, eller en felaktig symbol istället. När du inte arbetar med utländska filnamn är denna metoden \s-1OK.\s0 .IP "\fBunicode, unicodebom\fR" 4 .IX Item "unicode, unicodebom" Fördelen med unicode-kodning (Windows-namnet för \s-1UTF\-16\s0) är att text vanligtvis visas korrekt. Det finns inget behov av att ändra den aktiva teckentabellen. Du kan behöva ställa in konsolens teckensnitt till ett TrueType-teckensnitt för att få internationella tecken att visas korrekt. När ett tecken inte finns inkluderat i TrueType-teckensnittet kommer du vanligtvis att se en liten ruta, ibland med ett frågetecken inuti. .Sp När du använder ConEmu-konsolen kommer all text att visas korrekt eftersom ConEmu automatiskt väljer ett bra teckensnitt. .Sp Nackdelen med unicode är att den inte är kompatibel med \s-1ASCII.\s0 Utmatningen är inte lätt att hantera när du omdirigerar den till ett annat program eller en fil. .Sp När metod \f(CW\*(C`unicodebom\*(C'\fR används kommer Unicode-texten att föregås av en \s-1BOM \&\s0(byteordningsmarkering, Byte Order Mark). En \s-1BOM\s0 krävs för korrekt omdirigering eller rörledning i PowerShell. .IP "\fButf8, utf8bom\fR" 4 .IX Item "utf8, utf8bom" Fördelen med utf8 är att den är kompatibel med \s-1ASCII.\s0 Du måste ställa in konsolens teckensnitt till ett TrueType-teckensnitt. Med ett TrueType-teckensnitt kommer text att visas på liknande sätt som med \&\f(CW\*(C`unicode\*(C'\fR\-kodningen. .Sp Nackdelen är att när du använder standardrasterteckensnittet kommer alla icke-ASCII tecken att visas fel. Inte enbart unicode-filnamn, utan också översatta meddelanden kommer att bli oläsbara. Under Windows som konfigurerats för Östasien kan man komma att se många blinkningar i konsolen när meddelanden visas. .Sp I ConEmu-konsolen fungerar utf8\-kodningsmetoden väl. .Sp När metod \f(CW\*(C`utf8bom\*(C'\fR används kommer UTF\-8\-texten att föregås av en \s-1BOM \&\s0(byteordningsmarkering, Byte Order Mark). En \s-1BOM\s0 krävs för korrekt omdirigering eller rörledning i PowerShell. .RE .RS 4 .Sp Standardkodningen kan ändras via miljövariabeln \s-1DOS2UNIX_DISPLAY_ENC\s0 genom att sätta den till \f(CW\*(C`unicode\*(C'\fR, \f(CW\*(C`unicodebom\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR or \f(CW\*(C`utf8bom\*(C'\fR. .RE .IP "\fB\-f, \-\-force\fR" 4 .IX Item "-f, --force" Tvinga konvertering av binära filer. .IP "\fB\-gb, \-\-gb18030\fR" 4 .IX Item "-gb, --gb18030" Under Windows konverteras UTF\-16\-filer som standard till \s-1UTF\-8,\s0 oavsett vilken lokalinställning som är gjord. Använd denna flagga för att konvertera UTF\-16\-filer till \s-1GB18030.\s0 Denna flagga finns bara tillgänglig i Windows. Se vidare i avsnittet \s-1GB18030.\s0 .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Visa hjälptext och avsluta. .IP "\fB\-i[\s-1FLAGGOR\s0], \-\-info[=FLAGGOR] \s-1FIL ...\s0\fR" 4 .IX Item "-i[FLAGGOR], --info[=FLAGGOR] FIL ..." Visa filinformation. Ingen konvertering görs. .Sp Följande information skrivs ut, i denna ordningen: antal DOS-radbrytningar, antal Unix-radbrytningar, antal Mac-radbrytningar, byteordningsmarkeringen, text eller binär, filnamn. .Sp Exempelutmatning: .Sp .Vb 8 \& 6 0 0 no_bom text dos.txt \& 0 6 0 no_bom text unix.txt \& 0 0 6 no_bom text mac.txt \& 6 6 6 no_bom text mixed.txt \& 50 0 0 UTF\-16LE text utf16le.txt \& 0 50 0 no_bom text utf8unix.txt \& 50 0 0 UTF\-8 text utf8dos.txt \& 2 418 219 no_bom binär dos2unix.exe .Ve .Sp Notera att en binärfil ibland kan misstas för en textfil. Se vidare flaggan \&\f(CW\*(C`\-s\*(C'\fR. .Sp Extra flaggor kan användas valfritt för att ändra utmatningen. En eller fler flaggor kan läggas till. .RS 4 .IP "\fBd\fR" 4 .IX Item "d" Skriv ut antal DOS-radbrytningar. .IP "\fBu\fR" 4 .IX Item "u" Skriv ut antal Unix-radbrytningar. .IP "\fBm\fR" 4 .IX Item "m" Skriv ut antal Mac-radbrytningar. .IP "\fBb\fR" 4 .IX Item "b" Skriv ut byteordningsmarkeringen. .IP "\fBt\fR" 4 .IX Item "t" Skriv ut om filen är text eller binär. .IP "\fBc\fR" 4 .IX Item "c" Skriv bara ut filerna som skulle ha konverterats. .Sp Med \f(CW\*(C`c\*(C'\fR\-flaggan kommer dos2unix att skriva ut filerna som innehåller DOS-radbrytningar, unix2dos kommer bara att skriva ut filnamn som har Unix-radbrytningar. .IP "\fBh\fR" 4 .IX Item "h" Skriv ut rubrik. .IP "\fBp\fR" 4 .IX Item "p" Visa filnamn utan sökväg. .RE .RS 4 .Sp Exempel: .Sp Visa information för alla *.txt\-filer: .Sp .Vb 1 \& dos2unix \-i *.txt .Ve .Sp Visa bara antalet DOS-radbrytningar och Unix-radbrytningar: .Sp .Vb 1 \& dos2unix \-idu *.txt .Ve .Sp Visa bara byteordningsmarkeringen: .Sp .Vb 1 \& dos2unix \-\-info=b *.txt .Ve .Sp Lista filerna som har DOS-radbrytningar: .Sp .Vb 1 \& dos2unix \-ic *.txt .Ve .Sp Lista filerna som har Unix-radbrytningar: .Sp .Vb 1 \& unix2dos \-ic *.txt .Ve .Sp Konvertera endast filer som har DOS-radbrytningar och lämna övriga filer orörda: .Sp .Vb 1 \& dos2unix \-ic *.txt | xargs dos2unix .Ve .Sp Hitta textfiler som har DOS-radbrytningar: .Sp .Vb 1 \& find \-name \*(Aq*.txt\*(Aq | xargs dos2unix \-ic .Ve .RE .IP "\fB\-k, \-\-keepdate\fR" 4 .IX Item "-k, --keepdate" Behåll infilens datumstämpel för utfilen. .IP "\fB\-L, \-\-license\fR" 4 .IX Item "-L, --license" Visa programmets licens. .IP "\fB\-l, \-\-newline\fR" 4 .IX Item "-l, --newline" Lägg till ytterligare nyrad. .Sp \&\fBdos2unix\fR: Endast DOS-radbrytningar ändras till två Unix-radbrytningar. I Mac\-läge ändras endast Mac-radbrytningar till två Unix-radbrytningar. .Sp \&\fBunix2dos\fR: Endast Unix-radbrytningar ändras till två DOS-radbrytningar. I Mac\-läge ändras Unix-radbrytningar till två Mac-radbrytningar. .IP "\fB\-m, \-\-add\-bom\fR" 4 .IX Item "-m, --add-bom" Skriv en byteordningsmarkering (Byte Order Mark, \s-1BOM\s0) i utfilen. Som standard skrivs en \s-1UTF\-8 BOM.\s0 .Sp När infilen är \s-1UTF\-16,\s0 och flaggan \f(CW\*(C`\-u\*(C'\fR används, kommer en \s-1UTF\-16 BOM\s0 att skrivas. .Sp Använd aldrig denna flagga när kodningen för utmatning är något annat än \&\s-1UTF\-8, UTF\-16\s0 eller \s-1GB18030.\s0 Se vidare i avsnittet \s-1UNICODE.\s0 .IP "\fB\-n, \-\-newfile \s-1INFIL UTFIL\s0 …\fR" 4 .IX Item "-n, --newfile INFIL UTFIL …" Nyfilsläge. Konvertera filen \s-1INFIL\s0 och skriv utfilen \s-1UTFIL.\s0 Filnamnen måste ange i par och jokertecken i namnen ska \fIinte\fR användas annars \fIkommer\fR du att förlora filer. .Sp Användaren som påbörjar konverteringen i nyfilsläge (parat läge) kommer att bli ägaren till den konverterade filen. Läs\-/skrivbehörigheter för den nya filen kommer att vara samma behörigheter som för originalfilen minus \&\fIumask\fR\|(1) för användaren som kör konverteringen. .IP "\fB\-o, \-\-oldfile \s-1FIL\s0 …\fR" 4 .IX Item "-o, --oldfile FIL …" Gammalfilsläge. Konvertera filen \s-1FIL\s0 och skriv över den med utmatningen. Programmet kör i detta läge som standard. Jokertecken i filnamn får användas. .Sp I gammalfilsläge (på\-plats läge) kommer den konverterade filen att få samma ägare, grupp samt läs\-/skrivbehörigheter som originalfilen. Även då filen konverteras av en annan användare som har skrivbehörighet för filen (t.ex. användaren root). Konverteringen kommer att avbrytas när det inte är möjligt att bevara originalvärdena. Byte av ägare skulle kunna innebära att originalägaren inte längre kan läsa filen. Byte av grupp skulle kunna vara en säkerhetsrisk, filen skulle kunna bli läsbar för användare som den inte är avsedd för. Stöd för bevarande av ägare, grupp och läs\-/skrivbehörigheter finns bara i Unix. .IP "\fB\-q, \-\-quiet\fR" 4 .IX Item "-q, --quiet" Tyst drift. Undertryck alla varningar och meddelanden. Returvärdet är noll. Utom när felaktiga kommandoradsflaggor används. .IP "\fB\-r, \-\-remove\-bom\fR" 4 .IX Item "-r, --remove-bom" Ta bort byteordningsmarkering (Byte Order Mark, \s-1BOM\s0). Skriv inte en \s-1BOM\s0 i utfilen. Detta är standardbeteende vid konvertering av Unix-radbrytningar. Se vidare flaggan \f(CW\*(C`\-b\*(C'\fR. .IP "\fB\-s, \-\-safe\fR" 4 .IX Item "-s, --safe" Hoppa över binära filer (standard). .Sp Binärfiler hoppas över för att undvika oavsiktliga misstag. Var medveten om att detektering av binärfiler inte är 100% säker. Infiler genomsöks efter binära symboler som typiskt inte återfinns i textfiler. Det är möjligt att en binärfil enbart innehåller texttecken. En sådan binärfil kommer oavsiktligt att ses som en textfil. .IP "\fB\-u, \-\-keep\-utf16\fR" 4 .IX Item "-u, --keep-utf16" Behåll infilens original UTF\-16\-kodning. Utfilen kommer att skrivas med samma UTF\-16\-kodning som infilen, omvänd eller rak byteordning (little eller big endian). Detta förhindrar transformation till \s-1UTF\-8.\s0 En \s-1UTF\-16 BOM\s0 kommer att skrivas i enlighet med detta. Denna flagga kan inaktiveras med \&\f(CW\*(C`\-ascii\*(C'\fR\-flaggan. .IP "\fB\-ul, \-\-assume\-utf16le\fR" 4 .IX Item "-ul, --assume-utf16le" Antag att infilsformatet är \s-1UTF\-16LE.\s0 .Sp När det finns en byteordningsmarkering (Byte Order Mark) i infilen så har BOM:en högre prioritet än denna flagga. .Sp När du har gjort fel antagande (infilen var inte i UTF\-16LE\-format) och konverteringens lyckas, kommer du att få en \s-1UTF\-8\s0 utfil med felaktig text. Du kan göra denna konvertering ogjord med \fIiconv\fR\|(1) genom att konvertera \s-1UTF\-8\s0 utfilen tillbaka till \s-1UTF\-16LE.\s0 Detta kommer att återskapa originalfilen. .Sp Antagandet om \s-1UTF\-16LE\s0 fungerar som ett \fIkonverteringsläge\fR. Genom att växla till standard \fIascii\fR\-läget kommer \s-1UTF\-16LE\s0 antagandet att stängas av. .IP "\fB\-ub, \-\-assume\-utf16be\fR" 4 .IX Item "-ub, --assume-utf16be" Antag att infilsformatet är \s-1UTF\-16BE.\s0 .Sp Denna flagga fungerar på samma sätt som flaggan \f(CW\*(C`\-ul\*(C'\fR. .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Visa utförliga meddelanden. Extra information visas om byteordningsmarkeringar och antalet konverterade radbrytningar. .IP "\fB\-F, \-\-follow\-symlink\fR" 4 .IX Item "-F, --follow-symlink" Följ symboliska länkar och konvertera målen. .IP "\fB\-R, \-\-replace\-symlink\fR" 4 .IX Item "-R, --replace-symlink" Ersätt symboliska länkar med konverterade filer (originalmålfilerna förblir oförändrade). .IP "\fB\-S, \-\-skip\-symlink\fR" 4 .IX Item "-S, --skip-symlink" Behåll symboliska länkar och mål oförändrade (standard). .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" Visa versionsinformation och avsluta. .SH "MAC\-LÄGE" .IX Header "MAC-LÄGE" I normalläge konverteras radbrytningar från \s-1DOS\s0 till Unix och vice versa. Mac-radbrytningar konverteras inte. .PP I Mac\-läge konverteras radbrytningar från Mac till Unix och vice versa. DOS-radbrytningar ändras ej. .PP För att köra i Mac\-läge använd kommandoradsflaggan \f(CW\*(C`\-c mac\*(C'\fR eller använd kommandona \f(CW\*(C`mac2unix\*(C'\fR eller \f(CW\*(C`unix2mac\*(C'\fR. .SH "KONVERTERINGSLÄGEN" .IX Header "KONVERTERINGSLÄGEN" .IP "\fBascii\fR" 4 .IX Item "ascii" I läget \f(CW\*(C`ascii\*(C'\fR konverteras enbart radbrytningar. Detta är standardkonverteringsläget. .Sp Även om namnet på detta läge är \s-1ASCII,\s0 vilket är en 7\-bitarsstandard, så är det läget egentligen ett 8\-bitarsläge. Använd alltid detta läge vid konvertering av Unicode UTF\-8\-filer. .IP "\fB7bit\fR" 4 .IX Item "7bit" I detta läge konverteras alla 8\-bitars icke-ASCII tecken (med värden från 128 till 255) till ett 7\-bitars blanksteg. .IP "\fBiso\fR" 4 .IX Item "iso" Tecken konverteras mellan \s-1DOS\s0 teckenuppsättning (teckentabell) och \s-1ISO\s0 teckenuppsättning \s-1ISO\-8859\-1 \s0(Latin\-1) på Unix. \s-1DOS\s0 tecken utan motsvarande \&\s-1ISO\-8859\-1\s0 tecken, för vilka konvertering är omöjligt, kommer att ersättas med en punkt. Detsamma gäller för \s-1ISO\-8859\-1\s0 tecken utan motsvarighet i \s-1DOS.\s0 .Sp När enbart flaggan \f(CW\*(C`\-iso\*(C'\fR används kommer dos2unix att försöka avgöra den aktiva teckentabellen. När detta inte är möjligt kommer dos2unix att använda standardteckentabellen \s-1CP437,\s0 vilken huvudsakligen används i \s-1USA.\s0 För att tvinga en specifik teckentabell använd flaggorna \f(CW\*(C`\-437\*(C'\fR (\s-1USA\s0), \f(CW\*(C`\-850\*(C'\fR (Västeuropeisk), \f(CW\*(C`\-860\*(C'\fR (Portugisisk), \f(CW\*(C`\-863\*(C'\fR (Fransk-kanadensisk) eller \&\f(CW\*(C`\-865\*(C'\fR (Nordisk). Det finns också stöd för Windows-teckentabell \s-1CP\-1252 \&\s0(Västeuropeisk) via flaggan \f(CW\*(C`\-1252\*(C'\fR. För andra teckentabeller använd dos2unix i kombination med \fIiconv\fR\|(1). iconv kan konvertera mellan en lång lista av teckenkodningar. .Sp Använd aldrig ISO-konvertering på Unicode-textfiler. Det kommer att korrumpera UTF\-8\-kodade filer. .Sp Några exempel: .Sp Konvertera från \s-1DOS\s0 standardteckentabell till Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-iso \-n in.txt ut.txt .Ve .Sp Konvertera från \s-1DOS CP850\s0 till Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-850 \-n in.txt ut.txt .Ve .Sp Konvertera från Windows \s-1CP1252\s0 till Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-1252 \-n in.txt ut.txt .Ve .Sp Konvertera från Windows \s-1CP1252\s0 till Unix \s-1UTF\-8 \s0(Unicode): .Sp .Vb 1 \& iconv \-f CP1252 \-t UTF\-8 in.txt | dos2unix > ut.txt .Ve .Sp Konvertera från Unix Latin\-1 till DOS-standardteckentabell: .Sp .Vb 1 \& unix2dos \-iso \-n in.txt ut.txt .Ve .Sp Konvertera från Unix Latin\-1 till \s-1DOS CP850:\s0 .Sp .Vb 1 \& unix2dos \-850 \-n in.txt ut.txt .Ve .Sp Konvertera från Unix Latin\-1 till Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos \-1252 \-n in.txt ut.txt .Ve .Sp Konvertera från Unix \s-1UTF\-8 \s0(Unicode) till Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t CP1252 > ut.txt .Ve .Sp Se även och . .SH "UNICODE" .IX Header "UNICODE" .SS "Kodningar" .IX Subsection "Kodningar" Det finns flera olika Unicode kodningar. I Unix och Linux kodas filer vanligtvis med UTF\-8\-kodning. I Windows kan Unicode-textfiler kodas i \s-1UTF\-8, UTF\-16\s0 eller \s-1UTF\-16\s0 rak byteordning (big endian), men kodas mestadels i UTF\-16\-format. .SS "Konvertering" .IX Subsection "Konvertering" Unicode-textfiler kan ha \s-1DOS,\s0 Unix eller Mac-radbrytningar precis som vanliga textfiler. .PP Alla versioner av dos2unix och unix2dos kan konvertera UTF\-8\-kodade filer, eftersom \s-1UTF\-8\s0 designades för bakåtkompatibilitet med \s-1ASCII.\s0 .PP Dos2unix och unix2dos med Unicode\-UTF\-16\-stöd, kan läsa UTF\-16\-kodade textfiler i omvänd och rak byteordning (little och big endian). För att se om dos2unix byggts med UTF\-16\-stöd skriv \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP Under Unix/Linux kommer UTF\-16\-kodade filer att konverteras till lokalens teckenkodning. Använd kommandot \fIlocale\fR\|(1) för att ta reda på vilken lokalens teckenkodning är. När konvertering inte är möjlig kommer ett konverteringsfel att inträffa och filen kommer att hoppas över. .PP Under Windows konverteras UTF\-16\-filer som standard till \&\s-1UTF\-8.\s0 UTF\-8\-formaterade textfiler har bra stöd både under Windows och Unix/Linux. .PP \&\s-1UTF\-16\-\s0 och UTF\-8\-kodning är fullt kompatibla, ingen text kommer att gå förlorad i konverteringen. När ett \s-1UTF\-16\s0 till UTF\-8\-konverteringsfel uppstår, till exempel när infilen i UTF\-16\-format innehåller ett fel, kommer att filen att hoppas över. .PP När flaggan \f(CW\*(C`\-u\*(C'\fR används kommer utfilen att skrivas med samma UTF\-16\-kodning som infilen. Flaggan \f(CW\*(C`\-u\*(C'\fR förhindrar konvertering till \&\s-1UTF\-8.\s0 .PP Dos2unix och unix2dos har ingen flagga för att konvertera UTF\-8\-filer till \&\s-1UTF\-16.\s0 .PP \&\s-1ISO\-\s0 och 7\-bitarslägeskonvertering fungerar inte på UTF\-16\-filer. .SS "Byteordningsmarkering (Byte Order Mark)" .IX Subsection "Byteordningsmarkering (Byte Order Mark)" I Windows har Unicode-textfiler typiskt en byteordningsmarkering (Byte Order Mark, \s-1BOM\s0) eftersom många Windows-program (inklusive Notepad) lägger till BOM:ar som standard. Se även . .PP I Unix har Unicode-textfiler typiskt ingen \s-1BOM.\s0 Filer antas vara kodade i den lokala teckenuppsättningen. .PP Dos2Unix kan bara detektera om en fil är i UTF\-16\-format om filen har en \&\s-1BOM.\s0 När en UTF\-16\-fil inte har en \s-1BOM\s0 så kommer dos2unix att de filen som en binärfil. .PP Använd flaggan \f(CW\*(C`\-ul\*(C'\fR eller \f(CW\*(C`\-ub\*(C'\fR för att konvertera en UTF\-16\-fil utan \&\s-1BOM.\s0 .PP Dos2unix skriver som standard ingen \s-1BOM\s0 i utfilen. Med flaggan \f(CW\*(C`\-b\*(C'\fR kommer Dos2unix att skriva en \s-1BOM\s0 när infilen har en \s-1BOM.\s0 .PP Unix2dos skriver som standard en \s-1BOM\s0 i utfilen när infilen har en \&\s-1BOM.\s0 Använd flaggan \f(CW\*(C`\-r\*(C'\fR för att ta bort BOM:en. .PP Dos2unix och unix2dos skriver alltid en \s-1BOM\s0 när flaggan \f(CW\*(C`\-m\*(C'\fR används. .SS "Unicode-filnamn under Windows" .IX Subsection "Unicode-filnamn under Windows" Dos2unix har valfritt stöd för läsning och skrivning av Unicode-filnamn i Windows kommandoprompt. Detta innebär att dos2unix kan öppna filer som har tecken i sina namn som inte är en del av systemets atandard ANSI-teckentabell. För att se om dos2unix för Windows byggdes med stöd för Unicode-filnamn skriv \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP Det finns en del problem med att visa Unicode-filnamn i en Windows-konsol. Se vidare flaggan \f(CW\*(C`\-D\*(C'\fR, \f(CW\*(C`\-\-display\-enc\*(C'\fR. Filnamnen kan visas felaktigt i konsolen, men filerna som skrivs kommer att ha de korrekta namnen. .SS "Unicode-exempel" .IX Subsection "Unicode-exempel" Konvertera från Windows \s-1UTF\-16 \s0(med \s-1BOM\s0) till Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-n in.txt ut.txt .Ve .PP Konvertera från Windows \s-1UTF\-16LE \s0(utan \s-1BOM\s0) till Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-ul \-n in.txt ut.txt .Ve .PP Konvertera från Unix \s-1UTF\-8\s0 till Windows \s-1UTF\-8\s0 med \s-1BOM:\s0 .PP .Vb 1 \& unix2dos \-m \-n in.txt ut.txt .Ve .PP Konvertera från Unix \s-1UTF\-8\s0 till Windows \s-1UTF\-16:\s0 .PP .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t UTF\-16 > ut.txt .Ve .SH "GB18030" .IX Header "GB18030" \&\s-1GB18030\s0 är en standard från Kinesiska regeringen. En obligatorisk delmängd av standarden \s-1GB18030\s0 krävs officiellt för alla programvaruprodukter som säljs i Kina. Se vidare . .PP \&\s-1GB18030\s0 är fullständigt kompatibel med Unicode och kan anses vara ett överföringsformat för unicode. Precis som \s-1UTF\-8\s0 är \s-1GB18030\s0 kompatibel med \&\s-1ASCII. GB18030\s0 är också kompatibel med Windows-teckentabell 936, också känd som \s-1GBK.\s0 .PP Under Unix/Linux kommer UTF\-16\-filer att konverteras till \s-1GB18030\s0 när lokalens teckenkodning är inställd på \s-1GB18030.\s0 Notera att detta endast kommer att fungera om lokalen har stöd i systemet. Använd kommandot \f(CW\*(C`locale \&\-a\*(C'\fR för att få en lista över de lokaler som stöds. .PP Under Windows måste du använda flaggan \f(CW\*(C`\-gb\*(C'\fR för att konvertera UTF\-16\-filer till \s-1GB18030.\s0 .PP GB18030\-kodade filer kan ha en byteordningsmarkering, precis som Unicode-filer. .SH "EXEMPEL" .IX Header "EXEMPEL" Läsa inmatning från “stdin“ och skriv utmatning till “stdout“: .PP .Vb 2 \& dos2unix < a.txt \& cat a.txt | dos2unix .Ve .PP Konvertera och ersätta a.txt. Konvertera och ersätt b.txt: .PP .Vb 2 \& dos2unix a.txt b.txt \& dos2unix \-o a.txt b.txt .Ve .PP Konvertera och ersätt a.txt i ascii\-konverteringsläge: .PP .Vb 1 \& dos2unix a.txt .Ve .PP Konvertera och ersätt a.txt i ascii\-konverteringsläge, konvertera och ersätt b.txt i 7bit\-konverteringsläge: .PP .Vb 3 \& dos2unix a.txt \-c 7bit b.txt \& dos2unix \-c ascii a.txt \-c 7bit b.txt \& dos2unix \-ascii a.txt \-7 b.txt .Ve .PP Konvertera a.txt från Mac\- till Unix-format: .PP .Vb 2 \& dos2unix \-c mac a.txt \& mac2unix a.txt .Ve .PP Konvertera a.txt från Unix\- till Mac-format: .PP .Vb 2 \& unix2dos \-c mac a.txt \& unix2mac a.txt .Ve .PP Konvertera och ersätt a.txt medan originalet tidsstämpel behålls: .PP .Vb 2 \& dos2unix \-k a.txt \& dos2unix \-k \-o a.txt .Ve .PP Konvertera a.txt och skriv till e.txt: .PP .Vb 1 \& dos2unix \-n a.txt e.txt .Ve .PP Konvertera a.txt och skriv till e.txt, låt e.txt behålla tidsstämpeln från a.txt: .PP .Vb 1 \& dos2unix \-k \-n a.txt e.txt .Ve .PP Konvertera och ersätt a.txt, konvertera b.txt och skriv till e.txt: .PP .Vb 2 \& dos2unix a.txt \-n b.txt e.txt \& dos2unix \-o a.txt \-n b.txt e.txt .Ve .PP Konvertera c.txt och skriv till e.txt, konvertera och ersätt a.txt, konvertera och ersätt b.txt, konvertera d.txt och skriv till f.txt: .PP .Vb 1 \& dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt .Ve .SH "REKURSIV KONVERTERING" .IX Header "REKURSIV KONVERTERING" Använd dos2unix i kombination med kommandona \fIfind\fR\|(1) och \fIxargs\fR\|(1) för att rekursivt konvertera filer i en katalogstruktur. För att till exempel konvertera alla .txt\-filer i katalogträdet under den aktuella katalogen skriv: .PP .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .PP I en Windows-kommandoprompt kan följande kommando användas: .PP .Vb 1 \& for /R %G in (*.txt) do dos2unix "%G" .Ve .PP PowerShell\-användare kan använda följande kommando i Windows PowerShell: .PP .Vb 1 \& get\-childitem \-path . \-filter \*(Aq*.txt\*(Aq \-recurse | foreach\-object {dos2unix $_.Fullname} .Ve .SH "LOKALISERING" .IX Header "LOKALISERING" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" Det primära språket väljs med miljövariabeln \s-1LANG.\s0 LANG-variabeln består av flera delas. Den första delen är språkkoden i gemener. Den andra delen är valfri och utgör landskoden i versaler, föregången av ett understreck. Det finns också en valfri tredje del: teckenkodning, föregången av en punkt. Ett par exempel för skal av POSIX-standard-typ: .Sp .Vb 7 \& export LANG=nl Nederländska \& export LANG=nl_NL Nederländska, Nederländerna \& export LANG=nl_BE Nederländska, Belgien \& export LANG=es_ES Spanska, Spanien \& export LANG=es_MX Spanska, Mexiko \& export LANG=en_US.iso88591 Engelska, USA, Latin\-1\-kodning \& export LANG=en_GB.UTF\-8 Engelska, UK, UTF\-8\-kodning .Ve .Sp För en fullständig lista över språk och landskoder se vidare i gettext-manualen: .Sp På Unix-system kan du använda kommando \fIlocale\fR\|(1) för att få lokal-specifik information. .IP "\fB\s-1LANGUAGE\s0\fR" 4 .IX Item "LANGUAGE" Med miljövariabeln \s-1LANGUAGE\s0 kan du ange en prioritetslista över språk, separerade med kolon. Dos2unix kommer att ge företräde till \s-1LANGAUGE\s0 över \&\s-1LANG.\s0 Exempelvis först nederländska och sedan tyska: \f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. Du måste först ha aktiverat lokalisering, genom att sätta \s-1LANG \s0(eller \s-1LC_ALL\s0) till ett värde annat än “C“, innan du kan använda en prioritetslista för språk via LANGUAGE-variabeln. Se vidare i gettext-manualen: .Sp Om du väljer ett språk som inte är tillgänglig kommer du att få engelska meddelanden som standard. .IP "\fB\s-1DOS2UNIX_LOCALEDIR\s0\fR" 4 .IX Item "DOS2UNIX_LOCALEDIR" Med miljövariabeln \s-1DOS2UNIX_LOCALEDIR\s0 kan \s-1LOCALEDIR\s0 som ställts in vid kompilering åsidosättas. \s-1LOCALEDIR\s0 används för att hitta språkfiler. Standardvärdet för GNU-program är \&\f(CW\*(C`/usr/local/share/locale\*(C'\fR. Flaggan \fB\-\-version\fR kommer att visa vilken \&\s-1LOCALEDIR\s0 som används. .Sp Exempel (POSIX-skal): .Sp .Vb 1 \& export DOS2UNIX_LOCALEDIR=$HOME/share/locale .Ve .SH "RETURVÄRDE" .IX Header "RETURVÄRDE" Om allt går bra kommer noll att returneras. När ett systemfel uppstår kommer det senaste systemfelet att returneras. För andra fel kommer 1 att returneras. .PP Returvärdet är alltid noll i tyst läge, utom när felaktiga kommandoradsflaggor används. .SH "STANDARDER" .IX Header "STANDARDER" .PP .PP .PP .SH "FÖRFATTARE" .IX Header "FÖRFATTARE" Benjamin Lin \- , Bernd Johannes Wuebben (mac2unix\-läge) \- , Christian Wurll (lägg till en extra radbrytning) \- , Erwin Waterlander \- (upphovsman) .PP Projektsida: .PP SourceForge-sida: .SH "SE ÄVEN" .IX Header "SE ÄVEN" \&\fIfile\fR\|(1) \fIfind\fR\|(1) \fIiconv\fR\|(1) \fIlocale\fR\|(1) \fIxargs\fR\|(1) dos2unix-7.3.4/man/sv/man1/dos2unix.htm0000644000175500010010000010540012721132572017075 0ustar waterlanGeen dos2unix 7.3.4 - textfilsformatskonverterare från DOS/Mac till Unix och vice versa

NAMN

dos2unix - konverterare för textfilsformat från DOS/Mac till Unix och vice versa

SYNOPSIS

    dos2unix [flaggor] [FIL …] [-n INFIL UTFIL …]
    unix2dos [flaggor] [FIL …] [-n INFIL UTFIL …]

BESKRIVNING

Paketet Dos2unix inkluderar verktygen dos2unix och unix2dos som konverterar oformaterade textfiler i DOS- eller Mac-format till Unix-format och vice versa.

Textfiler i DOS/Windows har en radbrytning, också känd som nyrad, som är en kombination av två tecken: vagnretur (Carriage Return, CR) åtföljt av radmatning (Line Feed, LF). Textfiler i Unix har en radbrytning som är ett enda tecken: radmatning (Line Feed, LF). Textfiler för Mac, innan Mac OS X, hade en radbrytning som var en enda vagnretur (Carriage Return, CR). Numera använder Mac OS radbrytning i Unix-stil (LF).

Förutom radbrytningar så kan Dos2unix också konvertera filers kodning. Några DOS-teckentabeller kan konverteras till Unix Latin-1. Och filer som använder Windows Unicode (UTF-16) kan konverteras till Unix Unicode (UTF-8).

Binära filer hoppas över automatiskt, om inte konvertering tvingas.

Kataloger och FIFOs och andra filer som inte är vanliga filer hoppas över automatiskt.

Symboliska länkar och deras mål förblir oförändrade som standard. Symboliska länkar kan valfritt bli ersatta eller så kan utmatningen skrivas till målet för den symboliska länken. På Windows saknas stöd för att skriva till målet för en symbolisk länk.

Dos2unix modellerades efter dos2unix från SunOS/Solaris. Det finns en viktig skillnad gentemot originalversionen för SunOS/Solaris. Denna versionen gör som standard konverteringen på plats (gammalfilsläge), medan originalversionen från SunOS/Solaris bara hade stöd för parad konvertering (nyfilsläge). Se vidare flaggorna -o och -n. En annan skillnad är att SunOS/Solaris-versionen som standard använder iso-lägeskonvertering medan denna version som standard använder ascii-lägeskonvertering.

FLAGGOR

--

Behandla alla efterföljande flaggor som filnamn. Använd denna flagga om du vill konvertera filer vars namn börjar med bindestreck. För att till exempel konvertera en fil med namnet “-foo“ kan du använda detta kommando:

    dos2unix -- -foo

Eller i nyfilsläge:

    dos2unix -n -- -foo out.txt
-ascii

Konvertera enbart radbrytningar. Detta är standardkonverteringsläget.

-iso

Konvertering mellan DOS- och ISO-8859-1-teckentabeller. Se vidare stycket KONVERTERINGSLÄGEN.

-1252

Använd Windows-teckentabell 1252 (Västeuropeisk).

-437

Använd DOS-teckentabell 437 (USA). Detta är standardteckentabellen som används för ISO-konvertering.

-850

Använd DOS-teckentabell 850 (Västeuropeisk).

-860

Använd DOS-teckentabell 860 (Portugisisk).

-863

Använd DOS-teckentabell 863 (Fransk-kanadensisk).

-865

Använd DOS-teckentabell 865 (Nordisk).

-7

Konvertera 8-bitars tecken till 7-bitars blanksteg.

-b, --keep-bom

Behåll byteordningsmarkering (Byte Order Mark, BOM). Om infilen har en BOM, skriv en BOM i utfilen. Detta är standardbeteendet vid konvertering av DOS-radbrytningar. Se vidare flaggan -r.

-c, --convmode KONVERTERINGSLÄGE

Ställer in konverteringsläge. Där KONVERTERINGSLÄGE är en av: ascii, 7bit, iso, mac där ascii är standard.

-D, --display-enc KODNING

Ställ in kodning för visad text. Där KODNING är en av: ansi, unicode, unicodebom, utf8, utf8bom där ansi är standardvalet.

Denna flagga finns bara tillgänglig i dos2unix för Windows med stöd för Unicode-filnamn. Denna flagga har ingen effekt på själva filnamnen som läses och skrivs, bara på hur de visas.

Det finns flera metoder för att visa text i en Windows-konsol baserad på vilken kodning texten har. De har alla för- och nackdelar.

ansi

Dos2unix standardmetod är att använda ANSI-kodad text. Fördelen är att den är bakåtkompatibel. Det fungerar med raster- och TrueType-teckensnitt. I vissa regioner kan du behöva ändra den aktiva DOS OEM-teckentabellen till Windows-systemets ANSI-teckentabell genom att använda kommandot chcp, eftersom dos2unix använder Windows-systemets teckentabell.

Nackdelen med ansi är att internationella filnamn med tecken som inte finns i systemets standardteckentabell inte visas korrekt. Du kommer att se frågetecken, eller en felaktig symbol istället. När du inte arbetar med utländska filnamn är denna metoden OK.

unicode, unicodebom

Fördelen med unicode-kodning (Windows-namnet för UTF-16) är att text vanligtvis visas korrekt. Det finns inget behov av att ändra den aktiva teckentabellen. Du kan behöva ställa in konsolens teckensnitt till ett TrueType-teckensnitt för att få internationella tecken att visas korrekt. När ett tecken inte finns inkluderat i TrueType-teckensnittet kommer du vanligtvis att se en liten ruta, ibland med ett frågetecken inuti.

När du använder ConEmu-konsolen kommer all text att visas korrekt eftersom ConEmu automatiskt väljer ett bra teckensnitt.

Nackdelen med unicode är att den inte är kompatibel med ASCII. Utmatningen är inte lätt att hantera när du omdirigerar den till ett annat program eller en fil.

När metod unicodebom används kommer Unicode-texten att föregås av en BOM (byteordningsmarkering, Byte Order Mark). En BOM krävs för korrekt omdirigering eller rörledning i PowerShell.

utf8, utf8bom

Fördelen med utf8 är att den är kompatibel med ASCII. Du måste ställa in konsolens teckensnitt till ett TrueType-teckensnitt. Med ett TrueType-teckensnitt kommer text att visas på liknande sätt som med unicode-kodningen.

Nackdelen är att när du använder standardrasterteckensnittet kommer alla icke-ASCII tecken att visas fel. Inte enbart unicode-filnamn, utan också översatta meddelanden kommer att bli oläsbara. Under Windows som konfigurerats för Östasien kan man komma att se många blinkningar i konsolen när meddelanden visas.

I ConEmu-konsolen fungerar utf8-kodningsmetoden väl.

När metod utf8bom används kommer UTF-8-texten att föregås av en BOM (byteordningsmarkering, Byte Order Mark). En BOM krävs för korrekt omdirigering eller rörledning i PowerShell.

Standardkodningen kan ändras via miljövariabeln DOS2UNIX_DISPLAY_ENC genom att sätta den till unicode, unicodebom, utf8 or utf8bom.

-f, --force

Tvinga konvertering av binära filer.

-gb, --gb18030

Under Windows konverteras UTF-16-filer som standard till UTF-8, oavsett vilken lokalinställning som är gjord. Använd denna flagga för att konvertera UTF-16-filer till GB18030. Denna flagga finns bara tillgänglig i Windows. Se vidare i avsnittet GB18030.

-h, --help

Visa hjälptext och avsluta.

-i[FLAGGOR], --info[=FLAGGOR] FIL ...

Visa filinformation. Ingen konvertering görs.

Följande information skrivs ut, i denna ordningen: antal DOS-radbrytningar, antal Unix-radbrytningar, antal Mac-radbrytningar, byteordningsmarkeringen, text eller binär, filnamn.

Exempelutmatning:

     6       0       0  no_bom    text    dos.txt
     0       6       0  no_bom    text    unix.txt
     0       0       6  no_bom    text    mac.txt
     6       6       6  no_bom    text    mixed.txt
    50       0       0  UTF-16LE  text    utf16le.txt
     0      50       0  no_bom    text    utf8unix.txt
    50       0       0  UTF-8     text    utf8dos.txt
     2     418     219  no_bom    binär   dos2unix.exe

Notera att en binärfil ibland kan misstas för en textfil. Se vidare flaggan -s.

Extra flaggor kan användas valfritt för att ändra utmatningen. En eller fler flaggor kan läggas till.

d

Skriv ut antal DOS-radbrytningar.

u

Skriv ut antal Unix-radbrytningar.

m

Skriv ut antal Mac-radbrytningar.

b

Skriv ut byteordningsmarkeringen.

t

Skriv ut om filen är text eller binär.

c

Skriv bara ut filerna som skulle ha konverterats.

Med c-flaggan kommer dos2unix att skriva ut filerna som innehåller DOS-radbrytningar, unix2dos kommer bara att skriva ut filnamn som har Unix-radbrytningar.

h

Skriv ut rubrik.

p

Visa filnamn utan sökväg.

Exempel:

Visa information för alla *.txt-filer:

    dos2unix -i *.txt

Visa bara antalet DOS-radbrytningar och Unix-radbrytningar:

    dos2unix -idu *.txt

Visa bara byteordningsmarkeringen:

    dos2unix --info=b *.txt

Lista filerna som har DOS-radbrytningar:

    dos2unix -ic *.txt

Lista filerna som har Unix-radbrytningar:

    unix2dos -ic *.txt

Konvertera endast filer som har DOS-radbrytningar och lämna övriga filer orörda:

    dos2unix -ic *.txt | xargs dos2unix

Hitta textfiler som har DOS-radbrytningar:

    find -name '*.txt' | xargs dos2unix -ic
-k, --keepdate

Behåll infilens datumstämpel för utfilen.

-L, --license

Visa programmets licens.

-l, --newline

Lägg till ytterligare nyrad.

dos2unix: Endast DOS-radbrytningar ändras till två Unix-radbrytningar. I Mac-läge ändras endast Mac-radbrytningar till två Unix-radbrytningar.

unix2dos: Endast Unix-radbrytningar ändras till två DOS-radbrytningar. I Mac-läge ändras Unix-radbrytningar till två Mac-radbrytningar.

-m, --add-bom

Skriv en byteordningsmarkering (Byte Order Mark, BOM) i utfilen. Som standard skrivs en UTF-8 BOM.

När infilen är UTF-16, och flaggan -u används, kommer en UTF-16 BOM att skrivas.

Använd aldrig denna flagga när kodningen för utmatning är något annat än UTF-8, UTF-16 eller GB18030. Se vidare i avsnittet UNICODE.

-n, --newfile INFIL UTFIL …

Nyfilsläge. Konvertera filen INFIL och skriv utfilen UTFIL. Filnamnen måste ange i par och jokertecken i namnen ska inte användas annars kommer du att förlora filer.

Användaren som påbörjar konverteringen i nyfilsläge (parat läge) kommer att bli ägaren till den konverterade filen. Läs-/skrivbehörigheter för den nya filen kommer att vara samma behörigheter som för originalfilen minus umask(1) för användaren som kör konverteringen.

-o, --oldfile FIL …

Gammalfilsläge. Konvertera filen FIL och skriv över den med utmatningen. Programmet kör i detta läge som standard. Jokertecken i filnamn får användas.

I gammalfilsläge (på-plats läge) kommer den konverterade filen att få samma ägare, grupp samt läs-/skrivbehörigheter som originalfilen. Även då filen konverteras av en annan användare som har skrivbehörighet för filen (t.ex. användaren root). Konverteringen kommer att avbrytas när det inte är möjligt att bevara originalvärdena. Byte av ägare skulle kunna innebära att originalägaren inte längre kan läsa filen. Byte av grupp skulle kunna vara en säkerhetsrisk, filen skulle kunna bli läsbar för användare som den inte är avsedd för. Stöd för bevarande av ägare, grupp och läs-/skrivbehörigheter finns bara i Unix.

-q, --quiet

Tyst drift. Undertryck alla varningar och meddelanden. Returvärdet är noll. Utom när felaktiga kommandoradsflaggor används.

-r, --remove-bom

Ta bort byteordningsmarkering (Byte Order Mark, BOM). Skriv inte en BOM i utfilen. Detta är standardbeteende vid konvertering av Unix-radbrytningar. Se vidare flaggan -b.

-s, --safe

Hoppa över binära filer (standard).

Binärfiler hoppas över för att undvika oavsiktliga misstag. Var medveten om att detektering av binärfiler inte är 100% säker. Infiler genomsöks efter binära symboler som typiskt inte återfinns i textfiler. Det är möjligt att en binärfil enbart innehåller texttecken. En sådan binärfil kommer oavsiktligt att ses som en textfil.

-u, --keep-utf16

Behåll infilens original UTF-16-kodning. Utfilen kommer att skrivas med samma UTF-16-kodning som infilen, omvänd eller rak byteordning (little eller big endian). Detta förhindrar transformation till UTF-8. En UTF-16 BOM kommer att skrivas i enlighet med detta. Denna flagga kan inaktiveras med -ascii-flaggan.

-ul, --assume-utf16le

Antag att infilsformatet är UTF-16LE.

När det finns en byteordningsmarkering (Byte Order Mark) i infilen så har BOM:en högre prioritet än denna flagga.

När du har gjort fel antagande (infilen var inte i UTF-16LE-format) och konverteringens lyckas, kommer du att få en UTF-8 utfil med felaktig text. Du kan göra denna konvertering ogjord med iconv(1) genom att konvertera UTF-8 utfilen tillbaka till UTF-16LE. Detta kommer att återskapa originalfilen.

Antagandet om UTF-16LE fungerar som ett konverteringsläge. Genom att växla till standard ascii-läget kommer UTF-16LE antagandet att stängas av.

-ub, --assume-utf16be

Antag att infilsformatet är UTF-16BE.

Denna flagga fungerar på samma sätt som flaggan -ul.

-v, --verbose

Visa utförliga meddelanden. Extra information visas om byteordningsmarkeringar och antalet konverterade radbrytningar.

Följ symboliska länkar och konvertera målen.

Ersätt symboliska länkar med konverterade filer (originalmålfilerna förblir oförändrade).

Behåll symboliska länkar och mål oförändrade (standard).

-V, --version

Visa versionsinformation och avsluta.

MAC-LÄGE

I normalläge konverteras radbrytningar från DOS till Unix och vice versa. Mac-radbrytningar konverteras inte.

I Mac-läge konverteras radbrytningar från Mac till Unix och vice versa. DOS-radbrytningar ändras ej.

För att köra i Mac-läge använd kommandoradsflaggan -c mac eller använd kommandona mac2unix eller unix2mac.

KONVERTERINGSLÄGEN

ascii

I läget ascii konverteras enbart radbrytningar. Detta är standardkonverteringsläget.

Även om namnet på detta läge är ASCII, vilket är en 7-bitarsstandard, så är det läget egentligen ett 8-bitarsläge. Använd alltid detta läge vid konvertering av Unicode UTF-8-filer.

7bit

I detta läge konverteras alla 8-bitars icke-ASCII tecken (med värden från 128 till 255) till ett 7-bitars blanksteg.

iso

Tecken konverteras mellan DOS teckenuppsättning (teckentabell) och ISO teckenuppsättning ISO-8859-1 (Latin-1) på Unix. DOS tecken utan motsvarande ISO-8859-1 tecken, för vilka konvertering är omöjligt, kommer att ersättas med en punkt. Detsamma gäller för ISO-8859-1 tecken utan motsvarighet i DOS.

När enbart flaggan -iso används kommer dos2unix att försöka avgöra den aktiva teckentabellen. När detta inte är möjligt kommer dos2unix att använda standardteckentabellen CP437, vilken huvudsakligen används i USA. För att tvinga en specifik teckentabell använd flaggorna -437 (USA), -850 (Västeuropeisk), -860 (Portugisisk), -863 (Fransk-kanadensisk) eller -865 (Nordisk). Det finns också stöd för Windows-teckentabell CP-1252 (Västeuropeisk) via flaggan -1252. För andra teckentabeller använd dos2unix i kombination med iconv(1). iconv kan konvertera mellan en lång lista av teckenkodningar.

Använd aldrig ISO-konvertering på Unicode-textfiler. Det kommer att korrumpera UTF-8-kodade filer.

Några exempel:

Konvertera från DOS standardteckentabell till Unix Latin-1:

    dos2unix -iso -n in.txt ut.txt

Konvertera från DOS CP850 till Unix Latin-1:

    dos2unix -850 -n in.txt ut.txt

Konvertera från Windows CP1252 till Unix Latin-1:

    dos2unix -1252 -n in.txt ut.txt

Konvertera från Windows CP1252 till Unix UTF-8 (Unicode):

    iconv -f CP1252 -t UTF-8 in.txt | dos2unix > ut.txt

Konvertera från Unix Latin-1 till DOS-standardteckentabell:

    unix2dos -iso -n in.txt ut.txt

Konvertera från Unix Latin-1 till DOS CP850:

    unix2dos -850 -n in.txt ut.txt

Konvertera från Unix Latin-1 till Windows CP1252:

    unix2dos -1252 -n in.txt ut.txt

Konvertera från Unix UTF-8 (Unicode) till Windows CP1252:

    unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > ut.txt

Se även http://czyborra.com/charsets/codepages.html och http://czyborra.com/charsets/iso8859.html.

UNICODE

Kodningar

Det finns flera olika Unicode kodningar. I Unix och Linux kodas filer vanligtvis med UTF-8-kodning. I Windows kan Unicode-textfiler kodas i UTF-8, UTF-16 eller UTF-16 rak byteordning (big endian), men kodas mestadels i UTF-16-format.

Konvertering

Unicode-textfiler kan ha DOS, Unix eller Mac-radbrytningar precis som vanliga textfiler.

Alla versioner av dos2unix och unix2dos kan konvertera UTF-8-kodade filer, eftersom UTF-8 designades för bakåtkompatibilitet med ASCII.

Dos2unix och unix2dos med Unicode-UTF-16-stöd, kan läsa UTF-16-kodade textfiler i omvänd och rak byteordning (little och big endian). För att se om dos2unix byggts med UTF-16-stöd skriv dos2unix -V.

Under Unix/Linux kommer UTF-16-kodade filer att konverteras till lokalens teckenkodning. Använd kommandot locale(1) för att ta reda på vilken lokalens teckenkodning är. När konvertering inte är möjlig kommer ett konverteringsfel att inträffa och filen kommer att hoppas över.

Under Windows konverteras UTF-16-filer som standard till UTF-8. UTF-8-formaterade textfiler har bra stöd både under Windows och Unix/Linux.

UTF-16- och UTF-8-kodning är fullt kompatibla, ingen text kommer att gå förlorad i konverteringen. När ett UTF-16 till UTF-8-konverteringsfel uppstår, till exempel när infilen i UTF-16-format innehåller ett fel, kommer att filen att hoppas över.

När flaggan -u används kommer utfilen att skrivas med samma UTF-16-kodning som infilen. Flaggan -u förhindrar konvertering till UTF-8.

Dos2unix och unix2dos har ingen flagga för att konvertera UTF-8-filer till UTF-16.

ISO- och 7-bitarslägeskonvertering fungerar inte på UTF-16-filer.

Byteordningsmarkering (Byte Order Mark)

I Windows har Unicode-textfiler typiskt en byteordningsmarkering (Byte Order Mark, BOM) eftersom många Windows-program (inklusive Notepad) lägger till BOM:ar som standard. Se även http://en.wikipedia.org/wiki/Byte_order_mark.

I Unix har Unicode-textfiler typiskt ingen BOM. Filer antas vara kodade i den lokala teckenuppsättningen.

Dos2Unix kan bara detektera om en fil är i UTF-16-format om filen har en BOM. När en UTF-16-fil inte har en BOM så kommer dos2unix att de filen som en binärfil.

Använd flaggan -ul eller -ub för att konvertera en UTF-16-fil utan BOM.

Dos2unix skriver som standard ingen BOM i utfilen. Med flaggan -b kommer Dos2unix att skriva en BOM när infilen har en BOM.

Unix2dos skriver som standard en BOM i utfilen när infilen har en BOM. Använd flaggan -r för att ta bort BOM:en.

Dos2unix och unix2dos skriver alltid en BOM när flaggan -m används.

Unicode-filnamn under Windows

Dos2unix har valfritt stöd för läsning och skrivning av Unicode-filnamn i Windows kommandoprompt. Detta innebär att dos2unix kan öppna filer som har tecken i sina namn som inte är en del av systemets atandard ANSI-teckentabell. För att se om dos2unix för Windows byggdes med stöd för Unicode-filnamn skriv dos2unix -V.

Det finns en del problem med att visa Unicode-filnamn i en Windows-konsol. Se vidare flaggan -D, --display-enc. Filnamnen kan visas felaktigt i konsolen, men filerna som skrivs kommer att ha de korrekta namnen.

Unicode-exempel

Konvertera från Windows UTF-16 (med BOM) till Unix UTF-8:

    dos2unix -n in.txt ut.txt

Konvertera från Windows UTF-16LE (utan BOM) till Unix UTF-8:

    dos2unix -ul -n in.txt ut.txt

Konvertera från Unix UTF-8 till Windows UTF-8 med BOM:

    unix2dos -m -n in.txt ut.txt

Konvertera från Unix UTF-8 till Windows UTF-16:

    unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > ut.txt

GB18030

GB18030 är en standard från Kinesiska regeringen. En obligatorisk delmängd av standarden GB18030 krävs officiellt för alla programvaruprodukter som säljs i Kina. Se vidare http://en.wikipedia.org/wiki/GB_18030.

GB18030 är fullständigt kompatibel med Unicode och kan anses vara ett överföringsformat för unicode. Precis som UTF-8 är GB18030 kompatibel med ASCII. GB18030 är också kompatibel med Windows-teckentabell 936, också känd som GBK.

Under Unix/Linux kommer UTF-16-filer att konverteras till GB18030 när lokalens teckenkodning är inställd på GB18030. Notera att detta endast kommer att fungera om lokalen har stöd i systemet. Använd kommandot locale -a för att få en lista över de lokaler som stöds.

Under Windows måste du använda flaggan -gb för att konvertera UTF-16-filer till GB18030.

GB18030-kodade filer kan ha en byteordningsmarkering, precis som Unicode-filer.

EXEMPEL

Läsa inmatning från “stdin“ och skriv utmatning till “stdout“:

    dos2unix < a.txt
    cat a.txt | dos2unix

Konvertera och ersätta a.txt. Konvertera och ersätt b.txt:

    dos2unix a.txt b.txt
    dos2unix -o a.txt b.txt

Konvertera och ersätt a.txt i ascii-konverteringsläge:

    dos2unix a.txt

Konvertera och ersätt a.txt i ascii-konverteringsläge, konvertera och ersätt b.txt i 7bit-konverteringsläge:

    dos2unix a.txt -c 7bit b.txt
    dos2unix -c ascii a.txt -c 7bit b.txt
    dos2unix -ascii a.txt -7 b.txt

Konvertera a.txt från Mac- till Unix-format:

    dos2unix -c mac a.txt
    mac2unix a.txt

Konvertera a.txt från Unix- till Mac-format:

    unix2dos -c mac a.txt
    unix2mac a.txt

Konvertera och ersätt a.txt medan originalet tidsstämpel behålls:

    dos2unix -k a.txt
    dos2unix -k -o a.txt

Konvertera a.txt och skriv till e.txt:

    dos2unix -n a.txt e.txt

Konvertera a.txt och skriv till e.txt, låt e.txt behålla tidsstämpeln från a.txt:

    dos2unix -k -n a.txt e.txt

Konvertera och ersätt a.txt, konvertera b.txt och skriv till e.txt:

    dos2unix a.txt -n b.txt e.txt
    dos2unix -o a.txt -n b.txt e.txt

Konvertera c.txt och skriv till e.txt, konvertera och ersätt a.txt, konvertera och ersätt b.txt, konvertera d.txt och skriv till f.txt:

    dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt

REKURSIV KONVERTERING

Använd dos2unix i kombination med kommandona find(1) och xargs(1) för att rekursivt konvertera filer i en katalogstruktur. För att till exempel konvertera alla .txt-filer i katalogträdet under den aktuella katalogen skriv:

    find . -name '*.txt' |xargs dos2unix

I en Windows-kommandoprompt kan följande kommando användas:

    for /R %G in (*.txt) do dos2unix "%G"

PowerShell-användare kan använda följande kommando i Windows PowerShell:

    get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}

LOKALISERING

LANG

Det primära språket väljs med miljövariabeln LANG. LANG-variabeln består av flera delas. Den första delen är språkkoden i gemener. Den andra delen är valfri och utgör landskoden i versaler, föregången av ett understreck. Det finns också en valfri tredje del: teckenkodning, föregången av en punkt. Ett par exempel för skal av POSIX-standard-typ:

    export LANG=nl               Nederländska
    export LANG=nl_NL            Nederländska, Nederländerna
    export LANG=nl_BE            Nederländska, Belgien
    export LANG=es_ES            Spanska, Spanien
    export LANG=es_MX            Spanska, Mexiko
    export LANG=en_US.iso88591   Engelska, USA, Latin-1-kodning
    export LANG=en_GB.UTF-8      Engelska, UK, UTF-8-kodning

För en fullständig lista över språk och landskoder se vidare i gettext-manualen: http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

På Unix-system kan du använda kommando locale(1) för att få lokal-specifik information.

LANGUAGE

Med miljövariabeln LANGUAGE kan du ange en prioritetslista över språk, separerade med kolon. Dos2unix kommer att ge företräde till LANGAUGE över LANG. Exempelvis först nederländska och sedan tyska: LANGUAGE=nl:de. Du måste först ha aktiverat lokalisering, genom att sätta LANG (eller LC_ALL) till ett värde annat än “C“, innan du kan använda en prioritetslista för språk via LANGUAGE-variabeln. Se vidare i gettext-manualen: http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

Om du väljer ett språk som inte är tillgänglig kommer du att få engelska meddelanden som standard.

DOS2UNIX_LOCALEDIR

Med miljövariabeln DOS2UNIX_LOCALEDIR kan LOCALEDIR som ställts in vid kompilering åsidosättas. LOCALEDIR används för att hitta språkfiler. Standardvärdet för GNU-program är /usr/local/share/locale. Flaggan --version kommer att visa vilken LOCALEDIR som används.

Exempel (POSIX-skal):

    export DOS2UNIX_LOCALEDIR=$HOME/share/locale

RETURVÄRDE

Om allt går bra kommer noll att returneras. När ett systemfel uppstår kommer det senaste systemfelet att returneras. För andra fel kommer 1 att returneras.

Returvärdet är alltid noll i tyst läge, utom när felaktiga kommandoradsflaggor används.

STANDARDER

http://en.wikipedia.org/wiki/Text_file

http://en.wikipedia.org/wiki/Carriage_return

http://en.wikipedia.org/wiki/Newline

http://en.wikipedia.org/wiki/Unicode

FÖRFATTARE

Benjamin Lin - <blin@socs.uts.edu.au>, Bernd Johannes Wuebben (mac2unix-läge) - <wuebben@kde.org>, Christian Wurll (lägg till en extra radbrytning) - <wurll@ira.uka.de>, Erwin Waterlander - <waterlan@xs4all.nl> (upphovsman)

Projektsida: http://waterlan.home.xs4all.nl/dos2unix.html

SourceForge-sida: http://sourceforge.net/projects/dos2unix/

SE ÄVEN

file(1) find(1) iconv(1) locale(1) xargs(1)

dos2unix-7.3.4/man/sv/man1/dos2unix.pod0000644000175500010010000006360412721132556017102 0ustar waterlanGeen ***************************************************** * GENERATED FILE, DO NOT EDIT * * THIS IS NO SOURCE FILE, BUT RESULT OF COMPILATION * ***************************************************** This file was generated by po4a(7). Do not store it (in VCS, for example), but store the PO file used as source file by po4a-translate. In fact, consider this as a binary, and the PO file as a regular .c file: If the PO get lost, keeping this translation up-to-date will be harder. =pod =encoding UTF-8 =head1 NAMN dos2unix - konverterare för textfilsformat från DOS/Mac till Unix och vice versa =head1 SYNOPSIS dos2unix [flaggor] [FIL …] [-n INFIL UTFIL …] unix2dos [flaggor] [FIL …] [-n INFIL UTFIL …] =head1 BESKRIVNING Paketet Dos2unix inkluderar verktygen C och C som konverterar oformaterade textfiler i DOS- eller Mac-format till Unix-format och vice versa. Textfiler i DOS/Windows har en radbrytning, också känd som nyrad, som är en kombination av två tecken: vagnretur (Carriage Return, CR) åtföljt av radmatning (Line Feed, LF). Textfiler i Unix har en radbrytning som är ett enda tecken: radmatning (Line Feed, LF). Textfiler för Mac, innan Mac OS X, hade en radbrytning som var en enda vagnretur (Carriage Return, CR). Numera använder Mac OS radbrytning i Unix-stil (LF). Förutom radbrytningar så kan Dos2unix också konvertera filers kodning. Några DOS-teckentabeller kan konverteras till Unix Latin-1. Och filer som använder Windows Unicode (UTF-16) kan konverteras till Unix Unicode (UTF-8). Binära filer hoppas över automatiskt, om inte konvertering tvingas. Kataloger och FIFOs och andra filer som inte är vanliga filer hoppas över automatiskt. Symboliska länkar och deras mål förblir oförändrade som standard. Symboliska länkar kan valfritt bli ersatta eller så kan utmatningen skrivas till målet för den symboliska länken. På Windows saknas stöd för att skriva till målet för en symbolisk länk. Dos2unix modellerades efter dos2unix från SunOS/Solaris. Det finns en viktig skillnad gentemot originalversionen för SunOS/Solaris. Denna versionen gör som standard konverteringen på plats (gammalfilsläge), medan originalversionen från SunOS/Solaris bara hade stöd för parad konvertering (nyfilsläge). Se vidare flaggorna C<-o> och C<-n>. En annan skillnad är att SunOS/Solaris-versionen som standard använder I-lägeskonvertering medan denna version som standard använder I-lägeskonvertering. =head1 FLAGGOR =over 4 =item B<--> Behandla alla efterföljande flaggor som filnamn. Använd denna flagga om du vill konvertera filer vars namn börjar med bindestreck. För att till exempel konvertera en fil med namnet “-foo“ kan du använda detta kommando: dos2unix -- -foo Eller i nyfilsläge: dos2unix -n -- -foo out.txt =item B<-ascii> Konvertera enbart radbrytningar. Detta är standardkonverteringsläget. =item B<-iso> Konvertering mellan DOS- och ISO-8859-1-teckentabeller. Se vidare stycket KONVERTERINGSLÄGEN. =item B<-1252> Använd Windows-teckentabell 1252 (Västeuropeisk). =item B<-437> Använd DOS-teckentabell 437 (USA). Detta är standardteckentabellen som används för ISO-konvertering. =item B<-850> Använd DOS-teckentabell 850 (Västeuropeisk). =item B<-860> Använd DOS-teckentabell 860 (Portugisisk). =item B<-863> Använd DOS-teckentabell 863 (Fransk-kanadensisk). =item B<-865> Använd DOS-teckentabell 865 (Nordisk). =item B<-7> Konvertera 8-bitars tecken till 7-bitars blanksteg. =item B<-b, --keep-bom> Behåll byteordningsmarkering (Byte Order Mark, BOM). Om infilen har en BOM, skriv en BOM i utfilen. Detta är standardbeteendet vid konvertering av DOS-radbrytningar. Se vidare flaggan C<-r>. =item B<-c, --convmode KONVERTERINGSLÄGE> Ställer in konverteringsläge. Där KONVERTERINGSLÄGE är en av: I, I<7bit>, I, I där ascii är standard. =item B<-D, --display-enc KODNING> Ställ in kodning för visad text. Där KODNING är en av: I, I, I, I, I där ansi är standardvalet. Denna flagga finns bara tillgänglig i dos2unix för Windows med stöd för Unicode-filnamn. Denna flagga har ingen effekt på själva filnamnen som läses och skrivs, bara på hur de visas. Det finns flera metoder för att visa text i en Windows-konsol baserad på vilken kodning texten har. De har alla för- och nackdelar. =over 4 =item B Dos2unix standardmetod är att använda ANSI-kodad text. Fördelen är att den är bakåtkompatibel. Det fungerar med raster- och TrueType-teckensnitt. I vissa regioner kan du behöva ändra den aktiva DOS OEM-teckentabellen till Windows-systemets ANSI-teckentabell genom att använda kommandot C, eftersom dos2unix använder Windows-systemets teckentabell. Nackdelen med ansi är att internationella filnamn med tecken som inte finns i systemets standardteckentabell inte visas korrekt. Du kommer att se frågetecken, eller en felaktig symbol istället. När du inte arbetar med utländska filnamn är denna metoden OK. =item B Fördelen med unicode-kodning (Windows-namnet för UTF-16) är att text vanligtvis visas korrekt. Det finns inget behov av att ändra den aktiva teckentabellen. Du kan behöva ställa in konsolens teckensnitt till ett TrueType-teckensnitt för att få internationella tecken att visas korrekt. När ett tecken inte finns inkluderat i TrueType-teckensnittet kommer du vanligtvis att se en liten ruta, ibland med ett frågetecken inuti. När du använder ConEmu-konsolen kommer all text att visas korrekt eftersom ConEmu automatiskt väljer ett bra teckensnitt. Nackdelen med unicode är att den inte är kompatibel med ASCII. Utmatningen är inte lätt att hantera när du omdirigerar den till ett annat program eller en fil. När metod C används kommer Unicode-texten att föregås av en BOM (byteordningsmarkering, Byte Order Mark). En BOM krävs för korrekt omdirigering eller rörledning i PowerShell. =item B Fördelen med utf8 är att den är kompatibel med ASCII. Du måste ställa in konsolens teckensnitt till ett TrueType-teckensnitt. Med ett TrueType-teckensnitt kommer text att visas på liknande sätt som med C-kodningen. Nackdelen är att när du använder standardrasterteckensnittet kommer alla icke-ASCII tecken att visas fel. Inte enbart unicode-filnamn, utan också översatta meddelanden kommer att bli oläsbara. Under Windows som konfigurerats för Östasien kan man komma att se många blinkningar i konsolen när meddelanden visas. I ConEmu-konsolen fungerar utf8-kodningsmetoden väl. När metod C används kommer UTF-8-texten att föregås av en BOM (byteordningsmarkering, Byte Order Mark). En BOM krävs för korrekt omdirigering eller rörledning i PowerShell. =back Standardkodningen kan ändras via miljövariabeln DOS2UNIX_DISPLAY_ENC genom att sätta den till C, C, C or C. =item B<-f, --force> Tvinga konvertering av binära filer. =item B<-gb, --gb18030> Under Windows konverteras UTF-16-filer som standard till UTF-8, oavsett vilken lokalinställning som är gjord. Använd denna flagga för att konvertera UTF-16-filer till GB18030. Denna flagga finns bara tillgänglig i Windows. Se vidare i avsnittet GB18030. =item B<-h, --help> Visa hjälptext och avsluta. =item B<-i[FLAGGOR], --info[=FLAGGOR] FIL ...> Visa filinformation. Ingen konvertering görs. Följande information skrivs ut, i denna ordningen: antal DOS-radbrytningar, antal Unix-radbrytningar, antal Mac-radbrytningar, byteordningsmarkeringen, text eller binär, filnamn. Exempelutmatning: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binär dos2unix.exe Notera att en binärfil ibland kan misstas för en textfil. Se vidare flaggan C<-s>. Extra flaggor kan användas valfritt för att ändra utmatningen. En eller fler flaggor kan läggas till. =over 4 =item B Skriv ut antal DOS-radbrytningar. =item B Skriv ut antal Unix-radbrytningar. =item B Skriv ut antal Mac-radbrytningar. =item B Skriv ut byteordningsmarkeringen. =item B Skriv ut om filen är text eller binär. =item B Skriv bara ut filerna som skulle ha konverterats. Med C-flaggan kommer dos2unix att skriva ut filerna som innehåller DOS-radbrytningar, unix2dos kommer bara att skriva ut filnamn som har Unix-radbrytningar. =item B Skriv ut rubrik. =item B

Visa filnamn utan sökväg. =back Exempel: Visa information för alla *.txt-filer: dos2unix -i *.txt Visa bara antalet DOS-radbrytningar och Unix-radbrytningar: dos2unix -idu *.txt Visa bara byteordningsmarkeringen: dos2unix --info=b *.txt Lista filerna som har DOS-radbrytningar: dos2unix -ic *.txt Lista filerna som har Unix-radbrytningar: unix2dos -ic *.txt Konvertera endast filer som har DOS-radbrytningar och lämna övriga filer orörda: dos2unix -ic *.txt | xargs dos2unix Hitta textfiler som har DOS-radbrytningar: find -name '*.txt' | xargs dos2unix -ic =item B<-k, --keepdate> Behåll infilens datumstämpel för utfilen. =item B<-L, --license> Visa programmets licens. =item B<-l, --newline> Lägg till ytterligare nyrad. B: Endast DOS-radbrytningar ändras till två Unix-radbrytningar. I Mac-läge ändras endast Mac-radbrytningar till två Unix-radbrytningar. B: Endast Unix-radbrytningar ändras till två DOS-radbrytningar. I Mac-läge ändras Unix-radbrytningar till två Mac-radbrytningar. =item B<-m, --add-bom> Skriv en byteordningsmarkering (Byte Order Mark, BOM) i utfilen. Som standard skrivs en UTF-8 BOM. När infilen är UTF-16, och flaggan C<-u> används, kommer en UTF-16 BOM att skrivas. Använd aldrig denna flagga när kodningen för utmatning är något annat än UTF-8, UTF-16 eller GB18030. Se vidare i avsnittet UNICODE. =item B<-n, --newfile INFIL UTFIL …> Nyfilsläge. Konvertera filen INFIL och skriv utfilen UTFIL. Filnamnen måste ange i par och jokertecken i namnen ska I användas annars I du att förlora filer. Användaren som påbörjar konverteringen i nyfilsläge (parat läge) kommer att bli ägaren till den konverterade filen. Läs-/skrivbehörigheter för den nya filen kommer att vara samma behörigheter som för originalfilen minus umask(1) för användaren som kör konverteringen. =item B<-o, --oldfile FIL …> Gammalfilsläge. Konvertera filen FIL och skriv över den med utmatningen. Programmet kör i detta läge som standard. Jokertecken i filnamn får användas. I gammalfilsläge (på-plats läge) kommer den konverterade filen att få samma ägare, grupp samt läs-/skrivbehörigheter som originalfilen. Även då filen konverteras av en annan användare som har skrivbehörighet för filen (t.ex. användaren root). Konverteringen kommer att avbrytas när det inte är möjligt att bevara originalvärdena. Byte av ägare skulle kunna innebära att originalägaren inte längre kan läsa filen. Byte av grupp skulle kunna vara en säkerhetsrisk, filen skulle kunna bli läsbar för användare som den inte är avsedd för. Stöd för bevarande av ägare, grupp och läs-/skrivbehörigheter finns bara i Unix. =item B<-q, --quiet> Tyst drift. Undertryck alla varningar och meddelanden. Returvärdet är noll. Utom när felaktiga kommandoradsflaggor används. =item B<-r, --remove-bom> Ta bort byteordningsmarkering (Byte Order Mark, BOM). Skriv inte en BOM i utfilen. Detta är standardbeteende vid konvertering av Unix-radbrytningar. Se vidare flaggan C<-b>. =item B<-s, --safe> Hoppa över binära filer (standard). Binärfiler hoppas över för att undvika oavsiktliga misstag. Var medveten om att detektering av binärfiler inte är 100% säker. Infiler genomsöks efter binära symboler som typiskt inte återfinns i textfiler. Det är möjligt att en binärfil enbart innehåller texttecken. En sådan binärfil kommer oavsiktligt att ses som en textfil. =item B<-u, --keep-utf16> Behåll infilens original UTF-16-kodning. Utfilen kommer att skrivas med samma UTF-16-kodning som infilen, omvänd eller rak byteordning (little eller big endian). Detta förhindrar transformation till UTF-8. En UTF-16 BOM kommer att skrivas i enlighet med detta. Denna flagga kan inaktiveras med C<-ascii>-flaggan. =item B<-ul, --assume-utf16le> Antag att infilsformatet är UTF-16LE. När det finns en byteordningsmarkering (Byte Order Mark) i infilen så har BOM:en högre prioritet än denna flagga. När du har gjort fel antagande (infilen var inte i UTF-16LE-format) och konverteringens lyckas, kommer du att få en UTF-8 utfil med felaktig text. Du kan göra denna konvertering ogjord med iconv(1) genom att konvertera UTF-8 utfilen tillbaka till UTF-16LE. Detta kommer att återskapa originalfilen. Antagandet om UTF-16LE fungerar som ett I. Genom att växla till standard I-läget kommer UTF-16LE antagandet att stängas av. =item B<-ub, --assume-utf16be> Antag att infilsformatet är UTF-16BE. Denna flagga fungerar på samma sätt som flaggan C<-ul>. =item B<-v, --verbose> Visa utförliga meddelanden. Extra information visas om byteordningsmarkeringar och antalet konverterade radbrytningar. =item B<-F, --follow-symlink> Följ symboliska länkar och konvertera målen. =item B<-R, --replace-symlink> Ersätt symboliska länkar med konverterade filer (originalmålfilerna förblir oförändrade). =item B<-S, --skip-symlink> Behåll symboliska länkar och mål oförändrade (standard). =item B<-V, --version> Visa versionsinformation och avsluta. =back =head1 MAC-LÄGE I normalläge konverteras radbrytningar från DOS till Unix och vice versa. Mac-radbrytningar konverteras inte. I Mac-läge konverteras radbrytningar från Mac till Unix och vice versa. DOS-radbrytningar ändras ej. För att köra i Mac-läge använd kommandoradsflaggan C<-c mac> eller använd kommandona C eller C. =head1 KONVERTERINGSLÄGEN =over 4 =item B I läget C konverteras enbart radbrytningar. Detta är standardkonverteringsläget. Även om namnet på detta läge är ASCII, vilket är en 7-bitarsstandard, så är det läget egentligen ett 8-bitarsläge. Använd alltid detta läge vid konvertering av Unicode UTF-8-filer. =item B<7bit> I detta läge konverteras alla 8-bitars icke-ASCII tecken (med värden från 128 till 255) till ett 7-bitars blanksteg. =item B Tecken konverteras mellan DOS teckenuppsättning (teckentabell) och ISO teckenuppsättning ISO-8859-1 (Latin-1) på Unix. DOS tecken utan motsvarande ISO-8859-1 tecken, för vilka konvertering är omöjligt, kommer att ersättas med en punkt. Detsamma gäller för ISO-8859-1 tecken utan motsvarighet i DOS. När enbart flaggan C<-iso> används kommer dos2unix att försöka avgöra den aktiva teckentabellen. När detta inte är möjligt kommer dos2unix att använda standardteckentabellen CP437, vilken huvudsakligen används i USA. För att tvinga en specifik teckentabell använd flaggorna C<-437> (USA), C<-850> (Västeuropeisk), C<-860> (Portugisisk), C<-863> (Fransk-kanadensisk) eller C<-865> (Nordisk). Det finns också stöd för Windows-teckentabell CP-1252 (Västeuropeisk) via flaggan C<-1252>. För andra teckentabeller använd dos2unix i kombination med iconv(1). iconv kan konvertera mellan en lång lista av teckenkodningar. Använd aldrig ISO-konvertering på Unicode-textfiler. Det kommer att korrumpera UTF-8-kodade filer. Några exempel: Konvertera från DOS standardteckentabell till Unix Latin-1: dos2unix -iso -n in.txt ut.txt Konvertera från DOS CP850 till Unix Latin-1: dos2unix -850 -n in.txt ut.txt Konvertera från Windows CP1252 till Unix Latin-1: dos2unix -1252 -n in.txt ut.txt Konvertera från Windows CP1252 till Unix UTF-8 (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > ut.txt Konvertera från Unix Latin-1 till DOS-standardteckentabell: unix2dos -iso -n in.txt ut.txt Konvertera från Unix Latin-1 till DOS CP850: unix2dos -850 -n in.txt ut.txt Konvertera från Unix Latin-1 till Windows CP1252: unix2dos -1252 -n in.txt ut.txt Konvertera från Unix UTF-8 (Unicode) till Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > ut.txt Se även L och L. =back =head1 UNICODE =head2 Kodningar Det finns flera olika Unicode kodningar. I Unix och Linux kodas filer vanligtvis med UTF-8-kodning. I Windows kan Unicode-textfiler kodas i UTF-8, UTF-16 eller UTF-16 rak byteordning (big endian), men kodas mestadels i UTF-16-format. =head2 Konvertering Unicode-textfiler kan ha DOS, Unix eller Mac-radbrytningar precis som vanliga textfiler. Alla versioner av dos2unix och unix2dos kan konvertera UTF-8-kodade filer, eftersom UTF-8 designades för bakåtkompatibilitet med ASCII. Dos2unix och unix2dos med Unicode-UTF-16-stöd, kan läsa UTF-16-kodade textfiler i omvänd och rak byteordning (little och big endian). För att se om dos2unix byggts med UTF-16-stöd skriv C. Under Unix/Linux kommer UTF-16-kodade filer att konverteras till lokalens teckenkodning. Använd kommandot locale(1) för att ta reda på vilken lokalens teckenkodning är. När konvertering inte är möjlig kommer ett konverteringsfel att inträffa och filen kommer att hoppas över. Under Windows konverteras UTF-16-filer som standard till UTF-8. UTF-8-formaterade textfiler har bra stöd både under Windows och Unix/Linux. UTF-16- och UTF-8-kodning är fullt kompatibla, ingen text kommer att gå förlorad i konverteringen. När ett UTF-16 till UTF-8-konverteringsfel uppstår, till exempel när infilen i UTF-16-format innehåller ett fel, kommer att filen att hoppas över. När flaggan C<-u> används kommer utfilen att skrivas med samma UTF-16-kodning som infilen. Flaggan C<-u> förhindrar konvertering till UTF-8. Dos2unix och unix2dos har ingen flagga för att konvertera UTF-8-filer till UTF-16. ISO- och 7-bitarslägeskonvertering fungerar inte på UTF-16-filer. =head2 Byteordningsmarkering (Byte Order Mark) I Windows har Unicode-textfiler typiskt en byteordningsmarkering (Byte Order Mark, BOM) eftersom många Windows-program (inklusive Notepad) lägger till BOM:ar som standard. Se även L. I Unix har Unicode-textfiler typiskt ingen BOM. Filer antas vara kodade i den lokala teckenuppsättningen. Dos2Unix kan bara detektera om en fil är i UTF-16-format om filen har en BOM. När en UTF-16-fil inte har en BOM så kommer dos2unix att de filen som en binärfil. Använd flaggan C<-ul> eller C<-ub> för att konvertera en UTF-16-fil utan BOM. Dos2unix skriver som standard ingen BOM i utfilen. Med flaggan C<-b> kommer Dos2unix att skriva en BOM när infilen har en BOM. Unix2dos skriver som standard en BOM i utfilen när infilen har en BOM. Använd flaggan C<-r> för att ta bort BOM:en. Dos2unix och unix2dos skriver alltid en BOM när flaggan C<-m> används. =head2 Unicode-filnamn under Windows Dos2unix har valfritt stöd för läsning och skrivning av Unicode-filnamn i Windows kommandoprompt. Detta innebär att dos2unix kan öppna filer som har tecken i sina namn som inte är en del av systemets atandard ANSI-teckentabell. För att se om dos2unix för Windows byggdes med stöd för Unicode-filnamn skriv C. Det finns en del problem med att visa Unicode-filnamn i en Windows-konsol. Se vidare flaggan C<-D>, C<--display-enc>. Filnamnen kan visas felaktigt i konsolen, men filerna som skrivs kommer att ha de korrekta namnen. =head2 Unicode-exempel Konvertera från Windows UTF-16 (med BOM) till Unix UTF-8: dos2unix -n in.txt ut.txt Konvertera från Windows UTF-16LE (utan BOM) till Unix UTF-8: dos2unix -ul -n in.txt ut.txt Konvertera från Unix UTF-8 till Windows UTF-8 med BOM: unix2dos -m -n in.txt ut.txt Konvertera från Unix UTF-8 till Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > ut.txt =head1 GB18030 GB18030 är en standard från Kinesiska regeringen. En obligatorisk delmängd av standarden GB18030 krävs officiellt för alla programvaruprodukter som säljs i Kina. Se vidare L. GB18030 är fullständigt kompatibel med Unicode och kan anses vara ett överföringsformat för unicode. Precis som UTF-8 är GB18030 kompatibel med ASCII. GB18030 är också kompatibel med Windows-teckentabell 936, också känd som GBK. Under Unix/Linux kommer UTF-16-filer att konverteras till GB18030 när lokalens teckenkodning är inställd på GB18030. Notera att detta endast kommer att fungera om lokalen har stöd i systemet. Använd kommandot C för att få en lista över de lokaler som stöds. Under Windows måste du använda flaggan C<-gb> för att konvertera UTF-16-filer till GB18030. GB18030-kodade filer kan ha en byteordningsmarkering, precis som Unicode-filer. =head1 EXEMPEL Läsa inmatning från “stdin“ och skriv utmatning till “stdout“: dos2unix < a.txt cat a.txt | dos2unix Konvertera och ersätta a.txt. Konvertera och ersätt b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Konvertera och ersätt a.txt i ascii-konverteringsläge: dos2unix a.txt Konvertera och ersätt a.txt i ascii-konverteringsläge, konvertera och ersätt b.txt i 7bit-konverteringsläge: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Konvertera a.txt från Mac- till Unix-format: dos2unix -c mac a.txt mac2unix a.txt Konvertera a.txt från Unix- till Mac-format: unix2dos -c mac a.txt unix2mac a.txt Konvertera och ersätt a.txt medan originalet tidsstämpel behålls: dos2unix -k a.txt dos2unix -k -o a.txt Konvertera a.txt och skriv till e.txt: dos2unix -n a.txt e.txt Konvertera a.txt och skriv till e.txt, låt e.txt behålla tidsstämpeln från a.txt: dos2unix -k -n a.txt e.txt Konvertera och ersätt a.txt, konvertera b.txt och skriv till e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Konvertera c.txt och skriv till e.txt, konvertera och ersätt a.txt, konvertera och ersätt b.txt, konvertera d.txt och skriv till f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 REKURSIV KONVERTERING Använd dos2unix i kombination med kommandona find(1) och xargs(1) för att rekursivt konvertera filer i en katalogstruktur. För att till exempel konvertera alla .txt-filer i katalogträdet under den aktuella katalogen skriv: find . -name '*.txt' |xargs dos2unix I en Windows-kommandoprompt kan följande kommando användas: for /R %G in (*.txt) do dos2unix "%G" PowerShell-användare kan använda följande kommando i Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} =head1 LOKALISERING =over 4 =item B Det primära språket väljs med miljövariabeln LANG. LANG-variabeln består av flera delas. Den första delen är språkkoden i gemener. Den andra delen är valfri och utgör landskoden i versaler, föregången av ett understreck. Det finns också en valfri tredje del: teckenkodning, föregången av en punkt. Ett par exempel för skal av POSIX-standard-typ: export LANG=nl Nederländska export LANG=nl_NL Nederländska, Nederländerna export LANG=nl_BE Nederländska, Belgien export LANG=es_ES Spanska, Spanien export LANG=es_MX Spanska, Mexiko export LANG=en_US.iso88591 Engelska, USA, Latin-1-kodning export LANG=en_GB.UTF-8 Engelska, UK, UTF-8-kodning För en fullständig lista över språk och landskoder se vidare i gettext-manualen: L På Unix-system kan du använda kommando locale(1) för att få lokal-specifik information. =item B Med miljövariabeln LANGUAGE kan du ange en prioritetslista över språk, separerade med kolon. Dos2unix kommer att ge företräde till LANGAUGE över LANG. Exempelvis först nederländska och sedan tyska: C. Du måste först ha aktiverat lokalisering, genom att sätta LANG (eller LC_ALL) till ett värde annat än “C“, innan du kan använda en prioritetslista för språk via LANGUAGE-variabeln. Se vidare i gettext-manualen: L Om du väljer ett språk som inte är tillgänglig kommer du att få engelska meddelanden som standard. =item B Med miljövariabeln DOS2UNIX_LOCALEDIR kan LOCALEDIR som ställts in vid kompilering åsidosättas. LOCALEDIR används för att hitta språkfiler. Standardvärdet för GNU-program är C. Flaggan B<--version> kommer att visa vilken LOCALEDIR som används. Exempel (POSIX-skal): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 RETURVÄRDE Om allt går bra kommer noll att returneras. När ett systemfel uppstår kommer det senaste systemfelet att returneras. För andra fel kommer 1 att returneras. Returvärdet är alltid noll i tyst läge, utom när felaktiga kommandoradsflaggor används. =head1 STANDARDER L L L L =head1 FÖRFATTARE Benjamin Lin - , Bernd Johannes Wuebben (mac2unix-läge) - , Christian Wurll (lägg till en extra radbrytning) - , Erwin Waterlander - (upphovsman) Projektsida: L SourceForge-sida: L =head1 SE ÄVEN file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/sv/man1/dos2unix.txt0000644000175500010010000006726412721132570017141 0ustar waterlanGeenNAMN dos2unix - konverterare för textfilsformat från DOS/Mac till Unix och vice versa SYNOPSIS dos2unix [flaggor] [FIL …] [-n INFIL UTFIL …] unix2dos [flaggor] [FIL …] [-n INFIL UTFIL …] BESKRIVNING Paketet Dos2unix inkluderar verktygen "dos2unix" och "unix2dos" som konverterar oformaterade textfiler i DOS- eller Mac-format till Unix-format och vice versa. Textfiler i DOS/Windows har en radbrytning, också känd som nyrad, som är en kombination av två tecken: vagnretur (Carriage Return, CR) åtföljt av radmatning (Line Feed, LF). Textfiler i Unix har en radbrytning som är ett enda tecken: radmatning (Line Feed, LF). Textfiler för Mac, innan Mac OS X, hade en radbrytning som var en enda vagnretur (Carriage Return, CR). Numera använder Mac OS radbrytning i Unix-stil (LF). Förutom radbrytningar så kan Dos2unix också konvertera filers kodning. Några DOS-teckentabeller kan konverteras till Unix Latin-1. Och filer som använder Windows Unicode (UTF-16) kan konverteras till Unix Unicode (UTF-8). Binära filer hoppas över automatiskt, om inte konvertering tvingas. Kataloger och FIFOs och andra filer som inte är vanliga filer hoppas över automatiskt. Symboliska länkar och deras mål förblir oförändrade som standard. Symboliska länkar kan valfritt bli ersatta eller så kan utmatningen skrivas till målet för den symboliska länken. På Windows saknas stöd för att skriva till målet för en symbolisk länk. Dos2unix modellerades efter dos2unix från SunOS/Solaris. Det finns en viktig skillnad gentemot originalversionen för SunOS/Solaris. Denna versionen gör som standard konverteringen på plats (gammalfilsläge), medan originalversionen från SunOS/Solaris bara hade stöd för parad konvertering (nyfilsläge). Se vidare flaggorna "-o" och "-n". En annan skillnad är att SunOS/Solaris-versionen som standard använder *iso*-lägeskonvertering medan denna version som standard använder *ascii*-lägeskonvertering. FLAGGOR -- Behandla alla efterföljande flaggor som filnamn. Använd denna flagga om du vill konvertera filer vars namn börjar med bindestreck. För att till exempel konvertera en fil med namnet “-foo“ kan du använda detta kommando: dos2unix -- -foo Eller i nyfilsläge: dos2unix -n -- -foo out.txt -ascii Konvertera enbart radbrytningar. Detta är standardkonverteringsläget. -iso Konvertering mellan DOS- och ISO-8859-1-teckentabeller. Se vidare stycket KONVERTERINGSLÄGEN. -1252 Använd Windows-teckentabell 1252 (Västeuropeisk). -437 Använd DOS-teckentabell 437 (USA). Detta är standardteckentabellen som används för ISO-konvertering. -850 Använd DOS-teckentabell 850 (Västeuropeisk). -860 Använd DOS-teckentabell 860 (Portugisisk). -863 Använd DOS-teckentabell 863 (Fransk-kanadensisk). -865 Använd DOS-teckentabell 865 (Nordisk). -7 Konvertera 8-bitars tecken till 7-bitars blanksteg. -b, --keep-bom Behåll byteordningsmarkering (Byte Order Mark, BOM). Om infilen har en BOM, skriv en BOM i utfilen. Detta är standardbeteendet vid konvertering av DOS-radbrytningar. Se vidare flaggan "-r". -c, --convmode KONVERTERINGSLÄGE Ställer in konverteringsläge. Där KONVERTERINGSLÄGE är en av: *ascii*, *7bit*, *iso*, *mac* där ascii är standard. -D, --display-enc KODNING Ställ in kodning för visad text. Där KODNING är en av: *ansi*, *unicode*, *unicodebom*, *utf8*, *utf8bom* där ansi är standardvalet. Denna flagga finns bara tillgänglig i dos2unix för Windows med stöd för Unicode-filnamn. Denna flagga har ingen effekt på själva filnamnen som läses och skrivs, bara på hur de visas. Det finns flera metoder för att visa text i en Windows-konsol baserad på vilken kodning texten har. De har alla för- och nackdelar. ansi Dos2unix standardmetod är att använda ANSI-kodad text. Fördelen är att den är bakåtkompatibel. Det fungerar med raster- och TrueType-teckensnitt. I vissa regioner kan du behöva ändra den aktiva DOS OEM-teckentabellen till Windows-systemets ANSI-teckentabell genom att använda kommandot "chcp", eftersom dos2unix använder Windows-systemets teckentabell. Nackdelen med ansi är att internationella filnamn med tecken som inte finns i systemets standardteckentabell inte visas korrekt. Du kommer att se frågetecken, eller en felaktig symbol istället. När du inte arbetar med utländska filnamn är denna metoden OK. unicode, unicodebom Fördelen med unicode-kodning (Windows-namnet för UTF-16) är att text vanligtvis visas korrekt. Det finns inget behov av att ändra den aktiva teckentabellen. Du kan behöva ställa in konsolens teckensnitt till ett TrueType-teckensnitt för att få internationella tecken att visas korrekt. När ett tecken inte finns inkluderat i TrueType-teckensnittet kommer du vanligtvis att se en liten ruta, ibland med ett frågetecken inuti. När du använder ConEmu-konsolen kommer all text att visas korrekt eftersom ConEmu automatiskt väljer ett bra teckensnitt. Nackdelen med unicode är att den inte är kompatibel med ASCII. Utmatningen är inte lätt att hantera när du omdirigerar den till ett annat program eller en fil. När metod "unicodebom" används kommer Unicode-texten att föregås av en BOM (byteordningsmarkering, Byte Order Mark). En BOM krävs för korrekt omdirigering eller rörledning i PowerShell. utf8, utf8bom Fördelen med utf8 är att den är kompatibel med ASCII. Du måste ställa in konsolens teckensnitt till ett TrueType-teckensnitt. Med ett TrueType-teckensnitt kommer text att visas på liknande sätt som med "unicode"-kodningen. Nackdelen är att när du använder standardrasterteckensnittet kommer alla icke-ASCII tecken att visas fel. Inte enbart unicode-filnamn, utan också översatta meddelanden kommer att bli oläsbara. Under Windows som konfigurerats för Östasien kan man komma att se många blinkningar i konsolen när meddelanden visas. I ConEmu-konsolen fungerar utf8-kodningsmetoden väl. När metod "utf8bom" används kommer UTF-8-texten att föregås av en BOM (byteordningsmarkering, Byte Order Mark). En BOM krävs för korrekt omdirigering eller rörledning i PowerShell. Standardkodningen kan ändras via miljövariabeln DOS2UNIX_DISPLAY_ENC genom att sätta den till "unicode", "unicodebom", "utf8" or "utf8bom". -f, --force Tvinga konvertering av binära filer. -gb, --gb18030 Under Windows konverteras UTF-16-filer som standard till UTF-8, oavsett vilken lokalinställning som är gjord. Använd denna flagga för att konvertera UTF-16-filer till GB18030. Denna flagga finns bara tillgänglig i Windows. Se vidare i avsnittet GB18030. -h, --help Visa hjälptext och avsluta. -i[FLAGGOR], --info[=FLAGGOR] FIL ... Visa filinformation. Ingen konvertering görs. Följande information skrivs ut, i denna ordningen: antal DOS-radbrytningar, antal Unix-radbrytningar, antal Mac-radbrytningar, byteordningsmarkeringen, text eller binär, filnamn. Exempelutmatning: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binär dos2unix.exe Notera att en binärfil ibland kan misstas för en textfil. Se vidare flaggan "-s". Extra flaggor kan användas valfritt för att ändra utmatningen. En eller fler flaggor kan läggas till. d Skriv ut antal DOS-radbrytningar. u Skriv ut antal Unix-radbrytningar. m Skriv ut antal Mac-radbrytningar. b Skriv ut byteordningsmarkeringen. t Skriv ut om filen är text eller binär. c Skriv bara ut filerna som skulle ha konverterats. Med "c"-flaggan kommer dos2unix att skriva ut filerna som innehåller DOS-radbrytningar, unix2dos kommer bara att skriva ut filnamn som har Unix-radbrytningar. h Skriv ut rubrik. p Visa filnamn utan sökväg. Exempel: Visa information för alla *.txt-filer: dos2unix -i *.txt Visa bara antalet DOS-radbrytningar och Unix-radbrytningar: dos2unix -idu *.txt Visa bara byteordningsmarkeringen: dos2unix --info=b *.txt Lista filerna som har DOS-radbrytningar: dos2unix -ic *.txt Lista filerna som har Unix-radbrytningar: unix2dos -ic *.txt Konvertera endast filer som har DOS-radbrytningar och lämna övriga filer orörda: dos2unix -ic *.txt | xargs dos2unix Hitta textfiler som har DOS-radbrytningar: find -name '*.txt' | xargs dos2unix -ic -k, --keepdate Behåll infilens datumstämpel för utfilen. -L, --license Visa programmets licens. -l, --newline Lägg till ytterligare nyrad. dos2unix: Endast DOS-radbrytningar ändras till två Unix-radbrytningar. I Mac-läge ändras endast Mac-radbrytningar till två Unix-radbrytningar. unix2dos: Endast Unix-radbrytningar ändras till två DOS-radbrytningar. I Mac-läge ändras Unix-radbrytningar till två Mac-radbrytningar. -m, --add-bom Skriv en byteordningsmarkering (Byte Order Mark, BOM) i utfilen. Som standard skrivs en UTF-8 BOM. När infilen är UTF-16, och flaggan "-u" används, kommer en UTF-16 BOM att skrivas. Använd aldrig denna flagga när kodningen för utmatning är något annat än UTF-8, UTF-16 eller GB18030. Se vidare i avsnittet UNICODE. -n, --newfile INFIL UTFIL … Nyfilsläge. Konvertera filen INFIL och skriv utfilen UTFIL. Filnamnen måste ange i par och jokertecken i namnen ska *inte* användas annars *kommer* du att förlora filer. Användaren som påbörjar konverteringen i nyfilsläge (parat läge) kommer att bli ägaren till den konverterade filen. Läs-/skrivbehörigheter för den nya filen kommer att vara samma behörigheter som för originalfilen minus umask(1) för användaren som kör konverteringen. -o, --oldfile FIL … Gammalfilsläge. Konvertera filen FIL och skriv över den med utmatningen. Programmet kör i detta läge som standard. Jokertecken i filnamn får användas. I gammalfilsläge (på-plats läge) kommer den konverterade filen att få samma ägare, grupp samt läs-/skrivbehörigheter som originalfilen. Även då filen konverteras av en annan användare som har skrivbehörighet för filen (t.ex. användaren root). Konverteringen kommer att avbrytas när det inte är möjligt att bevara originalvärdena. Byte av ägare skulle kunna innebära att originalägaren inte längre kan läsa filen. Byte av grupp skulle kunna vara en säkerhetsrisk, filen skulle kunna bli läsbar för användare som den inte är avsedd för. Stöd för bevarande av ägare, grupp och läs-/skrivbehörigheter finns bara i Unix. -q, --quiet Tyst drift. Undertryck alla varningar och meddelanden. Returvärdet är noll. Utom när felaktiga kommandoradsflaggor används. -r, --remove-bom Ta bort byteordningsmarkering (Byte Order Mark, BOM). Skriv inte en BOM i utfilen. Detta är standardbeteende vid konvertering av Unix-radbrytningar. Se vidare flaggan "-b". -s, --safe Hoppa över binära filer (standard). Binärfiler hoppas över för att undvika oavsiktliga misstag. Var medveten om att detektering av binärfiler inte är 100% säker. Infiler genomsöks efter binära symboler som typiskt inte återfinns i textfiler. Det är möjligt att en binärfil enbart innehåller texttecken. En sådan binärfil kommer oavsiktligt att ses som en textfil. -u, --keep-utf16 Behåll infilens original UTF-16-kodning. Utfilen kommer att skrivas med samma UTF-16-kodning som infilen, omvänd eller rak byteordning (little eller big endian). Detta förhindrar transformation till UTF-8. En UTF-16 BOM kommer att skrivas i enlighet med detta. Denna flagga kan inaktiveras med "-ascii"-flaggan. -ul, --assume-utf16le Antag att infilsformatet är UTF-16LE. När det finns en byteordningsmarkering (Byte Order Mark) i infilen så har BOM:en högre prioritet än denna flagga. När du har gjort fel antagande (infilen var inte i UTF-16LE-format) och konverteringens lyckas, kommer du att få en UTF-8 utfil med felaktig text. Du kan göra denna konvertering ogjord med iconv(1) genom att konvertera UTF-8 utfilen tillbaka till UTF-16LE. Detta kommer att återskapa originalfilen. Antagandet om UTF-16LE fungerar som ett *konverteringsläge*. Genom att växla till standard *ascii*-läget kommer UTF-16LE antagandet att stängas av. -ub, --assume-utf16be Antag att infilsformatet är UTF-16BE. Denna flagga fungerar på samma sätt som flaggan "-ul". -v, --verbose Visa utförliga meddelanden. Extra information visas om byteordningsmarkeringar och antalet konverterade radbrytningar. -F, --follow-symlink Följ symboliska länkar och konvertera målen. -R, --replace-symlink Ersätt symboliska länkar med konverterade filer (originalmålfilerna förblir oförändrade). -S, --skip-symlink Behåll symboliska länkar och mål oförändrade (standard). -V, --version Visa versionsinformation och avsluta. MAC-LÄGE I normalläge konverteras radbrytningar från DOS till Unix och vice versa. Mac-radbrytningar konverteras inte. I Mac-läge konverteras radbrytningar från Mac till Unix och vice versa. DOS-radbrytningar ändras ej. För att köra i Mac-läge använd kommandoradsflaggan "-c mac" eller använd kommandona "mac2unix" eller "unix2mac". KONVERTERINGSLÄGEN ascii I läget "ascii" konverteras enbart radbrytningar. Detta är standardkonverteringsläget. Även om namnet på detta läge är ASCII, vilket är en 7-bitarsstandard, så är det läget egentligen ett 8-bitarsläge. Använd alltid detta läge vid konvertering av Unicode UTF-8-filer. 7bit I detta läge konverteras alla 8-bitars icke-ASCII tecken (med värden från 128 till 255) till ett 7-bitars blanksteg. iso Tecken konverteras mellan DOS teckenuppsättning (teckentabell) och ISO teckenuppsättning ISO-8859-1 (Latin-1) på Unix. DOS tecken utan motsvarande ISO-8859-1 tecken, för vilka konvertering är omöjligt, kommer att ersättas med en punkt. Detsamma gäller för ISO-8859-1 tecken utan motsvarighet i DOS. När enbart flaggan "-iso" används kommer dos2unix att försöka avgöra den aktiva teckentabellen. När detta inte är möjligt kommer dos2unix att använda standardteckentabellen CP437, vilken huvudsakligen används i USA. För att tvinga en specifik teckentabell använd flaggorna -437 (USA), -850 (Västeuropeisk), -860 (Portugisisk), -863 (Fransk-kanadensisk) eller -865 (Nordisk). Det finns också stöd för Windows-teckentabell CP-1252 (Västeuropeisk) via flaggan -1252. För andra teckentabeller använd dos2unix i kombination med iconv(1). iconv kan konvertera mellan en lång lista av teckenkodningar. Använd aldrig ISO-konvertering på Unicode-textfiler. Det kommer att korrumpera UTF-8-kodade filer. Några exempel: Konvertera från DOS standardteckentabell till Unix Latin-1: dos2unix -iso -n in.txt ut.txt Konvertera från DOS CP850 till Unix Latin-1: dos2unix -850 -n in.txt ut.txt Konvertera från Windows CP1252 till Unix Latin-1: dos2unix -1252 -n in.txt ut.txt Konvertera från Windows CP1252 till Unix UTF-8 (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > ut.txt Konvertera från Unix Latin-1 till DOS-standardteckentabell: unix2dos -iso -n in.txt ut.txt Konvertera från Unix Latin-1 till DOS CP850: unix2dos -850 -n in.txt ut.txt Konvertera från Unix Latin-1 till Windows CP1252: unix2dos -1252 -n in.txt ut.txt Konvertera från Unix UTF-8 (Unicode) till Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > ut.txt Se även och . UNICODE Kodningar Det finns flera olika Unicode kodningar. I Unix och Linux kodas filer vanligtvis med UTF-8-kodning. I Windows kan Unicode-textfiler kodas i UTF-8, UTF-16 eller UTF-16 rak byteordning (big endian), men kodas mestadels i UTF-16-format. Konvertering Unicode-textfiler kan ha DOS, Unix eller Mac-radbrytningar precis som vanliga textfiler. Alla versioner av dos2unix och unix2dos kan konvertera UTF-8-kodade filer, eftersom UTF-8 designades för bakåtkompatibilitet med ASCII. Dos2unix och unix2dos med Unicode-UTF-16-stöd, kan läsa UTF-16-kodade textfiler i omvänd och rak byteordning (little och big endian). För att se om dos2unix byggts med UTF-16-stöd skriv "dos2unix -V". Under Unix/Linux kommer UTF-16-kodade filer att konverteras till lokalens teckenkodning. Använd kommandot locale(1) för att ta reda på vilken lokalens teckenkodning är. När konvertering inte är möjlig kommer ett konverteringsfel att inträffa och filen kommer att hoppas över. Under Windows konverteras UTF-16-filer som standard till UTF-8. UTF-8-formaterade textfiler har bra stöd både under Windows och Unix/Linux. UTF-16- och UTF-8-kodning är fullt kompatibla, ingen text kommer att gå förlorad i konverteringen. När ett UTF-16 till UTF-8-konverteringsfel uppstår, till exempel när infilen i UTF-16-format innehåller ett fel, kommer att filen att hoppas över. När flaggan "-u" används kommer utfilen att skrivas med samma UTF-16-kodning som infilen. Flaggan "-u" förhindrar konvertering till UTF-8. Dos2unix och unix2dos har ingen flagga för att konvertera UTF-8-filer till UTF-16. ISO- och 7-bitarslägeskonvertering fungerar inte på UTF-16-filer. Byteordningsmarkering (Byte Order Mark) I Windows har Unicode-textfiler typiskt en byteordningsmarkering (Byte Order Mark, BOM) eftersom många Windows-program (inklusive Notepad) lägger till BOM:ar som standard. Se även . I Unix har Unicode-textfiler typiskt ingen BOM. Filer antas vara kodade i den lokala teckenuppsättningen. Dos2Unix kan bara detektera om en fil är i UTF-16-format om filen har en BOM. När en UTF-16-fil inte har en BOM så kommer dos2unix att de filen som en binärfil. Använd flaggan "-ul" eller "-ub" för att konvertera en UTF-16-fil utan BOM. Dos2unix skriver som standard ingen BOM i utfilen. Med flaggan "-b" kommer Dos2unix att skriva en BOM när infilen har en BOM. Unix2dos skriver som standard en BOM i utfilen när infilen har en BOM. Använd flaggan "-r" för att ta bort BOM:en. Dos2unix och unix2dos skriver alltid en BOM när flaggan "-m" används. Unicode-filnamn under Windows Dos2unix har valfritt stöd för läsning och skrivning av Unicode-filnamn i Windows kommandoprompt. Detta innebär att dos2unix kan öppna filer som har tecken i sina namn som inte är en del av systemets atandard ANSI-teckentabell. För att se om dos2unix för Windows byggdes med stöd för Unicode-filnamn skriv "dos2unix -V". Det finns en del problem med att visa Unicode-filnamn i en Windows-konsol. Se vidare flaggan "-D", "--display-enc". Filnamnen kan visas felaktigt i konsolen, men filerna som skrivs kommer att ha de korrekta namnen. Unicode-exempel Konvertera från Windows UTF-16 (med BOM) till Unix UTF-8: dos2unix -n in.txt ut.txt Konvertera från Windows UTF-16LE (utan BOM) till Unix UTF-8: dos2unix -ul -n in.txt ut.txt Konvertera från Unix UTF-8 till Windows UTF-8 med BOM: unix2dos -m -n in.txt ut.txt Konvertera från Unix UTF-8 till Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > ut.txt GB18030 GB18030 är en standard från Kinesiska regeringen. En obligatorisk delmängd av standarden GB18030 krävs officiellt för alla programvaruprodukter som säljs i Kina. Se vidare . GB18030 är fullständigt kompatibel med Unicode och kan anses vara ett överföringsformat för unicode. Precis som UTF-8 är GB18030 kompatibel med ASCII. GB18030 är också kompatibel med Windows-teckentabell 936, också känd som GBK. Under Unix/Linux kommer UTF-16-filer att konverteras till GB18030 när lokalens teckenkodning är inställd på GB18030. Notera att detta endast kommer att fungera om lokalen har stöd i systemet. Använd kommandot "locale -a" för att få en lista över de lokaler som stöds. Under Windows måste du använda flaggan "-gb" för att konvertera UTF-16-filer till GB18030. GB18030-kodade filer kan ha en byteordningsmarkering, precis som Unicode-filer. EXEMPEL Läsa inmatning från “stdin“ och skriv utmatning till “stdout“: dos2unix < a.txt cat a.txt | dos2unix Konvertera och ersätta a.txt. Konvertera och ersätt b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Konvertera och ersätt a.txt i ascii-konverteringsläge: dos2unix a.txt Konvertera och ersätt a.txt i ascii-konverteringsläge, konvertera och ersätt b.txt i 7bit-konverteringsläge: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Konvertera a.txt från Mac- till Unix-format: dos2unix -c mac a.txt mac2unix a.txt Konvertera a.txt från Unix- till Mac-format: unix2dos -c mac a.txt unix2mac a.txt Konvertera och ersätt a.txt medan originalet tidsstämpel behålls: dos2unix -k a.txt dos2unix -k -o a.txt Konvertera a.txt och skriv till e.txt: dos2unix -n a.txt e.txt Konvertera a.txt och skriv till e.txt, låt e.txt behålla tidsstämpeln från a.txt: dos2unix -k -n a.txt e.txt Konvertera och ersätt a.txt, konvertera b.txt och skriv till e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Konvertera c.txt och skriv till e.txt, konvertera och ersätt a.txt, konvertera och ersätt b.txt, konvertera d.txt och skriv till f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt REKURSIV KONVERTERING Använd dos2unix i kombination med kommandona find(1) och xargs(1) för att rekursivt konvertera filer i en katalogstruktur. För att till exempel konvertera alla .txt-filer i katalogträdet under den aktuella katalogen skriv: find . -name '*.txt' |xargs dos2unix I en Windows-kommandoprompt kan följande kommando användas: for /R %G in (*.txt) do dos2unix "%G" PowerShell-användare kan använda följande kommando i Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} LOKALISERING LANG Det primära språket väljs med miljövariabeln LANG. LANG-variabeln består av flera delas. Den första delen är språkkoden i gemener. Den andra delen är valfri och utgör landskoden i versaler, föregången av ett understreck. Det finns också en valfri tredje del: teckenkodning, föregången av en punkt. Ett par exempel för skal av POSIX-standard-typ: export LANG=nl Nederländska export LANG=nl_NL Nederländska, Nederländerna export LANG=nl_BE Nederländska, Belgien export LANG=es_ES Spanska, Spanien export LANG=es_MX Spanska, Mexiko export LANG=en_US.iso88591 Engelska, USA, Latin-1-kodning export LANG=en_GB.UTF-8 Engelska, UK, UTF-8-kodning För en fullständig lista över språk och landskoder se vidare i gettext-manualen: På Unix-system kan du använda kommando locale(1) för att få lokal-specifik information. LANGUAGE Med miljövariabeln LANGUAGE kan du ange en prioritetslista över språk, separerade med kolon. Dos2unix kommer att ge företräde till LANGAUGE över LANG. Exempelvis först nederländska och sedan tyska: "LANGUAGE=nl:de". Du måste först ha aktiverat lokalisering, genom att sätta LANG (eller LC_ALL) till ett värde annat än “C“, innan du kan använda en prioritetslista för språk via LANGUAGE-variabeln. Se vidare i gettext-manualen: Om du väljer ett språk som inte är tillgänglig kommer du att få engelska meddelanden som standard. DOS2UNIX_LOCALEDIR Med miljövariabeln DOS2UNIX_LOCALEDIR kan LOCALEDIR som ställts in vid kompilering åsidosättas. LOCALEDIR används för att hitta språkfiler. Standardvärdet för GNU-program är "/usr/local/share/locale". Flaggan --version kommer att visa vilken LOCALEDIR som används. Exempel (POSIX-skal): export DOS2UNIX_LOCALEDIR=$HOME/share/locale RETURVÄRDE Om allt går bra kommer noll att returneras. När ett systemfel uppstår kommer det senaste systemfelet att returneras. För andra fel kommer 1 att returneras. Returvärdet är alltid noll i tyst läge, utom när felaktiga kommandoradsflaggor används. STANDARDER FÖRFATTARE Benjamin Lin - , Bernd Johannes Wuebben (mac2unix-läge) - , Christian Wurll (lägg till en extra radbrytning) - , Erwin Waterlander - (upphovsman) Projektsida: SourceForge-sida: SE ÄVEN file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/uk/0000755000175500010010000000000012721132562013742 5ustar waterlanGeendos2unix-7.3.4/man/uk/man1/0000755000175500010010000000000012721132613014573 5ustar waterlanGeendos2unix-7.3.4/man/uk/man1/dos2unix.10000644000175500010010000015370412721132563016446 0ustar waterlanGeen.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dos2unix 1" .TH dos2unix 1 "2016-05-24" "dos2unix" "2016-05-24" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "НАЗВА" .IX Header "НАЗВА" dos2unix \- програма для перетворення даних у текстовому форматі DOS/Mac у формат Unix, і навпаки .SH "КОРОТКИЙ ОПИС" .IX Header "КОРОТКИЙ ОПИС" .Vb 2 \& dos2unix [параметри] [ФАЙЛ ...] [\-n ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...] \& unix2dos [параметри] [ФАЙЛ ...] [\-n ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...] .Ve .SH "ОПИС" .IX Header "ОПИС" До складу пакунка Dos2unix включено програми \f(CW\*(C`dos2unix\*(C'\fR та \f(CW\*(C`unix2dos\*(C'\fR, призначені для перетворення звичайних текстових даних у форматі \s-1DOS\s0 або Mac на дані у форматі Unix, і навпаки. .PP У текстових файлах DOS/Windows розрив рядка або перехід на новий рядок здійснюється за допомогою комбінації двох символів: повернення каретки (\s-1CR\s0) і переведення рядка (\s-1LF\s0). У текстових файлах Unix за перехід на новий рядок відповідає один символ: переведення рядка (\s-1LF\s0). У текстових файлах Mac, до Mac \s-1OS X,\s0 за розрив рядка відповідав один символ: повернення каретки (\s-1CR\s0). У сучасних версіях Mac \s-1OS\s0 використовується типовий для Unix розрив рядка (\s-1LF\s0). .PP Окрім символів розриву рядка, програма Dos2unix здатна виконувати перетворення кодування файлів. Можна перетворити дані у декількох кодуваннях \&\s-1DOS\s0 на файли у кодуванні Latin\-1 Unix. Також можна перетворити дані у файлах Windows Unicode (\s-1UTF\-16\s0) на дані у кодуванні Unix Unicode (\s-1UTF\-8\s0). .PP Під час перетворення програма пропускатиме двійкові файли, якщо ви не накажете їй виконати перетворення таких файлів безпосередньо. .PP Програма автоматично пропускатиме файли, які не є звичайними файлами, зокрема каталоги та канали \s-1FIFO.\s0 .PP Типово, програма не вноситиме змін до символічних посилань та об’єктів посилань. Якщо потрібно, програма може замінити символічні посилання або записати перетворені дані до файла\-призначення символічного посилання. У Windows запису до об’єкта символічного посилання не передбачено. .PP Програму dos2unix було створено за зразком програми dos2unix для SunOS/Solaris. Втім, існує одна важлива відмінність від оригінальної версії для SunOS/Solaris. Ця версія типово виконує заміну файлів під час перетворення (старий режим обробки файлів), а у оригінальній версії для SunOS/Solaris передбачено підтримку лише парного перетворення (новий режим обробки файлів). Див. також параметри \f(CW\*(C`\-o\*(C'\fR та \f(CW\*(C`\-n\*(C'\fR. Ще однією відмінністю є те, що у версії для SunOS/Solaris типово використовувався режим перетворення \fIiso\fR, а у цій версії типовим є режим перетворення \fIascii\fR. .SH "ПАРАМЕТРИ" .IX Header "ПАРАМЕТРИ" .IP "\fB\-\-\fR" 4 .IX Item "--" Вважати усі наступні параметри назвами файлів. Цим параметром слід користуватися, якщо вам потрібно виконати перетворення файлів, чиї назви містять дефіси. Наприклад, щоб виконати перетворення файла «\-foo», скористайтеся такою командою: .Sp .Vb 1 \& dos2unix \-\- \-foo .Ve .Sp Або у новому режимі файлів: .Sp .Vb 1 \& dos2unix \-n \-\- \-foo out.txt .Ve .IP "\fB\-ascii\fR" 4 .IX Item "-ascii" Виконати лише перетворення символів розриву рядків. Типовий режим перетворення. .IP "\fB\-iso\fR" 4 .IX Item "-iso" Виконати перетворення з кодування \s-1DOS\s0 на кодування \s-1ISO\-8859\-1.\s0 Див. розділ щодо режимів перетворення. .IP "\fB\-1252\fR" 4 .IX Item "-1252" Використати кодову таблицю 1252 Windows (західноєвропейські мови). .IP "\fB\-437\fR" 4 .IX Item "-437" Використовувати кодову сторінку \s-1DOS 437 \s0(США). Це типова кодова сторінка для перетворення \s-1ISO.\s0 .IP "\fB\-850\fR" 4 .IX Item "-850" Використовувати кодову сторінку \s-1DOS 850 \s0(західноєвропейські мови). .IP "\fB\-860\fR" 4 .IX Item "-860" Використовувати сторінку \s-1DOS 860 \s0(португальська). .IP "\fB\-863\fR" 4 .IX Item "-863" Використовувати сторінку \s-1DOS 863 \s0(канадська французька). .IP "\fB\-865\fR" 4 .IX Item "-865" Використовувати сторінку \s-1DOS 865 \s0(скандинавські мови). .IP "\fB\-7\fR" 4 .IX Item "-7" Перетворювати 8\-бітові символи на 7\-бітові. .IP "\fB\-b, \-\-keep\-bom\fR" 4 .IX Item "-b, --keep-bom" Зберегти позначку порядку байтів (\s-1BOM\s0). Якщо у файлі вхідних даних є \s-1BOM,\s0 записати \s-1BOM\s0 до файла результатів. Це типова поведінка під час перетворення у формат із символами розриву рядків \s-1DOS.\s0 Див. також параметр \f(CW\*(C`\-r\*(C'\fR. .IP "\fB\-c, \-\-convmode РЕЖИМ\fR" 4 .IX Item "-c, --convmode РЕЖИМ" Встановити режим перетворення. Значенням аргументу РЕЖИМ може бути один з таких рядків: \fIascii\fR, \fI7bit\fR, \fIiso\fR, \fImac\fR. Типовим є режим ascii. .IP "\fB\-D, \-\-display\-enc КОДУВАННЯ\fR" 4 .IX Item "-D, --display-enc КОДУВАННЯ" Встановити кодування показаного тексту. Можливі варіанти значень параметра КОДУВАННЯ: \fIansi\fR, \fIunicode\fR, \fIunicodebom\fR, \fIutf8\fR, \fIutf8bom\fR, типовим є ansi. .Sp Цей параметр доступний лише у dos2unix для Windows з підтримкою назв файлів у Unicode. Цей параметр не впливає на справжнє читання та запис назв файлів, лише на те, як буде показано ці назви. .Sp Існує декілька способів показу тексту у консолі Windows, заснованих на кодуванні тексту. Усі ці способи мають свої переваги і недоліки. .RS 4 .IP "\fBansi\fR" 4 .IX Item "ansi" Типовим способом для dos2unix є кодування тексту у форматі \s-1ANSI.\s0 Перевагою є зворотна сумісність. Цей варіант працює з растровими шрифтами та шрифтами TrueType. У деяких регіонах, ймовірно, вам доведеться змінити активну кодову сторінку \s-1DOS OEM\s0 на системну кодову сторінку \s-1ANSI\s0 Windows за допомогою команди \f(CW\*(C`chcp\*(C'\fR, оскільки dos2unix використовує системну кодову сторінку Windows. .Sp Недоліком ansi є те, що назви файлів із символами, яких немає у типовому системному кодуванні, буде показано неправильно. Замість цих символів ви побачите знак питання або не той символ. Якщо у вашій системі немає файлів із назвами, які містять нетипові символи, можна скористатися цим варіантом. .IP "\fBunicode, unicodebom\fR" 4 .IX Item "unicode, unicodebom" Перевагою кодування unicode (назва у Windows кодування \s-1UTF\-16\s0) є те, що зазвичай текст буде показано правильно. Змінювати активну кодову сторінку не потрібно. Ймовірно, вам потрібно встановити шрифт консолі TrueType для належного показу нестандартних символів. Якщо символ не передбачено у шрифті TrueType, зазвичай ви побачите невеличкий квадратик замість символу, іноді із знаком питання у ньому. .Sp Якщо ви користуєтеся консоллю ConEmu, весь текст буде показано належним чином, оскільки ConEmu автоматично вибирає належний шрифт. .Sp Недоліком unicode є те, що це кодування несумісне з \s-1ASCII.\s0 Обробка виведених даних є непростою, якщо ви передаватимете ці дані до іншої програми або файла. .Sp Якщо використовується метод \f(CW\*(C`unicodebom\*(C'\fR, текст у кодуванні Unicode буде оброблено з урахуванням \s-1BOM \s0(позначки порядку байтів). \s-1BOM\s0 потрібна для правильного переспрямовування або тунелювання даних у PowerShell. .IP "\fButf8, utf8bom\fR" 4 .IX Item "utf8, utf8bom" Перевагою utf8 є те, що це кодування сумісне з \s-1ASCII.\s0 Вам слід встановити шрифт консолі TrueType. Якщо використано шрифт TrueType, текст буде показано подібно до того, як його показано, якщо визначено кодування \f(CW\*(C`unicode\*(C'\fR. .Sp Недоліком є те, що якщо ви скористаєтеся типовим растровим шрифтом, усі символи поза \s-1ASCII\s0 буде показано неправильно. Не лише назви файлів у unicode, а й перекладені повідомлення стануть непридатними до читання. У Windows, налаштованому на роботі у східно\-азійському регіоні, ви можете помітити значне блимання під час показу повідомлень. .Sp У консолі ConEmu добре працює спосіб кодування utf8. .Sp Якщо використовується метод \f(CW\*(C`utf8bom\*(C'\fR, текст у кодуванні \s-1UTF\-8\s0 буде оброблено з урахуванням \s-1BOM \s0(позначки порядку байтів). \s-1BOM\s0 потрібна для правильного переспрямовування або тунелювання даних у PowerShell. .RE .RS 4 .Sp Типове кодування можна змінити за допомогою змінної середовища \&\s-1DOS2UNIX_DISPLAY_ENC\s0 встановленням для неї значення \f(CW\*(C`unicode\*(C'\fR, \&\f(CW\*(C`unicodebom\*(C'\fR, \f(CW\*(C`utf8\*(C'\fR або \f(CW\*(C`utf8bom\*(C'\fR. .RE .IP "\fB\-f, \-\-force\fR" 4 .IX Item "-f, --force" Примусове перетворення двійкових файлів. .IP "\fB\-gb, \-\-gb18030\fR" 4 .IX Item "-gb, --gb18030" У Windows файли в \s-1UTF\-16\s0 типово перетворюються на файли в \s-1UTF\-8,\s0 незалежно від встановленої локалі. За допомогою цього параметра ви можете наказати програмі перетворювати файли в \s-1UTF\-16\s0 на файли у \s-1GB18030.\s0 Цим параметром можна скористатися лише у Windows. Див. також розділ, присвячений \s-1GB18030.\s0 .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Показати довідкові дані і завершити роботу. .IP "\fB\-i[ПРАПОРЦІ], \-\-info[=ПРАПОРЦІ] ФАЙЛ ...\fR" 4 .IX Item "-i[ПРАПОРЦІ], --info[=ПРАПОРЦІ] ФАЙЛ ..." Вивести дані щодо файла. Не виконувати перетворення. .Sp Буде виведено такі дані, у вказаному порядку: кількість розривів рядків у форматі \s-1DOS,\s0 кількість розривів рядків у форматі Unix, кількість розривів рядків у форматі Mac, позначка порядку байтів, текстовим чи бінарним є файл та назву файла. .Sp Приклад результатів: .Sp .Vb 8 \& 6 0 0 no_bom text dos.txt \& 0 6 0 no_bom text unix.txt \& 0 0 6 no_bom text mac.txt \& 6 6 6 no_bom text mixed.txt \& 50 0 0 UTF\-16LE text utf16le.txt \& 0 50 0 no_bom text utf8unix.txt \& 50 0 0 UTF\-8 text utf8dos.txt \& 2 418 219 no_bom binary dos2unix.exe .Ve .Sp Зауважте, що іноді бінарні файли помилково розпізнаються як текстові. Див. також параметр \f(CW\*(C`\-s\*(C'\fR. .Sp Крім того, можна вказати додаткові прапорці для внесення змін у виведені дані. Можна використовувати один або декілька таких прапорців. .RS 4 .IP "\fBd\fR" 4 .IX Item "d" Вивести кількість символів розривів рядка \s-1DOS.\s0 .IP "\fBu\fR" 4 .IX Item "u" Вивести кількість символів розривів рядка Unix. .IP "\fBm\fR" 4 .IX Item "m" Вивести кількість символів розривів рядка Mac. .IP "\fBb\fR" 4 .IX Item "b" Вивести позначку порядку байтів. .IP "\fBt\fR" 4 .IX Item "t" Вивести дані щодо того, є файл текстовим чи бінарним. .IP "\fBc\fR" 4 .IX Item "c" Вивести дані лише тих файлів, які було б перетворено. .Sp Із прапорцем \f(CW\*(C`c\*(C'\fR dos2unix виведе лише назви файлів, у яких містяться розриви рядків \s-1DOS.\s0 unix2dos виведе лише назви файлів, у яких містяться розриви рядків Unix. .IP "\fBh\fR" 4 .IX Item "h" Вивести заголовок. .IP "\fBp\fR" 4 .IX Item "p" Показувати назви файлів без шляхів. .RE .RS 4 .Sp Приклади: .Sp Вивести дані щодо усіх файлів *.txt: .Sp .Vb 1 \& dos2unix \-i *.txt .Ve .Sp Вивести кількість розривів рядків у форматі \s-1DOS\s0 і розривів рядків у форматі Unix: .Sp .Vb 1 \& dos2unix \-idu *.txt .Ve .Sp Вивести лише позначку порядку байтів: .Sp .Vb 1 \& dos2unix \-\-info=b *.txt .Ve .Sp Вивести список файлів, у яких є символи розриву рядків \s-1DOS:\s0 .Sp .Vb 1 \& dos2unix \-ic *.txt .Ve .Sp Вивести список файлів, у яких використано символи розриву рядків Unix: .Sp .Vb 1 \& unix2dos \-ic *.txt .Ve .Sp Перетворити лише файли із розривами рядків \s-1DOS\s0 і не чіпати інших файлів: .Sp .Vb 1 \& dos2unix \-ic *.txt | xargs dos2unix .Ve .Sp Знайти текстові файли і розривами рядків \s-1DOS:\s0 .Sp .Vb 1 \& find \-name \*(Aq*.txt\*(Aq | xargs dos2unix \-ic .Ve .RE .IP "\fB\-k, \-\-keepdate\fR" 4 .IX Item "-k, --keepdate" Зберегти часову позначку файла вхідних даних у файлі результатів перетворення. .IP "\fB\-L, \-\-license\fR" 4 .IX Item "-L, --license" Вивести умови ліцензування програми. .IP "\fB\-l, \-\-newline\fR" 4 .IX Item "-l, --newline" Вставити додатковий символ розриву рядка. .Sp \&\fBdos2unix\fR: перетворення на два символи розриву рядків Unix відбуватиметься лише для комбінацій розриву рядків \s-1DOS.\s0 У режимі Mac виконуватиметься перетворення на два розриви рядків Unix лише символів розриву рядків Mac. .Sp \&\fBunix2dos\fR: перетворення на дві комбінації розриву рядків \s-1DOS\s0 відбуватиметься лише для символів розриву рядків \s-1DOS.\s0 У режимі Mac виконуватиметься перетворення на два розриви рядків Mac лише символів розриву рядків Unix. .IP "\fB\-m, \-\-add\-bom\fR" 4 .IX Item "-m, --add-bom" Записати до файла результатів позначку порядку байтів (\s-1BOM\s0). Типово буде записано позначку порядку байтів \s-1UTF\-8.\s0 .Sp Якщо дані початкового файла закодовано у \s-1UTF\-16\s0 і використано параметр \&\f(CW\*(C`\-u\*(C'\fR, буде дописано позначку порядку байтів \s-1UTF\-16.\s0 .Sp Не використовуйте цей параметр для кодувань результатів, відмінних від \&\s-1UTF\-8, UTF\-16\s0 або \s-1GB18030.\s0 Див. також розділ щодо \s-1UNICODE.\s0 .IP "\fB\-n, \-\-newfile ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...\fR" 4 .IX Item "-n, --newfile ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ..." Новий режим обробки файлів. Перетворити дані з файла ВХІДНИЙ_ФАЙЛ і записати результати до файла ВИХІДНИЙ_ФАЙЛ. Назви файлів слід вказувати парами, \fIне слід\fR використовувати шаблони заміни, інакше вміст файлів \fIбуде втрачено\fR. .Sp Власником перетвореного файла буде призначено користувача, яким було розпочато перетворення у режимі нового файла (парному режимі). Права доступу на читання або запис нового файла буде визначено на основі прав доступу до початкового файла мінус \fIumask\fR\|(1) для користувача, яким було розпочато перетворення. .IP "\fB\-o, \-\-oldfile ФАЙЛ ...\fR" 4 .IX Item "-o, --oldfile ФАЙЛ ..." Застарілий режим обробки. Виконати перетворення файла ФАЙЛ і перезаписати його вміст. Типово, програма працює у цьому режимі. Можна використовувати шаблони заміни. .Sp У застарілому режимі (режимі заміщення) перетворений файл належатиме тому самому власнику і групі і матиме ті самі права доступу на читання або запис, що і початковий файл. Крім того, якщо перетворення файла виконується іншим користувачем, який має права доступу на запис до файла (наприклад користувачем root), перетворення буде перервано, якщо зберегти початкові значення не вдасться. Зміна власника може означати неможливість читання файла для його початкового власника. Зміна групи може призвести до проблем із безпекою, оскільки файл може стати доступним для читання користувачам, які не повинні мати такі права доступу. Можливість збереження прав власності та прав доступу до файла передбачено лише у Unix. .IP "\fB\-q, \-\-quiet\fR" 4 .IX Item "-q, --quiet" Режим без виведення повідомлень. Програма не виводитиме жодних попереджень або повідомлень про помилки. Повернутим значенням завжди буде нуль, якщо вказано правильні параметри командного рядка. .IP "\fB\-r, \-\-remove\-bom\fR" 4 .IX Item "-r, --remove-bom" Вилучити позначку порядку байтів (\s-1BOM\s0). Не записувати \s-1BOM\s0 до файла результатів. Це типова поведінка під час перетворення файлів з форматом розриву рядків Unix. Див. також параметр \f(CW\*(C`\-b\*(C'\fR. .IP "\fB\-s, \-\-safe\fR" 4 .IX Item "-s, --safe" Пропускати двійкові файли (типово). .Sp Пропускання бінарних файлів реалізовано для того, щоб уникнути випадкових помилок. Майте на увазі, що визначення бінарних файлів не є 100% точним. Програма просто шукає у файлах бінарні символи, які типово не трапляються у текстових файлах. Може так статися, що у бінарному файлі містяться лише звичайні текстові символи. Такий бінарний файл буде помилково сприйнято програмою як текстовий. .IP "\fB\-u, \-\-keep\-utf16\fR" 4 .IX Item "-u, --keep-utf16" Зберегти початкове кодування \s-1UTF\-16.\s0 Файл результатів буде записано у тому самому кодуванні \s-1UTF\-16,\s0 із прямим або зворотним порядком байтів, що і початковий файл. Таким чином можна запобігти перетворенню даних у кодування \&\s-1UTF\-8.\s0 До файла буде записано відповідну позначку порядку байтів \&\s-1UTF\-16.\s0 Вимкнути цей параметр можна за допомогою параметра \f(CW\*(C`\-ascii\*(C'\fR. .IP "\fB\-ul, \-\-assume\-utf16le\fR" 4 .IX Item "-ul, --assume-utf16le" Припускати, що кодуванням вхідних файлів є \s-1UTF\-16LE.\s0 .Sp Якщо у початковому файлі є позначка порядку байтів (\s-1BOM\s0), її буде використано у файлі\-результаті, незалежно від використання цього параметра. .Sp Якщо вами було зроблено помилкове припущення щодо формату файла (файл вхідних даних насправді не є файлом у форматі \s-1UTF\-16LE\s0), і дані вдасться успішно перетворити, ви отримаєте файл у кодуванні \s-1UTF\-8\s0 з помилковим вмістом. Скасувати таке помилкове перетворення можна за допомогою зворотного перетворення \fIiconv\fR\|(1) з даних у форматі \s-1UTF\-8\s0 на дані у форматі \&\s-1UTF\-16LE.\s0 Таким чином ви повернетеся до початкового кодування даних у файлі. .Sp Припущення щодо форматування \s-1UTF\-16LE\s0 працює як визначення \fIрежиму перетворення\fR. Перемиканням на типовий режим \fIascii\fR можна вимкнути припущення щодо форматування \s-1UTF\-16LE.\s0 .IP "\fB\-ub, \-\-assume\-utf16be\fR" 4 .IX Item "-ub, --assume-utf16be" Припускати, що вхідним форматом є \s-1UTF\-16BE.\s0 .Sp Цей параметр працює у спосіб, тотожний до параметра \f(CW\*(C`\-ul\*(C'\fR. .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Виводити докладні повідомлення. Буде показано додаткові дані щодо позначок порядку байтів та кількості перетворених символів розриву рядків. .IP "\fB\-F, \-\-follow\-symlink\fR" 4 .IX Item "-F, --follow-symlink" Переходити за символічними посиланням і перетворювати файли, на які вони вказують. .IP "\fB\-R, \-\-replace\-symlink\fR" 4 .IX Item "-R, --replace-symlink" Замінити символічні посилання перетвореними файлами (початкові файли, на які вони вказують, змінено не буде). .IP "\fB\-S, \-\-skip\-symlink\fR" 4 .IX Item "-S, --skip-symlink" Не змінювати символічні посилання та файли, на які вони посилаються (типово). .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" Вивести дані щодо версії і завершити роботу. .SH "РЕЖИМ MAC" .IX Header "РЕЖИМ MAC" У звичайному режимі розриви рядків \s-1DOS\s0 перетворюються на розриви рядків Unix, і навпаки. Розриви рядків Mac перетворенню не підлягають. .PP У режимі Mac розриви рядків Mac перетворюються на розриви рядків Unix, і навпаки. Розриви рядків \s-1DOS\s0 перетворенню не підлягають. .PP Щоб запустити програму у режимі перетворення Mac, скористайтеся параметром командного рядка \f(CW\*(C`\-c mac\*(C'\fR або програмами \f(CW\*(C`mac2unix\*(C'\fR та \f(CW\*(C`unix2mac\*(C'\fR. .SH "РЕЖИМИ ПЕРЕТВОРЕННЯ" .IX Header "РЕЖИМИ ПЕРЕТВОРЕННЯ" .IP "\fBascii\fR" 4 .IX Item "ascii" У режимі \f(CW\*(C`ascii\*(C'\fR виконуватиметься лише перетворення символів розриву рядків. Цей режим є типовим режимом перетворення. .Sp Хоча цей режим і називається режимом \s-1ASCII \s0(стандарту 7\-бітового кодування), насправді кодування символів у ньому є 8\-бітовим. Завжди користуйтеся цим режимом для перетворення файлів у кодуванні \s-1UTF\-8 \s0(Unicode). .IP "\fB7bit\fR" 4 .IX Item "7bit" У цьому режимі усі 8\-бітові символи, які не є частиною \s-1ASCII, \s0(з номерами від 128 до 255) буде перетворено на відповідні 7\-бітові символи. .IP "\fBiso\fR" 4 .IX Item "iso" Перетворення символів буде виконано з кодування (кодової сторінки) \s-1DOS\s0 до кодування \s-1ISO\-8859\-1 \s0(Latin\-1) у Unix. Символи \s-1DOS,\s0 які не мають еквівалентів у \s-1ISO\-8859\-1\s0 і перетворення яких неможливе, буде перетворено на символ крапки. Те саме стосується символів \s-1ISO\-8859\-1,\s0 які не мають еквівалентів у \s-1DOS.\s0 .Sp Якщо буде використано лише параметр \f(CW\*(C`\-iso\*(C'\fR, програма dos2unix спробує визначити активне кодування. Якщо це виявиться неможливим, dos2unix використає типове кодування \s-1CP437,\s0 яке здебільшого використовується у США. Щоб примусово визначити кодування, скористайтеся параметром \f(CW\*(C`\-437\*(C'\fR (США), \f(CW\*(C`\-850\*(C'\fR (західноєвропейські мови), \f(CW\*(C`\-860\*(C'\fR (португальська), \f(CW\*(C`\-863\*(C'\fR (канадська французька) або \f(CW\*(C`\-865\*(C'\fR (скандинавські мови). Використати кодування Windows \s-1CP1252 \s0(західноєвропейські мови) можна за допомогою параметра \f(CW\*(C`\-1252\*(C'\fR. Для інших кодувань використовуйте поєднання dos2unix з \&\fIiconv\fR\|(1). Програма iconv здатна виконувати перетворення даних у доволі широкому спектрі кодувань символів. .Sp Ніколи не користуйтеся перетворенням \s-1ISO\s0 для текстових файлів у форматі Unicode. Використання подібного перетворення призведе до ушкодження вмісту файлів у кодуванні \s-1UTF\-8.\s0 .Sp Декілька прикладів: .Sp Перетворити дані у типовому кодуванні \s-1DOS\s0 на дані у кодуванні Latin\-1 Unix: .Sp .Vb 1 \& dos2unix \-iso \-n in.txt out.txt .Ve .Sp Перетворити дані у кодуванні \s-1DOS CP850\s0 на дані у кодуванні Latin\-1 Unix: .Sp .Vb 1 \& dos2unix \-850 \-n in.txt out.txt .Ve .Sp Перетворити дані у кодуванні \s-1CP1252\s0 Windows на дані у кодуванні Latin\-1 Unix: .Sp .Vb 1 \& dos2unix \-1252 \-n in.txt out.txt .Ve .Sp Перетворити дані у кодуванні \s-1CP252\s0 Windows на дані у кодуванні \s-1UTF\-8\s0 Unix (Unicode): .Sp .Vb 1 \& iconv \-f CP1252 \-t UTF\-8 in.txt | dos2unix > out.txt .Ve .Sp Перетворити дані у кодуванні Latin\-1 Unix на дані у типовому кодуванні \s-1DOS:\s0 .Sp .Vb 1 \& unix2dos \-iso \-n in.txt out.txt .Ve .Sp Перетворити дані у кодуванні Latin\-1 Unix на дані у кодуванні \s-1DOS CP850:\s0 .Sp .Vb 1 \& unix2dos \-850 \-n in.txt out.txt .Ve .Sp Перетворити дані у кодуванні Latin\-1 Unix на дані у кодуванні Windows \&\s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos \-1252 \-n in.txt out.txt .Ve .Sp Перетворити дані у кодуванні \s-1UTF\-8\s0 Unix (Unicode) на дані у кодуванні Windows \s-1CP1252:\s0 .Sp .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t CP1252 > out.txt .Ve .Sp Див. також та . .SH "UNICODE" .IX Header "UNICODE" .SS "Кодування" .IX Subsection "Кодування" Існує декілька різних кодувань Unicode. У Unix та Linux у файлах Unicode здебільшого використовується кодування \s-1UTF\-8.\s0 У Windows для текстових файлів Unicode може бути використано кодування \s-1UTF\-8, UTF\-16\s0 або \s-1UTF\-16\s0 зі зворотним порядком байтів. Втім, здебільшого, використовується формат \&\s-1UTF\-16.\s0 .SS "Перетворення" .IX Subsection "Перетворення" У текстових файлах Unicode, як і у звичайних текстових файлах, може бути використано розриви рядків \s-1DOS,\s0 Unix або Mac. .PP Усі версії dos2unix та unix2dos здатні виконувати перетворення у кодуванні \&\s-1UTF\-8,\s0 оскільки \s-1UTF\-8\s0 було розроблено так, що зворотну сумісність з \s-1ASCII\s0 збережено. .PP Програми dos2unix та unix2dos, зібрані з підтримкою Unicode \s-1UTF\-16,\s0 можуть читати текстові файли у кодуванні \s-1UTF\-16\s0 з прямим та зворотним порядком байтів. Щоб дізнатися про те, чи було dos2unix зібрано з підтримкою \s-1UTF\-16,\s0 віддайте команду \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP У Unix/Linux файли у кодуванні \s-1UTF\-16\s0 перетворюються на файли у кодуванні локалі. Для визначення поточного кодування символів локалі скористайтеся командою \fIlocale\fR\|(1). Якщо перетворення виявиться неможливим, програма повідомить про помилку перетворення і пропустить відповідний файл. .PP У Windows файли \s-1UTF\-16\s0 типово буде перетворено на файли \s-1UTF\-8.\s0 Обидва типи систем, Windows та Unix/Linux, мають непогані можливості з підтримки файлів у форматуванні \s-1UTF\-8.\s0 .PP Кодування \s-1UTF\-16\s0 та \s-1UTF\-8\s0 є повністю сумісними. Під час перетворення не буде втрачено жодної інформації. Якщо під час перетворення даних у кодуванні \&\s-1UTF\-16\s0 на дані у кодуванні \s-1UTF\-8\s0 трапиться помилка, наприклад, якщо у вхідному файлі \s-1UTF\-16\s0 міститиметься якась помилка, файл буде пропущено. .PP Якщо використано параметр \f(CW\*(C`\-u\*(C'\fR, файл результатів буде записано у тому самому кодуванні \s-1UTF\-16,\s0 що і початковий файл. Використання параметра Option \&\f(CW\*(C`\-u\*(C'\fR запобігає перетворенню даних у кодування \s-1UTF\-8.\s0 .PP У dos2unix та unix2dos не передбачено параметра для перетворення даних у кодуванні \s-1UTF\-8\s0 на дані у кодуванні \s-1UTF\-16.\s0 .PP Режим перетворення \s-1ISO\s0 та 7\-бітовий режим не працюють для файлів \s-1UTF\-16.\s0 .SS "Позначка порядку байтів" .IX Subsection "Позначка порядку байтів" У Windows до текстових файлів у кодуванні Unicode типово дописується позначка порядку байтів (\s-1BOM\s0), оскільки багато програм Windows (зокрема Notepad) додають таку позначку автоматично. Див. також . .PP У Unix файли у кодуванні Unicode типово не містять позначки порядку байтів. Вважається, що кодуванням текстових файлів є те кодування, яке визначається поточною локаллю. .PP Програма dos2unix може визначити, чи є кодуванням файла \s-1UTF\-16,\s0 лише якщо у файлі міститься позначка порядку байтів. Якщо у файлі, де використано кодування \s-1UTF\-16,\s0 немає такої позначки, dos2unix вважатиме такий файл двійковим (бінарним). .PP Для перетворення файлів \s-1UTF\-16\s0 без позначки порядку байтів скористайтеся параметром \f(CW\*(C`\-ul\*(C'\fR або \f(CW\*(C`\-ub\*(C'\fR. .PP Типово dos2unix не записує до файлів результатів перетворення позначки порядку байтів (\s-1BOM\s0). Якщо використано параметр \f(CW\*(C`\-b\*(C'\fR, dos2unix запише до файла результатів \s-1BOM,\s0 якщо \s-1BOM\s0 була у файлі початкових даних. .PP Типово unix2dos записує позначку порядку байтів (\s-1BOM\s0) до файла результатів, якщо \s-1BOM\s0 є у початковому файлі. Скористайтеся параметром \f(CW\*(C`\-r\*(C'\fR, щоб вилучити \&\s-1BOM.\s0 .PP Dos2unix та unix2dos завжди записують до файла результатів позначку порядку байтів (\s-1BOM\s0), якщо використано параметр \f(CW\*(C`\-m\*(C'\fR. .SS "Назви файлів у Unicode у Windows" .IX Subsection "Назви файлів у Unicode у Windows" У dos2unix передбачено підтримку читання і запису назв файлів Unicode у командному рядку Windows. Це означає, що dos2unix може відкривати файли, у назвах яких є символи, які не є частиною типової системної кодової сторінки \&\s-1ANSI.\s0 Щоб визначити, чи зібрано dos2unix для Windows з підтримкою назв файлів у кодуванні Unicode, скористайтеся командою \f(CW\*(C`dos2unix \-V\*(C'\fR. .PP Із показом назв файлів у кодуванні Unicode у консолі Windows пов’язано декілька проблем. Див. параметр \f(CW\*(C`\-D\*(C'\fR, \f(CW\*(C`\-\-display\-enc\*(C'\fR. Назви файлів може бути некоректно показано у консолі, але запис цих назв відбуватиметься належним чином. .SS "Приклади для Unicode" .IX Subsection "Приклади для Unicode" Перетворити дані з Windows \s-1UTF\-16 \s0(з позначкою порядку байтів (\s-1BOM\s0)) у формат Unix \s-1UTF\-8:\s0 .PP .Vb 1 \& dos2unix \-n in.txt out.txt .Ve .PP Перетворити дані у форматі Windows \s-1UTF\-16LE \s0(без \s-1BOM\s0) на дані у форматі \&\s-1UTF\-8\s0 Unix: .PP .Vb 1 \& dos2unix \-ul \-n in.txt out.txt .Ve .PP Перетворити дані у кодуванні \s-1UTF\-8\s0 Unix на дані у кодуванні Windows \s-1UTF\-8\s0 без \s-1BOM:\s0 .PP .Vb 1 \& unix2dos \-m \-n in.txt out.txt .Ve .PP Перетворити дані у кодуванні \s-1UTF\-8\s0 Unix на дані у кодуванні Windows \s-1UTF\-16:\s0 .PP .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t UTF\-16 > out.txt .Ve .SH "GB18030" .IX Header "GB18030" \&\s-1GB18030\s0 є китайським урядовим стандартом. Підтримка обов’язкової підмножини стандарту \s-1GB18030\s0 є неодмінною вимогою до будь\-яких програмних продуктів, які продаються у Китаї. Див. також . .PP Кодування \s-1GB18030\s0 є повністю сумісним із Unicode. Його можна розглядати як формат перетворення unicode. Подібно до \s-1UTF\-8, GB18030\s0 є сумісним із \&\s-1ASCII. GB18030\s0 також є сумісним із кодовою сторінкою Windows 936, яку ще називають \s-1GBK.\s0 .PP У Unix/Linux файли \s-1UTF\-16\s0 буде перетворено до кодування \s-1GB18030,\s0 якщо кодуванням локалі є \s-1GB18030.\s0 Зауважте, що це спрацює, лише якщо підтримку локалі передбачено у системі. Щоб отримати список підтримуваних локалей, скористайтеся командою \f(CW\*(C`locale \-a\*(C'\fR. .PP У Windows для перетворення файлів \s-1UTF\-16\s0 на файли \s-1GB18030\s0 слід вказати параметр \f(CW\*(C`\-gb\*(C'\fR. .PP У файлах у кодуванні \s-1GB18030\s0 може міститися позначка порядку байтів, так само, як у файлах у кодуванні Unicode. .SH "ПРИКЛАДИ" .IX Header "ПРИКЛАДИ" Прочитати вхідні дані зі стандартного джерела (stdin) і записати результат до стандартного виведення (stdout): .PP .Vb 2 \& dos2unix < a.txt \& cat a.txt | dos2unix .Ve .PP Перетворити дані у a.txt і замістити цей файл. Перетворити дані у b.txt і замістити цей файл: .PP .Vb 2 \& dos2unix a.txt b.txt \& dos2unix \-o a.txt b.txt .Ve .PP Перетворити дані у a.txt і замістити файл у режимі перетворення ascii: .PP .Vb 1 \& dos2unix a.txt .Ve .PP Перетворити дані у a.txt і замістити файл у режимі перетворення ascii. Перетворити дані у b.txt і замістити цей файл у режимі 7\-бітового перетворення: .PP .Vb 3 \& dos2unix a.txt \-c 7bit b.txt \& dos2unix \-c ascii a.txt \-c 7bit b.txt \& dos2unix \-ascii a.txt \-7 b.txt .Ve .PP Перетворити файл a.txt з формату Mac на формат Unix: .PP .Vb 2 \& dos2unix \-c mac a.txt \& mac2unix a.txt .Ve .PP Перетворити файл a.txt з формату Unix на формат Mac: .PP .Vb 2 \& unix2dos \-c mac a.txt \& unix2mac a.txt .Ve .PP Перетворити дані у a.txt, замістити цей файл і зберегти часову позначку початкового файла: .PP .Vb 2 \& dos2unix \-k a.txt \& dos2unix \-k \-o a.txt .Ve .PP Перетворити дані у файлі a.txt і записати результати до файла e.txt: .PP .Vb 1 \& dos2unix \-n a.txt e.txt .Ve .PP Перетворити дані у файлі a.txt і записати результати до файла e.txt. Скопіювати часову позначку файла a.txt для файла e.txt: .PP .Vb 1 \& dos2unix \-k \-n a.txt e.txt .Ve .PP Перетворити дані у a.txt і замістити цей файл. Перетворити дані у b.txt і записати результат до e.txt: .PP .Vb 2 \& dos2unix a.txt \-n b.txt e.txt \& dos2unix \-o a.txt \-n b.txt e.txt .Ve .PP Перетворити дані у c.txt і записати результати до e.txt. Перетворити дані у a.txt і замістити ними цей файл. Перетворити дані у b.txt і замістити ними цей файл. Перетворити дані у d.txt і записати результати до f.txt: .PP .Vb 1 \& dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt .Ve .SH "РЕКУРСИВНЕ ПЕРЕТВОРЕННЯ" .IX Header "РЕКУРСИВНЕ ПЕРЕТВОРЕННЯ" Для рекурсивного перетворення текстових файлів у ієрархії каталогів слід використовувати dos2unix у поєднанні з програмами \fIfind\fR\|(1) та \&\fIxargs\fR\|(1). Наприклад, щоб виконати перетворення усіх файлів .txt у структурі підкаталогів поточного каталогу, віддайте таку команду: .PP .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .PP У командному рядку Windows можна скористатися такою командою: .PP .Vb 1 \& for /R %G in (*.txt) do dos2unix "%G" .Ve .PP Користувачі PowerShell можуть скористатися такою командою у Windows PowerShell: .PP .Vb 1 \& get\-childitem \-path . \-filter \*(Aq*.txt\*(Aq \-recurse | foreach\-object {dos2unix $_.Fullname} .Ve .SH "ЛОКАЛІЗАЦІЯ" .IX Header "ЛОКАЛІЗАЦІЯ" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" Основна мова визначається за допомогою змінної середовища \s-1LANG.\s0 Значення змінної \s-1LANG\s0 складається з декількох частин. Перша частина записується малими літерами і визначає код мови. Друга частина є необов’язковою, визначає код країни і записується прописними літерами, відокремлюється від першої частини символом підкреслювання. Передбачено також необов’язкову третю частину: кодування. Ця частина відокремлюється від другої частини крапкою. Ось декілька прикладів для командних оболонок стандартного типу \&\s-1POSIX:\s0 .Sp .Vb 7 \& export LANG=uk українська \& export LANG=uk_UA українська, Україна \& export LANG=ru_UA російська, Україна \& export LANG=es_ES іспанська, Іспанія \& export LANG=es_MX іспанська, Мексика \& export LANG=en_US.iso88591 англійська, США, кодування Latin\-1 \& export LANG=en_GB.UTF\-8 англійська, Великобританія, кодування UTF\-8 .Ve .Sp Повний список мов та кодів країн наведено у підручнику з gettext: .Sp У системах Unix для отримання даних щодо локалі можна скористатися командою \&\fIlocale\fR\|(1). .IP "\fB\s-1LANGUAGE\s0\fR" 4 .IX Item "LANGUAGE" За допомогою змінної середовища \s-1LANGUAGE\s0 ви можете вказати список пріоритеності мов. Записи у списку слід відокремлювати двокрапками. Програма dos2unix надає перевагу \s-1LANGUAGE\s0 над \s-1LANG.\s0 Наприклад, перша голландська, далі німецька: \f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. Спочатку вам слід увімкнути локалізацію, встановивши для змінної \s-1LANG \s0(або \s-1LC_ALL\s0) значення, відмінне від «C». Далі ви зможете використовувати список пріоритетності мов за допомогою змінної \&\s-1LANGUAGE.\s0 Додаткові відомості можна знайти у підручнику з gettext: .Sp Якщо вами буде вибрано мову, перекладу якою немає, буде показано стандартні повідомлення англійською мовою. .IP "\fB\s-1DOS2UNIX_LOCALEDIR\s0\fR" 4 .IX Item "DOS2UNIX_LOCALEDIR" Змінну \s-1LOCALEDIR,\s0 встановлену під час збирання програми, можна змінити за допомогою змінної середовища \s-1DOS2UNIX_LOCALEDIR. LOCALEDIR\s0 використовується для пошуку файлів перекладів. Типовим значенням у системах \s-1GNU\s0 є \&\f(CW\*(C`/usr/local/share/locale\*(C'\fR. Переглянути поточне значення змінної \s-1LOCALEDIR\s0 можна переглянути за допомогою параметра \fB\-\-version\fR. .Sp Приклад (командна оболонка \s-1POSIX\s0): .Sp .Vb 1 \& export DOS2UNIX_LOCALEDIR=$HOME/share/locale .Ve .SH "ПОВЕРНУТЕ ЗНАЧЕННЯ" .IX Header "ПОВЕРНУТЕ ЗНАЧЕННЯ" Якщо завдання вдасться успішно виконати, програма поверне нульовий код виходу. Якщо станеться системна помилка, буде повернуто код цієї помилки. Якщо станеться якась інша помилка, буде повернуто код 1. .PP У режимі без повідомлень повернутим значенням завжди буде нуль, якщо вказано правильні параметри командного рядка. .SH "СТАНДАРТИ" .IX Header "СТАНДАРТИ" .PP .PP .PP .SH "АВТОРИ" .IX Header "АВТОРИ" Benjamin Lin \- , Bernd Johannes Wuebben (режим mac2unix) \- , Christian Wurll (додатковий новий рядок) \- , Erwin Waterlander \- (супровідник) .PP Сторінка проекту: .PP Сторінка на SourceForge: .SH "ТАКОЖ ПЕРЕГЛЯНЬТЕ" .IX Header "ТАКОЖ ПЕРЕГЛЯНЬТЕ" \&\fIfile\fR\|(1) \fIfind\fR\|(1) \fIiconv\fR\|(1) \fIlocale\fR\|(1) \fIxargs\fR\|(1) dos2unix-7.3.4/man/uk/man1/dos2unix.htm0000644000175500010010000043465112721132573017102 0ustar waterlanGeen dos2unix 7.3.4 - програма для перетворення даних у текстовому форматі DOS/Mac у формат Unix, і навпаки

НАЗВА

dos2unix - програма для перетворення даних у текстовому форматі DOS/Mac у формат Unix, і навпаки

КОРОТКИЙ ОПИС

    dos2unix [параметри] [ФАЙЛ ...] [-n ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...]
    unix2dos [параметри] [ФАЙЛ ...] [-n ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...]

ОПИС

До складу пакунка Dos2unix включено програми dos2unix та unix2dos, призначені для перетворення звичайних текстових даних у форматі DOS або Mac на дані у форматі Unix, і навпаки.

У текстових файлах DOS/Windows розрив рядка або перехід на новий рядок здійснюється за допомогою комбінації двох символів: повернення каретки (CR) і переведення рядка (LF). У текстових файлах Unix за перехід на новий рядок відповідає один символ: переведення рядка (LF). У текстових файлах Mac, до Mac OS X, за розрив рядка відповідав один символ: повернення каретки (CR). У сучасних версіях Mac OS використовується типовий для Unix розрив рядка (LF).

Окрім символів розриву рядка, програма Dos2unix здатна виконувати перетворення кодування файлів. Можна перетворити дані у декількох кодуваннях DOS на файли у кодуванні Latin-1 Unix. Також можна перетворити дані у файлах Windows Unicode (UTF-16) на дані у кодуванні Unix Unicode (UTF-8).

Під час перетворення програма пропускатиме двійкові файли, якщо ви не накажете їй виконати перетворення таких файлів безпосередньо.

Програма автоматично пропускатиме файли, які не є звичайними файлами, зокрема каталоги та канали FIFO.

Типово, програма не вноситиме змін до символічних посилань та об’єктів посилань. Якщо потрібно, програма може замінити символічні посилання або записати перетворені дані до файла-призначення символічного посилання. У Windows запису до об’єкта символічного посилання не передбачено.

Програму dos2unix було створено за зразком програми dos2unix для SunOS/Solaris. Втім, існує одна важлива відмінність від оригінальної версії для SunOS/Solaris. Ця версія типово виконує заміну файлів під час перетворення (старий режим обробки файлів), а у оригінальній версії для SunOS/Solaris передбачено підтримку лише парного перетворення (новий режим обробки файлів). Див. також параметри -o та -n. Ще однією відмінністю є те, що у версії для SunOS/Solaris типово використовувався режим перетворення iso, а у цій версії типовим є режим перетворення ascii.

ПАРАМЕТРИ

--

Вважати усі наступні параметри назвами файлів. Цим параметром слід користуватися, якщо вам потрібно виконати перетворення файлів, чиї назви містять дефіси. Наприклад, щоб виконати перетворення файла «-foo», скористайтеся такою командою:

    dos2unix -- -foo

Або у новому режимі файлів:

    dos2unix -n -- -foo out.txt
-ascii

Виконати лише перетворення символів розриву рядків. Типовий режим перетворення.

-iso

Виконати перетворення з кодування DOS на кодування ISO-8859-1. Див. розділ щодо режимів перетворення.

-1252

Використати кодову таблицю 1252 Windows (західноєвропейські мови).

-437

Використовувати кодову сторінку DOS 437 (США). Це типова кодова сторінка для перетворення ISO.

-850

Використовувати кодову сторінку DOS 850 (західноєвропейські мови).

-860

Використовувати сторінку DOS 860 (португальська).

-863

Використовувати сторінку DOS 863 (канадська французька).

-865

Використовувати сторінку DOS 865 (скандинавські мови).

-7

Перетворювати 8-бітові символи на 7-бітові.

-b, --keep-bom

Зберегти позначку порядку байтів (BOM). Якщо у файлі вхідних даних є BOM, записати BOM до файла результатів. Це типова поведінка під час перетворення у формат із символами розриву рядків DOS. Див. також параметр -r.

-c, --convmode РЕЖИМ

Встановити режим перетворення. Значенням аргументу РЕЖИМ може бути один з таких рядків: ascii, 7bit, iso, mac. Типовим є режим ascii.

-D, --display-enc КОДУВАННЯ

Встановити кодування показаного тексту. Можливі варіанти значень параметра КОДУВАННЯ: ansi, unicode, unicodebom, utf8, utf8bom, типовим є ansi.

Цей параметр доступний лише у dos2unix для Windows з підтримкою назв файлів у Unicode. Цей параметр не впливає на справжнє читання та запис назв файлів, лише на те, як буде показано ці назви.

Існує декілька способів показу тексту у консолі Windows, заснованих на кодуванні тексту. Усі ці способи мають свої переваги і недоліки.

ansi

Типовим способом для dos2unix є кодування тексту у форматі ANSI. Перевагою є зворотна сумісність. Цей варіант працює з растровими шрифтами та шрифтами TrueType. У деяких регіонах, ймовірно, вам доведеться змінити активну кодову сторінку DOS OEM на системну кодову сторінку ANSI Windows за допомогою команди chcp, оскільки dos2unix використовує системну кодову сторінку Windows.

Недоліком ansi є те, що назви файлів із символами, яких немає у типовому системному кодуванні, буде показано неправильно. Замість цих символів ви побачите знак питання або не той символ. Якщо у вашій системі немає файлів із назвами, які містять нетипові символи, можна скористатися цим варіантом.

unicode, unicodebom

Перевагою кодування unicode (назва у Windows кодування UTF-16) є те, що зазвичай текст буде показано правильно. Змінювати активну кодову сторінку не потрібно. Ймовірно, вам потрібно встановити шрифт консолі TrueType для належного показу нестандартних символів. Якщо символ не передбачено у шрифті TrueType, зазвичай ви побачите невеличкий квадратик замість символу, іноді із знаком питання у ньому.

Якщо ви користуєтеся консоллю ConEmu, весь текст буде показано належним чином, оскільки ConEmu автоматично вибирає належний шрифт.

Недоліком unicode є те, що це кодування несумісне з ASCII. Обробка виведених даних є непростою, якщо ви передаватимете ці дані до іншої програми або файла.

Якщо використовується метод unicodebom, текст у кодуванні Unicode буде оброблено з урахуванням BOM (позначки порядку байтів). BOM потрібна для правильного переспрямовування або тунелювання даних у PowerShell.

utf8, utf8bom

Перевагою utf8 є те, що це кодування сумісне з ASCII. Вам слід встановити шрифт консолі TrueType. Якщо використано шрифт TrueType, текст буде показано подібно до того, як його показано, якщо визначено кодування unicode.

Недоліком є те, що якщо ви скористаєтеся типовим растровим шрифтом, усі символи поза ASCII буде показано неправильно. Не лише назви файлів у unicode, а й перекладені повідомлення стануть непридатними до читання. У Windows, налаштованому на роботі у східно-азійському регіоні, ви можете помітити значне блимання під час показу повідомлень.

У консолі ConEmu добре працює спосіб кодування utf8.

Якщо використовується метод utf8bom, текст у кодуванні UTF-8 буде оброблено з урахуванням BOM (позначки порядку байтів). BOM потрібна для правильного переспрямовування або тунелювання даних у PowerShell.

Типове кодування можна змінити за допомогою змінної середовища DOS2UNIX_DISPLAY_ENC встановленням для неї значення unicode, unicodebom, utf8 або utf8bom.

-f, --force

Примусове перетворення двійкових файлів.

-gb, --gb18030

У Windows файли в UTF-16 типово перетворюються на файли в UTF-8, незалежно від встановленої локалі. За допомогою цього параметра ви можете наказати програмі перетворювати файли в UTF-16 на файли у GB18030. Цим параметром можна скористатися лише у Windows. Див. також розділ, присвячений GB18030.

-h, --help

Показати довідкові дані і завершити роботу.

-i[ПРАПОРЦІ], --info[=ПРАПОРЦІ] ФАЙЛ ...

Вивести дані щодо файла. Не виконувати перетворення.

Буде виведено такі дані, у вказаному порядку: кількість розривів рядків у форматі DOS, кількість розривів рядків у форматі Unix, кількість розривів рядків у форматі Mac, позначка порядку байтів, текстовим чи бінарним є файл та назву файла.

Приклад результатів:

     6       0       0  no_bom    text    dos.txt
     0       6       0  no_bom    text    unix.txt
     0       0       6  no_bom    text    mac.txt
     6       6       6  no_bom    text    mixed.txt
    50       0       0  UTF-16LE  text    utf16le.txt
     0      50       0  no_bom    text    utf8unix.txt
    50       0       0  UTF-8     text    utf8dos.txt
     2     418     219  no_bom    binary  dos2unix.exe

Зауважте, що іноді бінарні файли помилково розпізнаються як текстові. Див. також параметр -s.

Крім того, можна вказати додаткові прапорці для внесення змін у виведені дані. Можна використовувати один або декілька таких прапорців.

d

Вивести кількість символів розривів рядка DOS.

u

Вивести кількість символів розривів рядка Unix.

m

Вивести кількість символів розривів рядка Mac.

b

Вивести позначку порядку байтів.

t

Вивести дані щодо того, є файл текстовим чи бінарним.

c

Вивести дані лише тих файлів, які було б перетворено.

Із прапорцем c dos2unix виведе лише назви файлів, у яких містяться розриви рядків DOS. unix2dos виведе лише назви файлів, у яких містяться розриви рядків Unix.

h

Вивести заголовок.

p

Показувати назви файлів без шляхів.

Приклади:

Вивести дані щодо усіх файлів *.txt:

    dos2unix -i *.txt

Вивести кількість розривів рядків у форматі DOS і розривів рядків у форматі Unix:

    dos2unix -idu *.txt

Вивести лише позначку порядку байтів:

    dos2unix --info=b *.txt

Вивести список файлів, у яких є символи розриву рядків DOS:

    dos2unix -ic *.txt

Вивести список файлів, у яких використано символи розриву рядків Unix:

    unix2dos -ic *.txt

Перетворити лише файли із розривами рядків DOS і не чіпати інших файлів:

    dos2unix -ic *.txt | xargs dos2unix

Знайти текстові файли і розривами рядків DOS:

    find -name '*.txt' | xargs dos2unix -ic
-k, --keepdate

Зберегти часову позначку файла вхідних даних у файлі результатів перетворення.

-L, --license

Вивести умови ліцензування програми.

-l, --newline

Вставити додатковий символ розриву рядка.

dos2unix: перетворення на два символи розриву рядків Unix відбуватиметься лише для комбінацій розриву рядків DOS. У режимі Mac виконуватиметься перетворення на два розриви рядків Unix лише символів розриву рядків Mac.

unix2dos: перетворення на дві комбінації розриву рядків DOS відбуватиметься лише для символів розриву рядків DOS. У режимі Mac виконуватиметься перетворення на два розриви рядків Mac лише символів розриву рядків Unix.

-m, --add-bom

Записати до файла результатів позначку порядку байтів (BOM). Типово буде записано позначку порядку байтів UTF-8.

Якщо дані початкового файла закодовано у UTF-16 і використано параметр -u, буде дописано позначку порядку байтів UTF-16.

Не використовуйте цей параметр для кодувань результатів, відмінних від UTF-8, UTF-16 або GB18030. Див. також розділ щодо UNICODE.

-n, --newfile ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...

Новий режим обробки файлів. Перетворити дані з файла ВХІДНИЙ_ФАЙЛ і записати результати до файла ВИХІДНИЙ_ФАЙЛ. Назви файлів слід вказувати парами, не слід використовувати шаблони заміни, інакше вміст файлів буде втрачено.

Власником перетвореного файла буде призначено користувача, яким було розпочато перетворення у режимі нового файла (парному режимі). Права доступу на читання або запис нового файла буде визначено на основі прав доступу до початкового файла мінус umask(1) для користувача, яким було розпочато перетворення.

-o, --oldfile ФАЙЛ ...

Застарілий режим обробки. Виконати перетворення файла ФАЙЛ і перезаписати його вміст. Типово, програма працює у цьому режимі. Можна використовувати шаблони заміни.

У застарілому режимі (режимі заміщення) перетворений файл належатиме тому самому власнику і групі і матиме ті самі права доступу на читання або запис, що і початковий файл. Крім того, якщо перетворення файла виконується іншим користувачем, який має права доступу на запис до файла (наприклад користувачем root), перетворення буде перервано, якщо зберегти початкові значення не вдасться. Зміна власника може означати неможливість читання файла для його початкового власника. Зміна групи може призвести до проблем із безпекою, оскільки файл може стати доступним для читання користувачам, які не повинні мати такі права доступу. Можливість збереження прав власності та прав доступу до файла передбачено лише у Unix.

-q, --quiet

Режим без виведення повідомлень. Програма не виводитиме жодних попереджень або повідомлень про помилки. Повернутим значенням завжди буде нуль, якщо вказано правильні параметри командного рядка.

-r, --remove-bom

Вилучити позначку порядку байтів (BOM). Не записувати BOM до файла результатів. Це типова поведінка під час перетворення файлів з форматом розриву рядків Unix. Див. також параметр -b.

-s, --safe

Пропускати двійкові файли (типово).

Пропускання бінарних файлів реалізовано для того, щоб уникнути випадкових помилок. Майте на увазі, що визначення бінарних файлів не є 100% точним. Програма просто шукає у файлах бінарні символи, які типово не трапляються у текстових файлах. Може так статися, що у бінарному файлі містяться лише звичайні текстові символи. Такий бінарний файл буде помилково сприйнято програмою як текстовий.

-u, --keep-utf16

Зберегти початкове кодування UTF-16. Файл результатів буде записано у тому самому кодуванні UTF-16, із прямим або зворотним порядком байтів, що і початковий файл. Таким чином можна запобігти перетворенню даних у кодування UTF-8. До файла буде записано відповідну позначку порядку байтів UTF-16. Вимкнути цей параметр можна за допомогою параметра -ascii.

-ul, --assume-utf16le

Припускати, що кодуванням вхідних файлів є UTF-16LE.

Якщо у початковому файлі є позначка порядку байтів (BOM), її буде використано у файлі-результаті, незалежно від використання цього параметра.

Якщо вами було зроблено помилкове припущення щодо формату файла (файл вхідних даних насправді не є файлом у форматі UTF-16LE), і дані вдасться успішно перетворити, ви отримаєте файл у кодуванні UTF-8 з помилковим вмістом. Скасувати таке помилкове перетворення можна за допомогою зворотного перетворення iconv(1) з даних у форматі UTF-8 на дані у форматі UTF-16LE. Таким чином ви повернетеся до початкового кодування даних у файлі.

Припущення щодо форматування UTF-16LE працює як визначення режиму перетворення. Перемиканням на типовий режим ascii можна вимкнути припущення щодо форматування UTF-16LE.

-ub, --assume-utf16be

Припускати, що вхідним форматом є UTF-16BE.

Цей параметр працює у спосіб, тотожний до параметра -ul.

-v, --verbose

Виводити докладні повідомлення. Буде показано додаткові дані щодо позначок порядку байтів та кількості перетворених символів розриву рядків.

Переходити за символічними посиланням і перетворювати файли, на які вони вказують.

Замінити символічні посилання перетвореними файлами (початкові файли, на які вони вказують, змінено не буде).

Не змінювати символічні посилання та файли, на які вони посилаються (типово).

-V, --version

Вивести дані щодо версії і завершити роботу.

РЕЖИМ MAC

У звичайному режимі розриви рядків DOS перетворюються на розриви рядків Unix, і навпаки. Розриви рядків Mac перетворенню не підлягають.

У режимі Mac розриви рядків Mac перетворюються на розриви рядків Unix, і навпаки. Розриви рядків DOS перетворенню не підлягають.

Щоб запустити програму у режимі перетворення Mac, скористайтеся параметром командного рядка -c mac або програмами mac2unix та unix2mac.

РЕЖИМИ ПЕРЕТВОРЕННЯ

ascii

У режимі ascii виконуватиметься лише перетворення символів розриву рядків. Цей режим є типовим режимом перетворення.

Хоча цей режим і називається режимом ASCII (стандарту 7-бітового кодування), насправді кодування символів у ньому є 8-бітовим. Завжди користуйтеся цим режимом для перетворення файлів у кодуванні UTF-8 (Unicode).

7bit

У цьому режимі усі 8-бітові символи, які не є частиною ASCII, (з номерами від 128 до 255) буде перетворено на відповідні 7-бітові символи.

iso

Перетворення символів буде виконано з кодування (кодової сторінки) DOS до кодування ISO-8859-1 (Latin-1) у Unix. Символи DOS, які не мають еквівалентів у ISO-8859-1 і перетворення яких неможливе, буде перетворено на символ крапки. Те саме стосується символів ISO-8859-1, які не мають еквівалентів у DOS.

Якщо буде використано лише параметр -iso, програма dos2unix спробує визначити активне кодування. Якщо це виявиться неможливим, dos2unix використає типове кодування CP437, яке здебільшого використовується у США. Щоб примусово визначити кодування, скористайтеся параметром -437 (США), -850 (західноєвропейські мови), -860 (португальська), -863 (канадська французька) або -865 (скандинавські мови). Використати кодування Windows CP1252 (західноєвропейські мови) можна за допомогою параметра -1252. Для інших кодувань використовуйте поєднання dos2unix з iconv(1). Програма iconv здатна виконувати перетворення даних у доволі широкому спектрі кодувань символів.

Ніколи не користуйтеся перетворенням ISO для текстових файлів у форматі Unicode. Використання подібного перетворення призведе до ушкодження вмісту файлів у кодуванні UTF-8.

Декілька прикладів:

Перетворити дані у типовому кодуванні DOS на дані у кодуванні Latin-1 Unix:

    dos2unix -iso -n in.txt out.txt

Перетворити дані у кодуванні DOS CP850 на дані у кодуванні Latin-1 Unix:

    dos2unix -850 -n in.txt out.txt

Перетворити дані у кодуванні CP1252 Windows на дані у кодуванні Latin-1 Unix:

    dos2unix -1252 -n in.txt out.txt

Перетворити дані у кодуванні CP252 Windows на дані у кодуванні UTF-8 Unix (Unicode):

    iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt

Перетворити дані у кодуванні Latin-1 Unix на дані у типовому кодуванні DOS:

    unix2dos -iso -n in.txt out.txt

Перетворити дані у кодуванні Latin-1 Unix на дані у кодуванні DOS CP850:

    unix2dos -850 -n in.txt out.txt

Перетворити дані у кодуванні Latin-1 Unix на дані у кодуванні Windows CP1252:

    unix2dos -1252 -n in.txt out.txt

Перетворити дані у кодуванні UTF-8 Unix (Unicode) на дані у кодуванні Windows CP1252:

    unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt

Див. також http://czyborra.com/charsets/codepages.html та http://czyborra.com/charsets/iso8859.html.

UNICODE

Кодування

Існує декілька різних кодувань Unicode. У Unix та Linux у файлах Unicode здебільшого використовується кодування UTF-8. У Windows для текстових файлів Unicode може бути використано кодування UTF-8, UTF-16 або UTF-16 зі зворотним порядком байтів. Втім, здебільшого, використовується формат UTF-16.

Перетворення

У текстових файлах Unicode, як і у звичайних текстових файлах, може бути використано розриви рядків DOS, Unix або Mac.

Усі версії dos2unix та unix2dos здатні виконувати перетворення у кодуванні UTF-8, оскільки UTF-8 було розроблено так, що зворотну сумісність з ASCII збережено.

Програми dos2unix та unix2dos, зібрані з підтримкою Unicode UTF-16, можуть читати текстові файли у кодуванні UTF-16 з прямим та зворотним порядком байтів. Щоб дізнатися про те, чи було dos2unix зібрано з підтримкою UTF-16, віддайте команду dos2unix -V.

У Unix/Linux файли у кодуванні UTF-16 перетворюються на файли у кодуванні локалі. Для визначення поточного кодування символів локалі скористайтеся командою locale(1). Якщо перетворення виявиться неможливим, програма повідомить про помилку перетворення і пропустить відповідний файл.

У Windows файли UTF-16 типово буде перетворено на файли UTF-8. Обидва типи систем, Windows та Unix/Linux, мають непогані можливості з підтримки файлів у форматуванні UTF-8.

Кодування UTF-16 та UTF-8 є повністю сумісними. Під час перетворення не буде втрачено жодної інформації. Якщо під час перетворення даних у кодуванні UTF-16 на дані у кодуванні UTF-8 трапиться помилка, наприклад, якщо у вхідному файлі UTF-16 міститиметься якась помилка, файл буде пропущено.

Якщо використано параметр -u, файл результатів буде записано у тому самому кодуванні UTF-16, що і початковий файл. Використання параметра Option -u запобігає перетворенню даних у кодування UTF-8.

У dos2unix та unix2dos не передбачено параметра для перетворення даних у кодуванні UTF-8 на дані у кодуванні UTF-16.

Режим перетворення ISO та 7-бітовий режим не працюють для файлів UTF-16.

Позначка порядку байтів

У Windows до текстових файлів у кодуванні Unicode типово дописується позначка порядку байтів (BOM), оскільки багато програм Windows (зокрема Notepad) додають таку позначку автоматично. Див. також http://en.wikipedia.org/wiki/Byte_order_mark.

У Unix файли у кодуванні Unicode типово не містять позначки порядку байтів. Вважається, що кодуванням текстових файлів є те кодування, яке визначається поточною локаллю.

Програма dos2unix може визначити, чи є кодуванням файла UTF-16, лише якщо у файлі міститься позначка порядку байтів. Якщо у файлі, де використано кодування UTF-16, немає такої позначки, dos2unix вважатиме такий файл двійковим (бінарним).

Для перетворення файлів UTF-16 без позначки порядку байтів скористайтеся параметром -ul або -ub.

Типово dos2unix не записує до файлів результатів перетворення позначки порядку байтів (BOM). Якщо використано параметр -b, dos2unix запише до файла результатів BOM, якщо BOM була у файлі початкових даних.

Типово unix2dos записує позначку порядку байтів (BOM) до файла результатів, якщо BOM є у початковому файлі. Скористайтеся параметром -r, щоб вилучити BOM.

Dos2unix та unix2dos завжди записують до файла результатів позначку порядку байтів (BOM), якщо використано параметр -m.

Назви файлів у Unicode у Windows

У dos2unix передбачено підтримку читання і запису назв файлів Unicode у командному рядку Windows. Це означає, що dos2unix може відкривати файли, у назвах яких є символи, які не є частиною типової системної кодової сторінки ANSI. Щоб визначити, чи зібрано dos2unix для Windows з підтримкою назв файлів у кодуванні Unicode, скористайтеся командою dos2unix -V.

Із показом назв файлів у кодуванні Unicode у консолі Windows пов’язано декілька проблем. Див. параметр -D, --display-enc. Назви файлів може бути некоректно показано у консолі, але запис цих назв відбуватиметься належним чином.

Приклади для Unicode

Перетворити дані з Windows UTF-16 (з позначкою порядку байтів (BOM)) у формат Unix UTF-8:

    dos2unix -n in.txt out.txt

Перетворити дані у форматі Windows UTF-16LE (без BOM) на дані у форматі UTF-8 Unix:

    dos2unix -ul -n in.txt out.txt

Перетворити дані у кодуванні UTF-8 Unix на дані у кодуванні Windows UTF-8 без BOM:

    unix2dos -m -n in.txt out.txt

Перетворити дані у кодуванні UTF-8 Unix на дані у кодуванні Windows UTF-16:

    unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt

GB18030

GB18030 є китайським урядовим стандартом. Підтримка обов’язкової підмножини стандарту GB18030 є неодмінною вимогою до будь-яких програмних продуктів, які продаються у Китаї. Див. також http://en.wikipedia.org/wiki/GB_18030.

Кодування GB18030 є повністю сумісним із Unicode. Його можна розглядати як формат перетворення unicode. Подібно до UTF-8, GB18030 є сумісним із ASCII. GB18030 також є сумісним із кодовою сторінкою Windows 936, яку ще називають GBK.

У Unix/Linux файли UTF-16 буде перетворено до кодування GB18030, якщо кодуванням локалі є GB18030. Зауважте, що це спрацює, лише якщо підтримку локалі передбачено у системі. Щоб отримати список підтримуваних локалей, скористайтеся командою locale -a.

У Windows для перетворення файлів UTF-16 на файли GB18030 слід вказати параметр -gb.

У файлах у кодуванні GB18030 може міститися позначка порядку байтів, так само, як у файлах у кодуванні Unicode.

ПРИКЛАДИ

Прочитати вхідні дані зі стандартного джерела (stdin) і записати результат до стандартного виведення (stdout):

    dos2unix < a.txt
    cat a.txt | dos2unix

Перетворити дані у a.txt і замістити цей файл. Перетворити дані у b.txt і замістити цей файл:

    dos2unix a.txt b.txt
    dos2unix -o a.txt b.txt

Перетворити дані у a.txt і замістити файл у режимі перетворення ascii:

    dos2unix a.txt

Перетворити дані у a.txt і замістити файл у режимі перетворення ascii. Перетворити дані у b.txt і замістити цей файл у режимі 7-бітового перетворення:

    dos2unix a.txt -c 7bit b.txt
    dos2unix -c ascii a.txt -c 7bit b.txt
    dos2unix -ascii a.txt -7 b.txt

Перетворити файл a.txt з формату Mac на формат Unix:

    dos2unix -c mac a.txt
    mac2unix a.txt

Перетворити файл a.txt з формату Unix на формат Mac:

    unix2dos -c mac a.txt
    unix2mac a.txt

Перетворити дані у a.txt, замістити цей файл і зберегти часову позначку початкового файла:

    dos2unix -k a.txt
    dos2unix -k -o a.txt

Перетворити дані у файлі a.txt і записати результати до файла e.txt:

    dos2unix -n a.txt e.txt

Перетворити дані у файлі a.txt і записати результати до файла e.txt. Скопіювати часову позначку файла a.txt для файла e.txt:

    dos2unix -k -n a.txt e.txt

Перетворити дані у a.txt і замістити цей файл. Перетворити дані у b.txt і записати результат до e.txt:

    dos2unix a.txt -n b.txt e.txt
    dos2unix -o a.txt -n b.txt e.txt

Перетворити дані у c.txt і записати результати до e.txt. Перетворити дані у a.txt і замістити ними цей файл. Перетворити дані у b.txt і замістити ними цей файл. Перетворити дані у d.txt і записати результати до f.txt:

    dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt

РЕКУРСИВНЕ ПЕРЕТВОРЕННЯ

Для рекурсивного перетворення текстових файлів у ієрархії каталогів слід використовувати dos2unix у поєднанні з програмами find(1) та xargs(1). Наприклад, щоб виконати перетворення усіх файлів .txt у структурі підкаталогів поточного каталогу, віддайте таку команду:

    find . -name '*.txt' |xargs dos2unix

У командному рядку Windows можна скористатися такою командою:

    for /R %G in (*.txt) do dos2unix "%G"

Користувачі PowerShell можуть скористатися такою командою у Windows PowerShell:

    get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}

ЛОКАЛІЗАЦІЯ

LANG

Основна мова визначається за допомогою змінної середовища LANG. Значення змінної LANG складається з декількох частин. Перша частина записується малими літерами і визначає код мови. Друга частина є необов’язковою, визначає код країни і записується прописними літерами, відокремлюється від першої частини символом підкреслювання. Передбачено також необов’язкову третю частину: кодування. Ця частина відокремлюється від другої частини крапкою. Ось декілька прикладів для командних оболонок стандартного типу POSIX:

    export LANG=uk               українська
    export LANG=uk_UA            українська, Україна
    export LANG=ru_UA            російська, Україна
    export LANG=es_ES            іспанська, Іспанія
    export LANG=es_MX            іспанська, Мексика
    export LANG=en_US.iso88591   англійська, США, кодування Latin-1
    export LANG=en_GB.UTF-8      англійська, Великобританія, кодування UTF-8

Повний список мов та кодів країн наведено у підручнику з gettext: http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

У системах Unix для отримання даних щодо локалі можна скористатися командою locale(1).

LANGUAGE

За допомогою змінної середовища LANGUAGE ви можете вказати список пріоритеності мов. Записи у списку слід відокремлювати двокрапками. Програма dos2unix надає перевагу LANGUAGE над LANG. Наприклад, перша голландська, далі німецька: LANGUAGE=nl:de. Спочатку вам слід увімкнути локалізацію, встановивши для змінної LANG (або LC_ALL) значення, відмінне від «C». Далі ви зможете використовувати список пріоритетності мов за допомогою змінної LANGUAGE. Додаткові відомості можна знайти у підручнику з gettext: http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

Якщо вами буде вибрано мову, перекладу якою немає, буде показано стандартні повідомлення англійською мовою.

DOS2UNIX_LOCALEDIR

Змінну LOCALEDIR, встановлену під час збирання програми, можна змінити за допомогою змінної середовища DOS2UNIX_LOCALEDIR. LOCALEDIR використовується для пошуку файлів перекладів. Типовим значенням у системах GNU є /usr/local/share/locale. Переглянути поточне значення змінної LOCALEDIR можна переглянути за допомогою параметра --version.

Приклад (командна оболонка POSIX):

    export DOS2UNIX_LOCALEDIR=$HOME/share/locale

ПОВЕРНУТЕ ЗНАЧЕННЯ

Якщо завдання вдасться успішно виконати, програма поверне нульовий код виходу. Якщо станеться системна помилка, буде повернуто код цієї помилки. Якщо станеться якась інша помилка, буде повернуто код 1.

У режимі без повідомлень повернутим значенням завжди буде нуль, якщо вказано правильні параметри командного рядка.

СТАНДАРТИ

http://en.wikipedia.org/wiki/Text_file

http://uk.wikipedia.org/wiki/Carriage_return

http://uk.wikipedia.org/wiki/Newline

http://uk.wikipedia.org/wiki/Unicode

АВТОРИ

Benjamin Lin - <blin@socs.uts.edu.au>, Bernd Johannes Wuebben (режим mac2unix) - <wuebben@kde.org>, Christian Wurll (додатковий новий рядок) - <wurll@ira.uka.de>, Erwin Waterlander - <waterlan@xs4all.nl> (супровідник)

Сторінка проекту: http://waterlan.home.xs4all.nl/dos2unix.html

Сторінка на SourceForge: http://sourceforge.net/projects/dos2unix/

ТАКОЖ ПЕРЕГЛЯНЬТЕ

file(1) find(1) iconv(1) locale(1) xargs(1)

dos2unix-7.3.4/man/uk/man1/dos2unix.pod0000644000175500010010000013613312721132562017064 0ustar waterlanGeen ***************************************************** * GENERATED FILE, DO NOT EDIT * * THIS IS NO SOURCE FILE, BUT RESULT OF COMPILATION * ***************************************************** This file was generated by po4a(7). Do not store it (in VCS, for example), but store the PO file used as source file by po4a-translate. In fact, consider this as a binary, and the PO file as a regular .c file: If the PO get lost, keeping this translation up-to-date will be harder. =pod =encoding UTF-8 =head1 НАЗВА dos2unix - програма для перетворення даних у текстовому форматі DOS/Mac у формат Unix, і навпаки =head1 КОРОТКИЙ ОПИС dos2unix [параметри] [ФАЙЛ ...] [-n ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...] unix2dos [параметри] [ФАЙЛ ...] [-n ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...] =head1 ОПИС До складу пакунка Dos2unix включено програми C та C, призначені для перетворення звичайних текстових даних у форматі DOS або Mac на дані у форматі Unix, і навпаки. У текстових файлах DOS/Windows розрив рядка або перехід на новий рядок здійснюється за допомогою комбінації двох символів: повернення каретки (CR) і переведення рядка (LF). У текстових файлах Unix за перехід на новий рядок відповідає один символ: переведення рядка (LF). У текстових файлах Mac, до Mac OS X, за розрив рядка відповідав один символ: повернення каретки (CR). У сучасних версіях Mac OS використовується типовий для Unix розрив рядка (LF). Окрім символів розриву рядка, програма Dos2unix здатна виконувати перетворення кодування файлів. Можна перетворити дані у декількох кодуваннях DOS на файли у кодуванні Latin-1 Unix. Також можна перетворити дані у файлах Windows Unicode (UTF-16) на дані у кодуванні Unix Unicode (UTF-8). Під час перетворення програма пропускатиме двійкові файли, якщо ви не накажете їй виконати перетворення таких файлів безпосередньо. Програма автоматично пропускатиме файли, які не є звичайними файлами, зокрема каталоги та канали FIFO. Типово, програма не вноситиме змін до символічних посилань та об’єктів посилань. Якщо потрібно, програма може замінити символічні посилання або записати перетворені дані до файла-призначення символічного посилання. У Windows запису до об’єкта символічного посилання не передбачено. Програму dos2unix було створено за зразком програми dos2unix для SunOS/Solaris. Втім, існує одна важлива відмінність від оригінальної версії для SunOS/Solaris. Ця версія типово виконує заміну файлів під час перетворення (старий режим обробки файлів), а у оригінальній версії для SunOS/Solaris передбачено підтримку лише парного перетворення (новий режим обробки файлів). Див. також параметри C<-o> та C<-n>. Ще однією відмінністю є те, що у версії для SunOS/Solaris типово використовувався режим перетворення I, а у цій версії типовим є режим перетворення I. =head1 ПАРАМЕТРИ =over 4 =item B<--> Вважати усі наступні параметри назвами файлів. Цим параметром слід користуватися, якщо вам потрібно виконати перетворення файлів, чиї назви містять дефіси. Наприклад, щоб виконати перетворення файла «-foo», скористайтеся такою командою: dos2unix -- -foo Або у новому режимі файлів: dos2unix -n -- -foo out.txt =item B<-ascii> Виконати лише перетворення символів розриву рядків. Типовий режим перетворення. =item B<-iso> Виконати перетворення з кодування DOS на кодування ISO-8859-1. Див. розділ щодо режимів перетворення. =item B<-1252> Використати кодову таблицю 1252 Windows (західноєвропейські мови). =item B<-437> Використовувати кодову сторінку DOS 437 (США). Це типова кодова сторінка для перетворення ISO. =item B<-850> Використовувати кодову сторінку DOS 850 (західноєвропейські мови). =item B<-860> Використовувати сторінку DOS 860 (португальська). =item B<-863> Використовувати сторінку DOS 863 (канадська французька). =item B<-865> Використовувати сторінку DOS 865 (скандинавські мови). =item B<-7> Перетворювати 8-бітові символи на 7-бітові. =item B<-b, --keep-bom> Зберегти позначку порядку байтів (BOM). Якщо у файлі вхідних даних є BOM, записати BOM до файла результатів. Це типова поведінка під час перетворення у формат із символами розриву рядків DOS. Див. також параметр C<-r>. =item B<-c, --convmode РЕЖИМ> Встановити режим перетворення. Значенням аргументу РЕЖИМ може бути один з таких рядків: I, I<7bit>, I, I. Типовим є режим ascii. =item B<-D, --display-enc КОДУВАННЯ> Встановити кодування показаного тексту. Можливі варіанти значень параметра КОДУВАННЯ: I, I, I, I, I, типовим є ansi. Цей параметр доступний лише у dos2unix для Windows з підтримкою назв файлів у Unicode. Цей параметр не впливає на справжнє читання та запис назв файлів, лише на те, як буде показано ці назви. Існує декілька способів показу тексту у консолі Windows, заснованих на кодуванні тексту. Усі ці способи мають свої переваги і недоліки. =over 4 =item B Типовим способом для dos2unix є кодування тексту у форматі ANSI. Перевагою є зворотна сумісність. Цей варіант працює з растровими шрифтами та шрифтами TrueType. У деяких регіонах, ймовірно, вам доведеться змінити активну кодову сторінку DOS OEM на системну кодову сторінку ANSI Windows за допомогою команди C, оскільки dos2unix використовує системну кодову сторінку Windows. Недоліком ansi є те, що назви файлів із символами, яких немає у типовому системному кодуванні, буде показано неправильно. Замість цих символів ви побачите знак питання або не той символ. Якщо у вашій системі немає файлів із назвами, які містять нетипові символи, можна скористатися цим варіантом. =item B Перевагою кодування unicode (назва у Windows кодування UTF-16) є те, що зазвичай текст буде показано правильно. Змінювати активну кодову сторінку не потрібно. Ймовірно, вам потрібно встановити шрифт консолі TrueType для належного показу нестандартних символів. Якщо символ не передбачено у шрифті TrueType, зазвичай ви побачите невеличкий квадратик замість символу, іноді із знаком питання у ньому. Якщо ви користуєтеся консоллю ConEmu, весь текст буде показано належним чином, оскільки ConEmu автоматично вибирає належний шрифт. Недоліком unicode є те, що це кодування несумісне з ASCII. Обробка виведених даних є непростою, якщо ви передаватимете ці дані до іншої програми або файла. Якщо використовується метод C, текст у кодуванні Unicode буде оброблено з урахуванням BOM (позначки порядку байтів). BOM потрібна для правильного переспрямовування або тунелювання даних у PowerShell. =item B Перевагою utf8 є те, що це кодування сумісне з ASCII. Вам слід встановити шрифт консолі TrueType. Якщо використано шрифт TrueType, текст буде показано подібно до того, як його показано, якщо визначено кодування C. Недоліком є те, що якщо ви скористаєтеся типовим растровим шрифтом, усі символи поза ASCII буде показано неправильно. Не лише назви файлів у unicode, а й перекладені повідомлення стануть непридатними до читання. У Windows, налаштованому на роботі у східно-азійському регіоні, ви можете помітити значне блимання під час показу повідомлень. У консолі ConEmu добре працює спосіб кодування utf8. Якщо використовується метод C, текст у кодуванні UTF-8 буде оброблено з урахуванням BOM (позначки порядку байтів). BOM потрібна для правильного переспрямовування або тунелювання даних у PowerShell. =back Типове кодування можна змінити за допомогою змінної середовища DOS2UNIX_DISPLAY_ENC встановленням для неї значення C, C, C або C. =item B<-f, --force> Примусове перетворення двійкових файлів. =item B<-gb, --gb18030> У Windows файли в UTF-16 типово перетворюються на файли в UTF-8, незалежно від встановленої локалі. За допомогою цього параметра ви можете наказати програмі перетворювати файли в UTF-16 на файли у GB18030. Цим параметром можна скористатися лише у Windows. Див. також розділ, присвячений GB18030. =item B<-h, --help> Показати довідкові дані і завершити роботу. =item B<-i[ПРАПОРЦІ], --info[=ПРАПОРЦІ] ФАЙЛ ...> Вивести дані щодо файла. Не виконувати перетворення. Буде виведено такі дані, у вказаному порядку: кількість розривів рядків у форматі DOS, кількість розривів рядків у форматі Unix, кількість розривів рядків у форматі Mac, позначка порядку байтів, текстовим чи бінарним є файл та назву файла. Приклад результатів: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Зауважте, що іноді бінарні файли помилково розпізнаються як текстові. Див. також параметр C<-s>. Крім того, можна вказати додаткові прапорці для внесення змін у виведені дані. Можна використовувати один або декілька таких прапорців. =over 4 =item B Вивести кількість символів розривів рядка DOS. =item B Вивести кількість символів розривів рядка Unix. =item B Вивести кількість символів розривів рядка Mac. =item B Вивести позначку порядку байтів. =item B Вивести дані щодо того, є файл текстовим чи бінарним. =item B Вивести дані лише тих файлів, які було б перетворено. Із прапорцем C dos2unix виведе лише назви файлів, у яких містяться розриви рядків DOS. unix2dos виведе лише назви файлів, у яких містяться розриви рядків Unix. =item B Вивести заголовок. =item B

Показувати назви файлів без шляхів. =back Приклади: Вивести дані щодо усіх файлів *.txt: dos2unix -i *.txt Вивести кількість розривів рядків у форматі DOS і розривів рядків у форматі Unix: dos2unix -idu *.txt Вивести лише позначку порядку байтів: dos2unix --info=b *.txt Вивести список файлів, у яких є символи розриву рядків DOS: dos2unix -ic *.txt Вивести список файлів, у яких використано символи розриву рядків Unix: unix2dos -ic *.txt Перетворити лише файли із розривами рядків DOS і не чіпати інших файлів: dos2unix -ic *.txt | xargs dos2unix Знайти текстові файли і розривами рядків DOS: find -name '*.txt' | xargs dos2unix -ic =item B<-k, --keepdate> Зберегти часову позначку файла вхідних даних у файлі результатів перетворення. =item B<-L, --license> Вивести умови ліцензування програми. =item B<-l, --newline> Вставити додатковий символ розриву рядка. B: перетворення на два символи розриву рядків Unix відбуватиметься лише для комбінацій розриву рядків DOS. У режимі Mac виконуватиметься перетворення на два розриви рядків Unix лише символів розриву рядків Mac. B: перетворення на дві комбінації розриву рядків DOS відбуватиметься лише для символів розриву рядків DOS. У режимі Mac виконуватиметься перетворення на два розриви рядків Mac лише символів розриву рядків Unix. =item B<-m, --add-bom> Записати до файла результатів позначку порядку байтів (BOM). Типово буде записано позначку порядку байтів UTF-8. Якщо дані початкового файла закодовано у UTF-16 і використано параметр C<-u>, буде дописано позначку порядку байтів UTF-16. Не використовуйте цей параметр для кодувань результатів, відмінних від UTF-8, UTF-16 або GB18030. Див. також розділ щодо UNICODE. =item B<-n, --newfile ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...> Новий режим обробки файлів. Перетворити дані з файла ВХІДНИЙ_ФАЙЛ і записати результати до файла ВИХІДНИЙ_ФАЙЛ. Назви файлів слід вказувати парами, I<не слід> використовувати шаблони заміни, інакше вміст файлів I<буде втрачено>. Власником перетвореного файла буде призначено користувача, яким було розпочато перетворення у режимі нового файла (парному режимі). Права доступу на читання або запис нового файла буде визначено на основі прав доступу до початкового файла мінус umask(1) для користувача, яким було розпочато перетворення. =item B<-o, --oldfile ФАЙЛ ...> Застарілий режим обробки. Виконати перетворення файла ФАЙЛ і перезаписати його вміст. Типово, програма працює у цьому режимі. Можна використовувати шаблони заміни. У застарілому режимі (режимі заміщення) перетворений файл належатиме тому самому власнику і групі і матиме ті самі права доступу на читання або запис, що і початковий файл. Крім того, якщо перетворення файла виконується іншим користувачем, який має права доступу на запис до файла (наприклад користувачем root), перетворення буде перервано, якщо зберегти початкові значення не вдасться. Зміна власника може означати неможливість читання файла для його початкового власника. Зміна групи може призвести до проблем із безпекою, оскільки файл може стати доступним для читання користувачам, які не повинні мати такі права доступу. Можливість збереження прав власності та прав доступу до файла передбачено лише у Unix. =item B<-q, --quiet> Режим без виведення повідомлень. Програма не виводитиме жодних попереджень або повідомлень про помилки. Повернутим значенням завжди буде нуль, якщо вказано правильні параметри командного рядка. =item B<-r, --remove-bom> Вилучити позначку порядку байтів (BOM). Не записувати BOM до файла результатів. Це типова поведінка під час перетворення файлів з форматом розриву рядків Unix. Див. також параметр C<-b>. =item B<-s, --safe> Пропускати двійкові файли (типово). Пропускання бінарних файлів реалізовано для того, щоб уникнути випадкових помилок. Майте на увазі, що визначення бінарних файлів не є 100% точним. Програма просто шукає у файлах бінарні символи, які типово не трапляються у текстових файлах. Може так статися, що у бінарному файлі містяться лише звичайні текстові символи. Такий бінарний файл буде помилково сприйнято програмою як текстовий. =item B<-u, --keep-utf16> Зберегти початкове кодування UTF-16. Файл результатів буде записано у тому самому кодуванні UTF-16, із прямим або зворотним порядком байтів, що і початковий файл. Таким чином можна запобігти перетворенню даних у кодування UTF-8. До файла буде записано відповідну позначку порядку байтів UTF-16. Вимкнути цей параметр можна за допомогою параметра C<-ascii>. =item B<-ul, --assume-utf16le> Припускати, що кодуванням вхідних файлів є UTF-16LE. Якщо у початковому файлі є позначка порядку байтів (BOM), її буде використано у файлі-результаті, незалежно від використання цього параметра. Якщо вами було зроблено помилкове припущення щодо формату файла (файл вхідних даних насправді не є файлом у форматі UTF-16LE), і дані вдасться успішно перетворити, ви отримаєте файл у кодуванні UTF-8 з помилковим вмістом. Скасувати таке помилкове перетворення можна за допомогою зворотного перетворення iconv(1) з даних у форматі UTF-8 на дані у форматі UTF-16LE. Таким чином ви повернетеся до початкового кодування даних у файлі. Припущення щодо форматування UTF-16LE працює як визначення I<режиму перетворення>. Перемиканням на типовий режим I можна вимкнути припущення щодо форматування UTF-16LE. =item B<-ub, --assume-utf16be> Припускати, що вхідним форматом є UTF-16BE. Цей параметр працює у спосіб, тотожний до параметра C<-ul>. =item B<-v, --verbose> Виводити докладні повідомлення. Буде показано додаткові дані щодо позначок порядку байтів та кількості перетворених символів розриву рядків. =item B<-F, --follow-symlink> Переходити за символічними посиланням і перетворювати файли, на які вони вказують. =item B<-R, --replace-symlink> Замінити символічні посилання перетвореними файлами (початкові файли, на які вони вказують, змінено не буде). =item B<-S, --skip-symlink> Не змінювати символічні посилання та файли, на які вони посилаються (типово). =item B<-V, --version> Вивести дані щодо версії і завершити роботу. =back =head1 РЕЖИМ MAC У звичайному режимі розриви рядків DOS перетворюються на розриви рядків Unix, і навпаки. Розриви рядків Mac перетворенню не підлягають. У режимі Mac розриви рядків Mac перетворюються на розриви рядків Unix, і навпаки. Розриви рядків DOS перетворенню не підлягають. Щоб запустити програму у режимі перетворення Mac, скористайтеся параметром командного рядка C<-c mac> або програмами C та C. =head1 РЕЖИМИ ПЕРЕТВОРЕННЯ =over 4 =item B У режимі C виконуватиметься лише перетворення символів розриву рядків. Цей режим є типовим режимом перетворення. Хоча цей режим і називається режимом ASCII (стандарту 7-бітового кодування), насправді кодування символів у ньому є 8-бітовим. Завжди користуйтеся цим режимом для перетворення файлів у кодуванні UTF-8 (Unicode). =item B<7bit> У цьому режимі усі 8-бітові символи, які не є частиною ASCII, (з номерами від 128 до 255) буде перетворено на відповідні 7-бітові символи. =item B Перетворення символів буде виконано з кодування (кодової сторінки) DOS до кодування ISO-8859-1 (Latin-1) у Unix. Символи DOS, які не мають еквівалентів у ISO-8859-1 і перетворення яких неможливе, буде перетворено на символ крапки. Те саме стосується символів ISO-8859-1, які не мають еквівалентів у DOS. Якщо буде використано лише параметр C<-iso>, програма dos2unix спробує визначити активне кодування. Якщо це виявиться неможливим, dos2unix використає типове кодування CP437, яке здебільшого використовується у США. Щоб примусово визначити кодування, скористайтеся параметром C<-437> (США), C<-850> (західноєвропейські мови), C<-860> (португальська), C<-863> (канадська французька) або C<-865> (скандинавські мови). Використати кодування Windows CP1252 (західноєвропейські мови) можна за допомогою параметра C<-1252>. Для інших кодувань використовуйте поєднання dos2unix з iconv(1). Програма iconv здатна виконувати перетворення даних у доволі широкому спектрі кодувань символів. Ніколи не користуйтеся перетворенням ISO для текстових файлів у форматі Unicode. Використання подібного перетворення призведе до ушкодження вмісту файлів у кодуванні UTF-8. Декілька прикладів: Перетворити дані у типовому кодуванні DOS на дані у кодуванні Latin-1 Unix: dos2unix -iso -n in.txt out.txt Перетворити дані у кодуванні DOS CP850 на дані у кодуванні Latin-1 Unix: dos2unix -850 -n in.txt out.txt Перетворити дані у кодуванні CP1252 Windows на дані у кодуванні Latin-1 Unix: dos2unix -1252 -n in.txt out.txt Перетворити дані у кодуванні CP252 Windows на дані у кодуванні UTF-8 Unix (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Перетворити дані у кодуванні Latin-1 Unix на дані у типовому кодуванні DOS: unix2dos -iso -n in.txt out.txt Перетворити дані у кодуванні Latin-1 Unix на дані у кодуванні DOS CP850: unix2dos -850 -n in.txt out.txt Перетворити дані у кодуванні Latin-1 Unix на дані у кодуванні Windows CP1252: unix2dos -1252 -n in.txt out.txt Перетворити дані у кодуванні UTF-8 Unix (Unicode) на дані у кодуванні Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt Див. також L та L. =back =head1 UNICODE =head2 Кодування Існує декілька різних кодувань Unicode. У Unix та Linux у файлах Unicode здебільшого використовується кодування UTF-8. У Windows для текстових файлів Unicode може бути використано кодування UTF-8, UTF-16 або UTF-16 зі зворотним порядком байтів. Втім, здебільшого, використовується формат UTF-16. =head2 Перетворення У текстових файлах Unicode, як і у звичайних текстових файлах, може бути використано розриви рядків DOS, Unix або Mac. Усі версії dos2unix та unix2dos здатні виконувати перетворення у кодуванні UTF-8, оскільки UTF-8 було розроблено так, що зворотну сумісність з ASCII збережено. Програми dos2unix та unix2dos, зібрані з підтримкою Unicode UTF-16, можуть читати текстові файли у кодуванні UTF-16 з прямим та зворотним порядком байтів. Щоб дізнатися про те, чи було dos2unix зібрано з підтримкою UTF-16, віддайте команду C. У Unix/Linux файли у кодуванні UTF-16 перетворюються на файли у кодуванні локалі. Для визначення поточного кодування символів локалі скористайтеся командою locale(1). Якщо перетворення виявиться неможливим, програма повідомить про помилку перетворення і пропустить відповідний файл. У Windows файли UTF-16 типово буде перетворено на файли UTF-8. Обидва типи систем, Windows та Unix/Linux, мають непогані можливості з підтримки файлів у форматуванні UTF-8. Кодування UTF-16 та UTF-8 є повністю сумісними. Під час перетворення не буде втрачено жодної інформації. Якщо під час перетворення даних у кодуванні UTF-16 на дані у кодуванні UTF-8 трапиться помилка, наприклад, якщо у вхідному файлі UTF-16 міститиметься якась помилка, файл буде пропущено. Якщо використано параметр C<-u>, файл результатів буде записано у тому самому кодуванні UTF-16, що і початковий файл. Використання параметра Option C<-u> запобігає перетворенню даних у кодування UTF-8. У dos2unix та unix2dos не передбачено параметра для перетворення даних у кодуванні UTF-8 на дані у кодуванні UTF-16. Режим перетворення ISO та 7-бітовий режим не працюють для файлів UTF-16. =head2 Позначка порядку байтів У Windows до текстових файлів у кодуванні Unicode типово дописується позначка порядку байтів (BOM), оскільки багато програм Windows (зокрема Notepad) додають таку позначку автоматично. Див. також L. У Unix файли у кодуванні Unicode типово не містять позначки порядку байтів. Вважається, що кодуванням текстових файлів є те кодування, яке визначається поточною локаллю. Програма dos2unix може визначити, чи є кодуванням файла UTF-16, лише якщо у файлі міститься позначка порядку байтів. Якщо у файлі, де використано кодування UTF-16, немає такої позначки, dos2unix вважатиме такий файл двійковим (бінарним). Для перетворення файлів UTF-16 без позначки порядку байтів скористайтеся параметром C<-ul> або C<-ub>. Типово dos2unix не записує до файлів результатів перетворення позначки порядку байтів (BOM). Якщо використано параметр C<-b>, dos2unix запише до файла результатів BOM, якщо BOM була у файлі початкових даних. Типово unix2dos записує позначку порядку байтів (BOM) до файла результатів, якщо BOM є у початковому файлі. Скористайтеся параметром C<-r>, щоб вилучити BOM. Dos2unix та unix2dos завжди записують до файла результатів позначку порядку байтів (BOM), якщо використано параметр C<-m>. =head2 Назви файлів у Unicode у Windows У dos2unix передбачено підтримку читання і запису назв файлів Unicode у командному рядку Windows. Це означає, що dos2unix може відкривати файли, у назвах яких є символи, які не є частиною типової системної кодової сторінки ANSI. Щоб визначити, чи зібрано dos2unix для Windows з підтримкою назв файлів у кодуванні Unicode, скористайтеся командою C. Із показом назв файлів у кодуванні Unicode у консолі Windows пов’язано декілька проблем. Див. параметр C<-D>, C<--display-enc>. Назви файлів може бути некоректно показано у консолі, але запис цих назв відбуватиметься належним чином. =head2 Приклади для Unicode Перетворити дані з Windows UTF-16 (з позначкою порядку байтів (BOM)) у формат Unix UTF-8: dos2unix -n in.txt out.txt Перетворити дані у форматі Windows UTF-16LE (без BOM) на дані у форматі UTF-8 Unix: dos2unix -ul -n in.txt out.txt Перетворити дані у кодуванні UTF-8 Unix на дані у кодуванні Windows UTF-8 без BOM: unix2dos -m -n in.txt out.txt Перетворити дані у кодуванні UTF-8 Unix на дані у кодуванні Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt =head1 GB18030 GB18030 є китайським урядовим стандартом. Підтримка обов’язкової підмножини стандарту GB18030 є неодмінною вимогою до будь-яких програмних продуктів, які продаються у Китаї. Див. також L. Кодування GB18030 є повністю сумісним із Unicode. Його можна розглядати як формат перетворення unicode. Подібно до UTF-8, GB18030 є сумісним із ASCII. GB18030 також є сумісним із кодовою сторінкою Windows 936, яку ще називають GBK. У Unix/Linux файли UTF-16 буде перетворено до кодування GB18030, якщо кодуванням локалі є GB18030. Зауважте, що це спрацює, лише якщо підтримку локалі передбачено у системі. Щоб отримати список підтримуваних локалей, скористайтеся командою C. У Windows для перетворення файлів UTF-16 на файли GB18030 слід вказати параметр C<-gb>. У файлах у кодуванні GB18030 може міститися позначка порядку байтів, так само, як у файлах у кодуванні Unicode. =head1 ПРИКЛАДИ Прочитати вхідні дані зі стандартного джерела (stdin) і записати результат до стандартного виведення (stdout): dos2unix < a.txt cat a.txt | dos2unix Перетворити дані у a.txt і замістити цей файл. Перетворити дані у b.txt і замістити цей файл: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Перетворити дані у a.txt і замістити файл у режимі перетворення ascii: dos2unix a.txt Перетворити дані у a.txt і замістити файл у режимі перетворення ascii. Перетворити дані у b.txt і замістити цей файл у режимі 7-бітового перетворення: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Перетворити файл a.txt з формату Mac на формат Unix: dos2unix -c mac a.txt mac2unix a.txt Перетворити файл a.txt з формату Unix на формат Mac: unix2dos -c mac a.txt unix2mac a.txt Перетворити дані у a.txt, замістити цей файл і зберегти часову позначку початкового файла: dos2unix -k a.txt dos2unix -k -o a.txt Перетворити дані у файлі a.txt і записати результати до файла e.txt: dos2unix -n a.txt e.txt Перетворити дані у файлі a.txt і записати результати до файла e.txt. Скопіювати часову позначку файла a.txt для файла e.txt: dos2unix -k -n a.txt e.txt Перетворити дані у a.txt і замістити цей файл. Перетворити дані у b.txt і записати результат до e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Перетворити дані у c.txt і записати результати до e.txt. Перетворити дані у a.txt і замістити ними цей файл. Перетворити дані у b.txt і замістити ними цей файл. Перетворити дані у d.txt і записати результати до f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 РЕКУРСИВНЕ ПЕРЕТВОРЕННЯ Для рекурсивного перетворення текстових файлів у ієрархії каталогів слід використовувати dos2unix у поєднанні з програмами find(1) та xargs(1). Наприклад, щоб виконати перетворення усіх файлів .txt у структурі підкаталогів поточного каталогу, віддайте таку команду: find . -name '*.txt' |xargs dos2unix У командному рядку Windows можна скористатися такою командою: for /R %G in (*.txt) do dos2unix "%G" Користувачі PowerShell можуть скористатися такою командою у Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} =head1 ЛОКАЛІЗАЦІЯ =over 4 =item B Основна мова визначається за допомогою змінної середовища LANG. Значення змінної LANG складається з декількох частин. Перша частина записується малими літерами і визначає код мови. Друга частина є необов’язковою, визначає код країни і записується прописними літерами, відокремлюється від першої частини символом підкреслювання. Передбачено також необов’язкову третю частину: кодування. Ця частина відокремлюється від другої частини крапкою. Ось декілька прикладів для командних оболонок стандартного типу POSIX: export LANG=uk українська export LANG=uk_UA українська, Україна export LANG=ru_UA російська, Україна export LANG=es_ES іспанська, Іспанія export LANG=es_MX іспанська, Мексика export LANG=en_US.iso88591 англійська, США, кодування Latin-1 export LANG=en_GB.UTF-8 англійська, Великобританія, кодування UTF-8 Повний список мов та кодів країн наведено у підручнику з gettext: L У системах Unix для отримання даних щодо локалі можна скористатися командою locale(1). =item B За допомогою змінної середовища LANGUAGE ви можете вказати список пріоритеності мов. Записи у списку слід відокремлювати двокрапками. Програма dos2unix надає перевагу LANGUAGE над LANG. Наприклад, перша голландська, далі німецька: C. Спочатку вам слід увімкнути локалізацію, встановивши для змінної LANG (або LC_ALL) значення, відмінне від «C». Далі ви зможете використовувати список пріоритетності мов за допомогою змінної LANGUAGE. Додаткові відомості можна знайти у підручнику з gettext: L Якщо вами буде вибрано мову, перекладу якою немає, буде показано стандартні повідомлення англійською мовою. =item B Змінну LOCALEDIR, встановлену під час збирання програми, можна змінити за допомогою змінної середовища DOS2UNIX_LOCALEDIR. LOCALEDIR використовується для пошуку файлів перекладів. Типовим значенням у системах GNU є C. Переглянути поточне значення змінної LOCALEDIR можна переглянути за допомогою параметра B<--version>. Приклад (командна оболонка POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 ПОВЕРНУТЕ ЗНАЧЕННЯ Якщо завдання вдасться успішно виконати, програма поверне нульовий код виходу. Якщо станеться системна помилка, буде повернуто код цієї помилки. Якщо станеться якась інша помилка, буде повернуто код 1. У режимі без повідомлень повернутим значенням завжди буде нуль, якщо вказано правильні параметри командного рядка. =head1 СТАНДАРТИ L L L L =head1 АВТОРИ Benjamin Lin - , Bernd Johannes Wuebben (режим mac2unix) - , Christian Wurll (додатковий новий рядок) - , Erwin Waterlander - (супровідник) Сторінка проекту: L Сторінка на SourceForge: L =head1 ТАКОЖ ПЕРЕГЛЯНЬТЕ file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/uk/man1/dos2unix.txt0000644000175500010010000014253012721132571017117 0ustar waterlanGeenНАЗВА dos2unix - програма для перетворення даних у текстовому форматі DOS/Mac у формат Unix, і навпаки КОРОТКИЙ ОПИС dos2unix [параметри] [ФАЙЛ ...] [-n ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...] unix2dos [параметри] [ФАЙЛ ...] [-n ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...] ОПИС До складу пакунка Dos2unix включено програми "dos2unix" та "unix2dos", призначені для перетворення звичайних текстових даних у форматі DOS або Mac на дані у форматі Unix, і навпаки. У текстових файлах DOS/Windows розрив рядка або перехід на новий рядок здійснюється за допомогою комбінації двох символів: повернення каретки (CR) і переведення рядка (LF). У текстових файлах Unix за перехід на новий рядок відповідає один символ: переведення рядка (LF). У текстових файлах Mac, до Mac OS X, за розрив рядка відповідав один символ: повернення каретки (CR). У сучасних версіях Mac OS використовується типовий для Unix розрив рядка (LF). Окрім символів розриву рядка, програма Dos2unix здатна виконувати перетворення кодування файлів. Можна перетворити дані у декількох кодуваннях DOS на файли у кодуванні Latin-1 Unix. Також можна перетворити дані у файлах Windows Unicode (UTF-16) на дані у кодуванні Unix Unicode (UTF-8). Під час перетворення програма пропускатиме двійкові файли, якщо ви не накажете їй виконати перетворення таких файлів безпосередньо. Програма автоматично пропускатиме файли, які не є звичайними файлами, зокрема каталоги та канали FIFO. Типово, програма не вноситиме змін до символічних посилань та об’єктів посилань. Якщо потрібно, програма може замінити символічні посилання або записати перетворені дані до файла-призначення символічного посилання. У Windows запису до об’єкта символічного посилання не передбачено. Програму dos2unix було створено за зразком програми dos2unix для SunOS/Solaris. Втім, існує одна важлива відмінність від оригінальної версії для SunOS/Solaris. Ця версія типово виконує заміну файлів під час перетворення (старий режим обробки файлів), а у оригінальній версії для SunOS/Solaris передбачено підтримку лише парного перетворення (новий режим обробки файлів). Див. також параметри "-o" та "-n". Ще однією відмінністю є те, що у версії для SunOS/Solaris типово використовувався режим перетворення *iso*, а у цій версії типовим є режим перетворення *ascii*. ПАРАМЕТРИ -- Вважати усі наступні параметри назвами файлів. Цим параметром слід користуватися, якщо вам потрібно виконати перетворення файлів, чиї назви містять дефіси. Наприклад, щоб виконати перетворення файла «-foo», скористайтеся такою командою: dos2unix -- -foo Або у новому режимі файлів: dos2unix -n -- -foo out.txt -ascii Виконати лише перетворення символів розриву рядків. Типовий режим перетворення. -iso Виконати перетворення з кодування DOS на кодування ISO-8859-1. Див. розділ щодо режимів перетворення. -1252 Використати кодову таблицю 1252 Windows (західноєвропейські мови). -437 Використовувати кодову сторінку DOS 437 (США). Це типова кодова сторінка для перетворення ISO. -850 Використовувати кодову сторінку DOS 850 (західноєвропейські мови). -860 Використовувати сторінку DOS 860 (португальська). -863 Використовувати сторінку DOS 863 (канадська французька). -865 Використовувати сторінку DOS 865 (скандинавські мови). -7 Перетворювати 8-бітові символи на 7-бітові. -b, --keep-bom Зберегти позначку порядку байтів (BOM). Якщо у файлі вхідних даних є BOM, записати BOM до файла результатів. Це типова поведінка під час перетворення у формат із символами розриву рядків DOS. Див. також параметр "-r". -c, --convmode РЕЖИМ Встановити режим перетворення. Значенням аргументу РЕЖИМ може бути один з таких рядків: *ascii*, *7bit*, *iso*, *mac*. Типовим є режим ascii. -D, --display-enc КОДУВАННЯ Встановити кодування показаного тексту. Можливі варіанти значень параметра КОДУВАННЯ: *ansi*, *unicode*, *unicodebom*, *utf8*, *utf8bom*, типовим є ansi. Цей параметр доступний лише у dos2unix для Windows з підтримкою назв файлів у Unicode. Цей параметр не впливає на справжнє читання та запис назв файлів, лише на те, як буде показано ці назви. Існує декілька способів показу тексту у консолі Windows, заснованих на кодуванні тексту. Усі ці способи мають свої переваги і недоліки. ansi Типовим способом для dos2unix є кодування тексту у форматі ANSI. Перевагою є зворотна сумісність. Цей варіант працює з растровими шрифтами та шрифтами TrueType. У деяких регіонах, ймовірно, вам доведеться змінити активну кодову сторінку DOS OEM на системну кодову сторінку ANSI Windows за допомогою команди "chcp", оскільки dos2unix використовує системну кодову сторінку Windows. Недоліком ansi є те, що назви файлів із символами, яких немає у типовому системному кодуванні, буде показано неправильно. Замість цих символів ви побачите знак питання або не той символ. Якщо у вашій системі немає файлів із назвами, які містять нетипові символи, можна скористатися цим варіантом. unicode, unicodebom Перевагою кодування unicode (назва у Windows кодування UTF-16) є те, що зазвичай текст буде показано правильно. Змінювати активну кодову сторінку не потрібно. Ймовірно, вам потрібно встановити шрифт консолі TrueType для належного показу нестандартних символів. Якщо символ не передбачено у шрифті TrueType, зазвичай ви побачите невеличкий квадратик замість символу, іноді із знаком питання у ньому. Якщо ви користуєтеся консоллю ConEmu, весь текст буде показано належним чином, оскільки ConEmu автоматично вибирає належний шрифт. Недоліком unicode є те, що це кодування несумісне з ASCII. Обробка виведених даних є непростою, якщо ви передаватимете ці дані до іншої програми або файла. Якщо використовується метод "unicodebom", текст у кодуванні Unicode буде оброблено з урахуванням BOM (позначки порядку байтів). BOM потрібна для правильного переспрямовування або тунелювання даних у PowerShell. utf8, utf8bom Перевагою utf8 є те, що це кодування сумісне з ASCII. Вам слід встановити шрифт консолі TrueType. Якщо використано шрифт TrueType, текст буде показано подібно до того, як його показано, якщо визначено кодування "unicode". Недоліком є те, що якщо ви скористаєтеся типовим растровим шрифтом, усі символи поза ASCII буде показано неправильно. Не лише назви файлів у unicode, а й перекладені повідомлення стануть непридатними до читання. У Windows, налаштованому на роботі у східно-азійському регіоні, ви можете помітити значне блимання під час показу повідомлень. У консолі ConEmu добре працює спосіб кодування utf8. Якщо використовується метод "utf8bom", текст у кодуванні UTF-8 буде оброблено з урахуванням BOM (позначки порядку байтів). BOM потрібна для правильного переспрямовування або тунелювання даних у PowerShell. Типове кодування можна змінити за допомогою змінної середовища DOS2UNIX_DISPLAY_ENC встановленням для неї значення "unicode", "unicodebom", "utf8" або "utf8bom". -f, --force Примусове перетворення двійкових файлів. -gb, --gb18030 У Windows файли в UTF-16 типово перетворюються на файли в UTF-8, незалежно від встановленої локалі. За допомогою цього параметра ви можете наказати програмі перетворювати файли в UTF-16 на файли у GB18030. Цим параметром можна скористатися лише у Windows. Див. також розділ, присвячений GB18030. -h, --help Показати довідкові дані і завершити роботу. -i[ПРАПОРЦІ], --info[=ПРАПОРЦІ] ФАЙЛ ... Вивести дані щодо файла. Не виконувати перетворення. Буде виведено такі дані, у вказаному порядку: кількість розривів рядків у форматі DOS, кількість розривів рядків у форматі Unix, кількість розривів рядків у форматі Mac, позначка порядку байтів, текстовим чи бінарним є файл та назву файла. Приклад результатів: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe Зауважте, що іноді бінарні файли помилково розпізнаються як текстові. Див. також параметр "-s". Крім того, можна вказати додаткові прапорці для внесення змін у виведені дані. Можна використовувати один або декілька таких прапорців. d Вивести кількість символів розривів рядка DOS. u Вивести кількість символів розривів рядка Unix. m Вивести кількість символів розривів рядка Mac. b Вивести позначку порядку байтів. t Вивести дані щодо того, є файл текстовим чи бінарним. c Вивести дані лише тих файлів, які було б перетворено. Із прапорцем "c" dos2unix виведе лише назви файлів, у яких містяться розриви рядків DOS. unix2dos виведе лише назви файлів, у яких містяться розриви рядків Unix. h Вивести заголовок. p Показувати назви файлів без шляхів. Приклади: Вивести дані щодо усіх файлів *.txt: dos2unix -i *.txt Вивести кількість розривів рядків у форматі DOS і розривів рядків у форматі Unix: dos2unix -idu *.txt Вивести лише позначку порядку байтів: dos2unix --info=b *.txt Вивести список файлів, у яких є символи розриву рядків DOS: dos2unix -ic *.txt Вивести список файлів, у яких використано символи розриву рядків Unix: unix2dos -ic *.txt Перетворити лише файли із розривами рядків DOS і не чіпати інших файлів: dos2unix -ic *.txt | xargs dos2unix Знайти текстові файли і розривами рядків DOS: find -name '*.txt' | xargs dos2unix -ic -k, --keepdate Зберегти часову позначку файла вхідних даних у файлі результатів перетворення. -L, --license Вивести умови ліцензування програми. -l, --newline Вставити додатковий символ розриву рядка. dos2unix: перетворення на два символи розриву рядків Unix відбуватиметься лише для комбінацій розриву рядків DOS. У режимі Mac виконуватиметься перетворення на два розриви рядків Unix лише символів розриву рядків Mac. unix2dos: перетворення на дві комбінації розриву рядків DOS відбуватиметься лише для символів розриву рядків DOS. У режимі Mac виконуватиметься перетворення на два розриви рядків Mac лише символів розриву рядків Unix. -m, --add-bom Записати до файла результатів позначку порядку байтів (BOM). Типово буде записано позначку порядку байтів UTF-8. Якщо дані початкового файла закодовано у UTF-16 і використано параметр "-u", буде дописано позначку порядку байтів UTF-16. Не використовуйте цей параметр для кодувань результатів, відмінних від UTF-8, UTF-16 або GB18030. Див. також розділ щодо UNICODE. -n, --newfile ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ... Новий режим обробки файлів. Перетворити дані з файла ВХІДНИЙ_ФАЙЛ і записати результати до файла ВИХІДНИЙ_ФАЙЛ. Назви файлів слід вказувати парами, *не слід* використовувати шаблони заміни, інакше вміст файлів *буде втрачено*. Власником перетвореного файла буде призначено користувача, яким було розпочато перетворення у режимі нового файла (парному режимі). Права доступу на читання або запис нового файла буде визначено на основі прав доступу до початкового файла мінус umask(1) для користувача, яким було розпочато перетворення. -o, --oldfile ФАЙЛ ... Застарілий режим обробки. Виконати перетворення файла ФАЙЛ і перезаписати його вміст. Типово, програма працює у цьому режимі. Можна використовувати шаблони заміни. У застарілому режимі (режимі заміщення) перетворений файл належатиме тому самому власнику і групі і матиме ті самі права доступу на читання або запис, що і початковий файл. Крім того, якщо перетворення файла виконується іншим користувачем, який має права доступу на запис до файла (наприклад користувачем root), перетворення буде перервано, якщо зберегти початкові значення не вдасться. Зміна власника може означати неможливість читання файла для його початкового власника. Зміна групи може призвести до проблем із безпекою, оскільки файл може стати доступним для читання користувачам, які не повинні мати такі права доступу. Можливість збереження прав власності та прав доступу до файла передбачено лише у Unix. -q, --quiet Режим без виведення повідомлень. Програма не виводитиме жодних попереджень або повідомлень про помилки. Повернутим значенням завжди буде нуль, якщо вказано правильні параметри командного рядка. -r, --remove-bom Вилучити позначку порядку байтів (BOM). Не записувати BOM до файла результатів. Це типова поведінка під час перетворення файлів з форматом розриву рядків Unix. Див. також параметр "-b". -s, --safe Пропускати двійкові файли (типово). Пропускання бінарних файлів реалізовано для того, щоб уникнути випадкових помилок. Майте на увазі, що визначення бінарних файлів не є 100% точним. Програма просто шукає у файлах бінарні символи, які типово не трапляються у текстових файлах. Може так статися, що у бінарному файлі містяться лише звичайні текстові символи. Такий бінарний файл буде помилково сприйнято програмою як текстовий. -u, --keep-utf16 Зберегти початкове кодування UTF-16. Файл результатів буде записано у тому самому кодуванні UTF-16, із прямим або зворотним порядком байтів, що і початковий файл. Таким чином можна запобігти перетворенню даних у кодування UTF-8. До файла буде записано відповідну позначку порядку байтів UTF-16. Вимкнути цей параметр можна за допомогою параметра "-ascii". -ul, --assume-utf16le Припускати, що кодуванням вхідних файлів є UTF-16LE. Якщо у початковому файлі є позначка порядку байтів (BOM), її буде використано у файлі-результаті, незалежно від використання цього параметра. Якщо вами було зроблено помилкове припущення щодо формату файла (файл вхідних даних насправді не є файлом у форматі UTF-16LE), і дані вдасться успішно перетворити, ви отримаєте файл у кодуванні UTF-8 з помилковим вмістом. Скасувати таке помилкове перетворення можна за допомогою зворотного перетворення iconv(1) з даних у форматі UTF-8 на дані у форматі UTF-16LE. Таким чином ви повернетеся до початкового кодування даних у файлі. Припущення щодо форматування UTF-16LE працює як визначення *режиму перетворення*. Перемиканням на типовий режим *ascii* можна вимкнути припущення щодо форматування UTF-16LE. -ub, --assume-utf16be Припускати, що вхідним форматом є UTF-16BE. Цей параметр працює у спосіб, тотожний до параметра "-ul". -v, --verbose Виводити докладні повідомлення. Буде показано додаткові дані щодо позначок порядку байтів та кількості перетворених символів розриву рядків. -F, --follow-symlink Переходити за символічними посиланням і перетворювати файли, на які вони вказують. -R, --replace-symlink Замінити символічні посилання перетвореними файлами (початкові файли, на які вони вказують, змінено не буде). -S, --skip-symlink Не змінювати символічні посилання та файли, на які вони посилаються (типово). -V, --version Вивести дані щодо версії і завершити роботу. РЕЖИМ MAC У звичайному режимі розриви рядків DOS перетворюються на розриви рядків Unix, і навпаки. Розриви рядків Mac перетворенню не підлягають. У режимі Mac розриви рядків Mac перетворюються на розриви рядків Unix, і навпаки. Розриви рядків DOS перетворенню не підлягають. Щоб запустити програму у режимі перетворення Mac, скористайтеся параметром командного рядка "-c mac" або програмами "mac2unix" та "unix2mac". РЕЖИМИ ПЕРЕТВОРЕННЯ ascii У режимі "ascii" виконуватиметься лише перетворення символів розриву рядків. Цей режим є типовим режимом перетворення. Хоча цей режим і називається режимом ASCII (стандарту 7-бітового кодування), насправді кодування символів у ньому є 8-бітовим. Завжди користуйтеся цим режимом для перетворення файлів у кодуванні UTF-8 (Unicode). 7bit У цьому режимі усі 8-бітові символи, які не є частиною ASCII, (з номерами від 128 до 255) буде перетворено на відповідні 7-бітові символи. iso Перетворення символів буде виконано з кодування (кодової сторінки) DOS до кодування ISO-8859-1 (Latin-1) у Unix. Символи DOS, які не мають еквівалентів у ISO-8859-1 і перетворення яких неможливе, буде перетворено на символ крапки. Те саме стосується символів ISO-8859-1, які не мають еквівалентів у DOS. Якщо буде використано лише параметр "-iso", програма dos2unix спробує визначити активне кодування. Якщо це виявиться неможливим, dos2unix використає типове кодування CP437, яке здебільшого використовується у США. Щоб примусово визначити кодування, скористайтеся параметром -437 (США), -850 (західноєвропейські мови), -860 (португальська), -863 (канадська французька) або -865 (скандинавські мови). Використати кодування Windows CP1252 (західноєвропейські мови) можна за допомогою параметра -1252. Для інших кодувань використовуйте поєднання dos2unix з iconv(1). Програма iconv здатна виконувати перетворення даних у доволі широкому спектрі кодувань символів. Ніколи не користуйтеся перетворенням ISO для текстових файлів у форматі Unicode. Використання подібного перетворення призведе до ушкодження вмісту файлів у кодуванні UTF-8. Декілька прикладів: Перетворити дані у типовому кодуванні DOS на дані у кодуванні Latin-1 Unix: dos2unix -iso -n in.txt out.txt Перетворити дані у кодуванні DOS CP850 на дані у кодуванні Latin-1 Unix: dos2unix -850 -n in.txt out.txt Перетворити дані у кодуванні CP1252 Windows на дані у кодуванні Latin-1 Unix: dos2unix -1252 -n in.txt out.txt Перетворити дані у кодуванні CP252 Windows на дані у кодуванні UTF-8 Unix (Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt Перетворити дані у кодуванні Latin-1 Unix на дані у типовому кодуванні DOS: unix2dos -iso -n in.txt out.txt Перетворити дані у кодуванні Latin-1 Unix на дані у кодуванні DOS CP850: unix2dos -850 -n in.txt out.txt Перетворити дані у кодуванні Latin-1 Unix на дані у кодуванні Windows CP1252: unix2dos -1252 -n in.txt out.txt Перетворити дані у кодуванні UTF-8 Unix (Unicode) на дані у кодуванні Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt Див. також та . UNICODE Кодування Існує декілька різних кодувань Unicode. У Unix та Linux у файлах Unicode здебільшого використовується кодування UTF-8. У Windows для текстових файлів Unicode може бути використано кодування UTF-8, UTF-16 або UTF-16 зі зворотним порядком байтів. Втім, здебільшого, використовується формат UTF-16. Перетворення У текстових файлах Unicode, як і у звичайних текстових файлах, може бути використано розриви рядків DOS, Unix або Mac. Усі версії dos2unix та unix2dos здатні виконувати перетворення у кодуванні UTF-8, оскільки UTF-8 було розроблено так, що зворотну сумісність з ASCII збережено. Програми dos2unix та unix2dos, зібрані з підтримкою Unicode UTF-16, можуть читати текстові файли у кодуванні UTF-16 з прямим та зворотним порядком байтів. Щоб дізнатися про те, чи було dos2unix зібрано з підтримкою UTF-16, віддайте команду "dos2unix -V". У Unix/Linux файли у кодуванні UTF-16 перетворюються на файли у кодуванні локалі. Для визначення поточного кодування символів локалі скористайтеся командою locale(1). Якщо перетворення виявиться неможливим, програма повідомить про помилку перетворення і пропустить відповідний файл. У Windows файли UTF-16 типово буде перетворено на файли UTF-8. Обидва типи систем, Windows та Unix/Linux, мають непогані можливості з підтримки файлів у форматуванні UTF-8. Кодування UTF-16 та UTF-8 є повністю сумісними. Під час перетворення не буде втрачено жодної інформації. Якщо під час перетворення даних у кодуванні UTF-16 на дані у кодуванні UTF-8 трапиться помилка, наприклад, якщо у вхідному файлі UTF-16 міститиметься якась помилка, файл буде пропущено. Якщо використано параметр "-u", файл результатів буде записано у тому самому кодуванні UTF-16, що і початковий файл. Використання параметра Option "-u" запобігає перетворенню даних у кодування UTF-8. У dos2unix та unix2dos не передбачено параметра для перетворення даних у кодуванні UTF-8 на дані у кодуванні UTF-16. Режим перетворення ISO та 7-бітовий режим не працюють для файлів UTF-16. Позначка порядку байтів У Windows до текстових файлів у кодуванні Unicode типово дописується позначка порядку байтів (BOM), оскільки багато програм Windows (зокрема Notepad) додають таку позначку автоматично. Див. також . У Unix файли у кодуванні Unicode типово не містять позначки порядку байтів. Вважається, що кодуванням текстових файлів є те кодування, яке визначається поточною локаллю. Програма dos2unix може визначити, чи є кодуванням файла UTF-16, лише якщо у файлі міститься позначка порядку байтів. Якщо у файлі, де використано кодування UTF-16, немає такої позначки, dos2unix вважатиме такий файл двійковим (бінарним). Для перетворення файлів UTF-16 без позначки порядку байтів скористайтеся параметром "-ul" або "-ub". Типово dos2unix не записує до файлів результатів перетворення позначки порядку байтів (BOM). Якщо використано параметр "-b", dos2unix запише до файла результатів BOM, якщо BOM була у файлі початкових даних. Типово unix2dos записує позначку порядку байтів (BOM) до файла результатів, якщо BOM є у початковому файлі. Скористайтеся параметром "-r", щоб вилучити BOM. Dos2unix та unix2dos завжди записують до файла результатів позначку порядку байтів (BOM), якщо використано параметр "-m". Назви файлів у Unicode у Windows У dos2unix передбачено підтримку читання і запису назв файлів Unicode у командному рядку Windows. Це означає, що dos2unix може відкривати файли, у назвах яких є символи, які не є частиною типової системної кодової сторінки ANSI. Щоб визначити, чи зібрано dos2unix для Windows з підтримкою назв файлів у кодуванні Unicode, скористайтеся командою "dos2unix -V". Із показом назв файлів у кодуванні Unicode у консолі Windows пов’язано декілька проблем. Див. параметр "-D", "--display-enc". Назви файлів може бути некоректно показано у консолі, але запис цих назв відбуватиметься належним чином. Приклади для Unicode Перетворити дані з Windows UTF-16 (з позначкою порядку байтів (BOM)) у формат Unix UTF-8: dos2unix -n in.txt out.txt Перетворити дані у форматі Windows UTF-16LE (без BOM) на дані у форматі UTF-8 Unix: dos2unix -ul -n in.txt out.txt Перетворити дані у кодуванні UTF-8 Unix на дані у кодуванні Windows UTF-8 без BOM: unix2dos -m -n in.txt out.txt Перетворити дані у кодуванні UTF-8 Unix на дані у кодуванні Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt GB18030 GB18030 є китайським урядовим стандартом. Підтримка обов’язкової підмножини стандарту GB18030 є неодмінною вимогою до будь-яких програмних продуктів, які продаються у Китаї. Див. також . Кодування GB18030 є повністю сумісним із Unicode. Його можна розглядати як формат перетворення unicode. Подібно до UTF-8, GB18030 є сумісним із ASCII. GB18030 також є сумісним із кодовою сторінкою Windows 936, яку ще називають GBK. У Unix/Linux файли UTF-16 буде перетворено до кодування GB18030, якщо кодуванням локалі є GB18030. Зауважте, що це спрацює, лише якщо підтримку локалі передбачено у системі. Щоб отримати список підтримуваних локалей, скористайтеся командою "locale -a". У Windows для перетворення файлів UTF-16 на файли GB18030 слід вказати параметр "-gb". У файлах у кодуванні GB18030 може міститися позначка порядку байтів, так само, як у файлах у кодуванні Unicode. ПРИКЛАДИ Прочитати вхідні дані зі стандартного джерела (stdin) і записати результат до стандартного виведення (stdout): dos2unix < a.txt cat a.txt | dos2unix Перетворити дані у a.txt і замістити цей файл. Перетворити дані у b.txt і замістити цей файл: dos2unix a.txt b.txt dos2unix -o a.txt b.txt Перетворити дані у a.txt і замістити файл у режимі перетворення ascii: dos2unix a.txt Перетворити дані у a.txt і замістити файл у режимі перетворення ascii. Перетворити дані у b.txt і замістити цей файл у режимі 7-бітового перетворення: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt Перетворити файл a.txt з формату Mac на формат Unix: dos2unix -c mac a.txt mac2unix a.txt Перетворити файл a.txt з формату Unix на формат Mac: unix2dos -c mac a.txt unix2mac a.txt Перетворити дані у a.txt, замістити цей файл і зберегти часову позначку початкового файла: dos2unix -k a.txt dos2unix -k -o a.txt Перетворити дані у файлі a.txt і записати результати до файла e.txt: dos2unix -n a.txt e.txt Перетворити дані у файлі a.txt і записати результати до файла e.txt. Скопіювати часову позначку файла a.txt для файла e.txt: dos2unix -k -n a.txt e.txt Перетворити дані у a.txt і замістити цей файл. Перетворити дані у b.txt і записати результат до e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt Перетворити дані у c.txt і записати результати до e.txt. Перетворити дані у a.txt і замістити ними цей файл. Перетворити дані у b.txt і замістити ними цей файл. Перетворити дані у d.txt і записати результати до f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt РЕКУРСИВНЕ ПЕРЕТВОРЕННЯ Для рекурсивного перетворення текстових файлів у ієрархії каталогів слід використовувати dos2unix у поєднанні з програмами find(1) та xargs(1). Наприклад, щоб виконати перетворення усіх файлів .txt у структурі підкаталогів поточного каталогу, віддайте таку команду: find . -name '*.txt' |xargs dos2unix У командному рядку Windows можна скористатися такою командою: for /R %G in (*.txt) do dos2unix "%G" Користувачі PowerShell можуть скористатися такою командою у Windows PowerShell: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} ЛОКАЛІЗАЦІЯ LANG Основна мова визначається за допомогою змінної середовища LANG. Значення змінної LANG складається з декількох частин. Перша частина записується малими літерами і визначає код мови. Друга частина є необов’язковою, визначає код країни і записується прописними літерами, відокремлюється від першої частини символом підкреслювання. Передбачено також необов’язкову третю частину: кодування. Ця частина відокремлюється від другої частини крапкою. Ось декілька прикладів для командних оболонок стандартного типу POSIX: export LANG=uk українська export LANG=uk_UA українська, Україна export LANG=ru_UA російська, Україна export LANG=es_ES іспанська, Іспанія export LANG=es_MX іспанська, Мексика export LANG=en_US.iso88591 англійська, США, кодування Latin-1 export LANG=en_GB.UTF-8 англійська, Великобританія, кодування UTF-8 Повний список мов та кодів країн наведено у підручнику з gettext: У системах Unix для отримання даних щодо локалі можна скористатися командою locale(1). LANGUAGE За допомогою змінної середовища LANGUAGE ви можете вказати список пріоритеності мов. Записи у списку слід відокремлювати двокрапками. Програма dos2unix надає перевагу LANGUAGE над LANG. Наприклад, перша голландська, далі німецька: "LANGUAGE=nl:de". Спочатку вам слід увімкнути локалізацію, встановивши для змінної LANG (або LC_ALL) значення, відмінне від «C». Далі ви зможете використовувати список пріоритетності мов за допомогою змінної LANGUAGE. Додаткові відомості можна знайти у підручнику з gettext: Якщо вами буде вибрано мову, перекладу якою немає, буде показано стандартні повідомлення англійською мовою. DOS2UNIX_LOCALEDIR Змінну LOCALEDIR, встановлену під час збирання програми, можна змінити за допомогою змінної середовища DOS2UNIX_LOCALEDIR. LOCALEDIR використовується для пошуку файлів перекладів. Типовим значенням у системах GNU є "/usr/local/share/locale". Переглянути поточне значення змінної LOCALEDIR можна переглянути за допомогою параметра --version. Приклад (командна оболонка POSIX): export DOS2UNIX_LOCALEDIR=$HOME/share/locale ПОВЕРНУТЕ ЗНАЧЕННЯ Якщо завдання вдасться успішно виконати, програма поверне нульовий код виходу. Якщо станеться системна помилка, буде повернуто код цієї помилки. Якщо станеться якась інша помилка, буде повернуто код 1. У режимі без повідомлень повернутим значенням завжди буде нуль, якщо вказано правильні параметри командного рядка. СТАНДАРТИ АВТОРИ Benjamin Lin - , Bernd Johannes Wuebben (режим mac2unix) - , Christian Wurll (додатковий новий рядок) - , Erwin Waterlander - (супровідник) Сторінка проекту: Сторінка на SourceForge: ТАКОЖ ПЕРЕГЛЯНЬТЕ file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/zh_CN/0000755000175500010010000000000012721132553014324 5ustar waterlanGeendos2unix-7.3.4/man/zh_CN/man1/0000755000175500010010000000000012721132613015155 5ustar waterlanGeendos2unix-7.3.4/man/zh_CN/man1/dos2unix.10000644000175500010010000006714112721132555017030 0ustar waterlanGeen.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dos2unix 1" .TH dos2unix 1 "2016-05-24" "dos2unix" "2016-05-24" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "名称" .IX Header "名称" dos2unix \- DOS/Mac \- Unix文件格式转换器 .SH "概要" .IX Header "概要" .Vb 2 \& dos2unix [选项] [文件 …] [\-n 输入文件 输出文件 ...] \& unix2dos [选项] [文件 …] [\-n 输入文件 输出文件 ...] .Ve .SH "说明" .IX Header "说明" Dos2unix软件包包括工具\f(CW\*(C`dos2unix\*(C'\fR 和 \f(CW\*(C`unix2dos\*(C'\fR,用于将纯文本文件在DOS或Mac格式与Unix格式之间相互转换。 .PP DOS/Windows的文本文件中,断行符是由两个字符共同表示的:回车符(CR)和换行符(LF)。Unix的文本文件中,换行符则由单个换行符(LF)表示。而Mac的文本文件则由单个回车符(CR,用于Mac \&\s-1OS\s0 X之前的系统)或单个换行符(LF,用于当下的新Mac OS)表示。 .PP 除了断行符,Dos2unix还可以转换文件编码。一些DOS编码页可以被转换为Unix Latin\-1,Windows Unicode(UTF\-16)文件也可以被转换为Unix Unicode(UTF\-8)文件。 .PP 二进制文件则会被自动跳过,除非指定了强制转换选项。 .PP 特殊文件,如目录和队列,会被自动跳过。 .PP 符号链接和其所指向的目标默认不会被转换。可以用选项来指定替换符号链接,或者将输出写入到链接目标。Windows下不支持写入到符号链接的目标。 .PP Dos2unix由SunOS/Solaris下的版本改写而成。这两个版本间有一个重大差异:本版本默认进行原位转换(旧文件模式),而原来SunOS/Solaris下的版本只支持配对转换(新文件模式),参见选项 \&\f(CW\*(C`\-o\*(C'\fR 和 \f(CW\*(C`\-n\*(C'\fR。还有一个区别是SunOS/Solaris下的版本默认使用 \fIiso\fR 模式,而本版本默认使用 \fIascii\fR 模式。 .SH "选项" .IX Header "选项" .IP "\fB\-\-\fR" 4 .IX Item "--" 将后面所有的选项当作文件名。如果你希望转换一个文件名以破折号开头的文件,可以使用这个选项。例如,要转换一个名为“\-foo”的文件,你可以用这个命令: .Sp .Vb 1 \& dos2unix \-\- \-foo .Ve .Sp 或者在新文件模式中: .Sp .Vb 1 \& dos2unix \-n \-\- \-foo out.txt .Ve .IP "\fB\-ascii\fR" 4 .IX Item "-ascii" 只转换断行符。这是默认的转换模式。 .IP "\fB\-iso\fR" 4 .IX Item "-iso" 在DOS和ISO\-8859\-1字符集之间转换。参见 \s-1CONVERSION MODES\s0 一节。 .IP "\fB\-1252\fR" 4 .IX Item "-1252" 使用Windows 1252 编码页(西欧)。 .IP "\fB\-437\fR" 4 .IX Item "-437" 使用DOS 437 编码页(美国)。这是ISO转换时的默认编码页。 .IP "\fB\-850\fR" 4 .IX Item "-850" 使用DOS 850 编码页(西欧)。 .IP "\fB\-860\fR" 4 .IX Item "-860" 使用DOS 860 编码页(葡萄牙)。 .IP "\fB\-863\fR" 4 .IX Item "-863" 使用DOS 863 编码页(加拿大法语)。 .IP "\fB\-865\fR" 4 .IX Item "-865" .Vb 1 \& 使用DOS 865 编码页(北欧)。 .Ve .IP "\fB\-7\fR" 4 .IX Item "-7" 将8位字符转换到7位空间。 .IP "\fB\-b, \-\-keep\-bom\fR" 4 .IX Item "-b, --keep-bom" 保留字节序标记(BOM)。当输入文件含有BOM头时,也向输出文件写入BOM。这是转换到DOS断行符时的默认行为。参见选项 \f(CW\*(C`\-r\*(C'\fR。 .IP "\fB\-c, \-\-convmode 转换模式\fR" 4 .IX Item "-c, --convmode 转换模式" 改变转换模式。转换模式可以为:\fIascii\fR、\fI7bit\fR、\fIiso\fR或\fImac\fR,默认为ascii。 .IP "\fB\-D, \-\-display\-enc \s-1ENCODAGE\s0\fR" 4 .IX Item "-D, --display-enc ENCODAGE" 设置显示文本的编码。编码可以为:\fIansi\fR、\fIunicode\fR、\fIunicodebom\fR、\fIutf8\fR、\fIutf8bom\fR,默认为 ansi。 .Sp 这一选项只对支持Unicode文件名的Windows版dos2unix有效。它对文件名的读写无效,只影响它们的显示结果。 .Sp 在Windows控制台中,有几种可以根据文本编码来显示文本的方法。它们各有利弊。 .RS 4 .IP "\fBansi\fR" 4 .IX Item "ansi" dos2unix默认使用ANSI编码文本。优点是它能提供向后兼容性,并能用于raster和TrueType字体。在一些地方,你可能需要使用 \&\f(CW\*(C`chcp\*(C'\fR 命令将活动DOS OEM编码页设置为Windows系统ANSI编码页,因为dos2unix使用Windows系统编码页。 .Sp ansi的缺点是含有非系统默认编码页中字符的国际化文件名将无法被正确显示。你会看到一些问号或其他错误的字符。如果你不需要处理外文文件名,这一方法是不错的选择。 .IP "\fBunicode,unicodebom\fR" 4 .IX Item "unicode,unicodebom" Unicode编码(Windows中对UTF\-16的称呼)的优点是文本可以被正确显示,也无需改变活动编码页。你可能需要设置终端字体为TrueType以便正确显示国际化字符。如果TrueType字体中不包含某个字符,你会看到一个小方块,有时方块中还会有一个问号。 .Sp 当你使用ConEmu终端时,所以的文本将会被正确显示,因为ConEmu会自动选择合适的字体。 .Sp Unicode的缺点在于它与ASCII不兼容。当你将输出重定向到其他程序或文件时,它可能不那么容易控制 .Sp 当使用 \f(CW\*(C`unicodebom\*(C'\fR 方法时,将会在Unicode文本前添加一个BOM(字节序标记)。在PowerShell中,需要根据BOM来进行正确的重定向或管道输出。 .IP "\fButf8,utf8bom\fR" 4 .IX Item "utf8,utf8bom" utf8的优点在于它与ASCII兼容。你需要设置终端的字体为TrueType字体。使用TrueType字体可以使得文本得以正确显示,就像使用 \&\f(CW\*(C`unicode\*(C'\fR 编码时那样。 .Sp 缺点是当你使用默认的raster字体时,所有的非ASCII字符将无法被正确显示。不仅是unicode文件名,连翻译的消息也无法被读取。在配置为东亚地区的Windows中,当终端中显示这些消息时你可能会看到闪烁现象。 .Sp 在ConEmu终端中,utf编码方式可以正常工作。 .Sp 当使用 \f(CW\*(C`utf8bom\*(C'\fR 方法时,将会在Unicode文本前添加一个BOM(字节序标记)。在PowerShell中,需要根据BOM来进行正确的重定向或管道输出。 .RE .RS 4 .Sp 默认的编码方式可以通过设置 \s-1DOS2UNIX_DISPLAY_ENC\s0 环境变量为 \f(CW\*(C`unicode\*(C'\fR 、\f(CW\*(C`unicodebom\*(C'\fR、\f(CW\*(C`utf8\*(C'\fR 或 \&\f(CW\*(C`utf8bom\*(C'\fR 来改变。 .RE .IP "\fB\-f, \-\-force\fR" 4 .IX Item "-f, --force" 强制转换二进制文件。 .IP "\fB\-gb, \-\-gb18030\fR" 4 .IX Item "-gb, --gb18030" 在Windows中,UTF\-16默认被转换为UTF\-8格式,无论区域设置为何。请使用这一选项将UTF\-16文件转换为GB18030格式。此选项只在Windows下有效。参加 \&\s-1GB18030\s0 一节。 .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" 显示帮助,然后退出。 .IP "\fB\-i[标志], \-\-info[=标志] 文件 …\fR" 4 .IX Item "-i[标志], --info[=标志] 文件 …" 显示文件信息。不进行转换。 .Sp 将会显示下列信息(按顺序):DOS断行符的数量、Unix断行符的数量、Mac断行符的数量、是否有BOM、文本/二进制、文件名。 .Sp 输出示例: .Sp .Vb 8 \& 6 0 0 no_bom text dos.txt \& 0 6 0 no_bom text unix.txt \& 0 0 6 no_bom text mac.txt \& 6 6 6 no_bom text mixed.txt \& 50 0 0 UTF\-16LE text utf16le.txt \& 0 50 0 no_bom text utf8unix.txt \& 50 0 0 UTF\-8 text utf8dos.txt \& 2 418 219 no_bom binary dos2unix.exe .Ve .Sp 注意,二进制文件有时会被误判为文本文件。参见选项 \f(CW\*(C`\-s\*(C'\fR。 .Sp 可以为输出设置额外的标志(一个或多个)。 .RS 4 .IP "\fBd\fR" 4 .IX Item "d" 显示DOS断行符的数量。 .IP "\fBu\fR" 4 .IX Item "u" 显示Unix断行符的数量。 .IP "\fBm\fR" 4 .IX Item "m" 显示Mac断行符的数量。 .IP "\fBb\fR" 4 .IX Item "b" 显示BOM状况。 .IP "\fBt\fR" 4 .IX Item "t" 显示文件为文本或二进制。 .IP "\fBc\fR" 4 .IX Item "c" 只显示将会被转换的文件。 .Sp 若设置了 \f(CW\*(C`c\*(C'\fR标志,dos2unix将只显示含有DOS断行符的文件,unix2dos将只显示含有Unix断行符的文件。 .IP "\fBh\fR" 4 .IX Item "h" 显示头部。 .IP "\fBp\fR" 4 .IX Item "p" 显示不含路径的文件名。 .RE .RS 4 .Sp 示例: .Sp 显示所有 *.txt 文件的信息: .Sp .Vb 1 \& dos2unix \-i *.txt .Ve .Sp 只显示DOS断行符和Unix断行符的数量: .Sp .Vb 1 \& dos2unix \-idu *.txt .Ve .Sp 只显示BOM状况: .Sp .Vb 1 \& dos2unix \-\-info=b *.txt .Ve .Sp 列出含有DOS断行符的文件: .Sp .Vb 1 \& dos2unix \-ic *.txt .Ve .Sp 列出含有Unix断行符的文件: .Sp .Vb 1 \& unix2dos \-ic *.txt .Ve .Sp 只转换含有DOS断行符的文件,保持其他文件不变: .Sp .Vb 1 \& dos2unix \-ic *.txt | xargs dos2unix .Ve .Sp 查找含有DOS断行符的文本文件: .Sp .Vb 1 \& find \-name \*(Aq*.txt\*(Aq | xargs dos2unix \-ic .Ve .RE .IP "\fB\-k, \-\-keepdate\fR" 4 .IX Item "-k, --keepdate" 将输入文件的时间戳应用到输出文件。 .IP "\fB\-L, \-\-license\fR" 4 .IX Item "-L, --license" 显示程序许可证。 .IP "\fB\-l, \-\-newline\fR" 4 .IX Item "-l, --newline" 添加额外的新行。 .Sp \&\fBdos2unix\fR:只有DOS断行符会被转换为两个Unix断行符。在Mac模式下,只有Mac断行符会被转换为Unix断行符。 .Sp \&\fBunix2dos\fR:只有Unix断行符会被转换为两个DOS断行符。在Mac模式下,Unix断行符会被转换为两个Mac断行符。 .IP "\fB\-m, \-\-add\-bom\fR" 4 .IX Item "-m, --add-bom" 将字节序标记(BOM)写入到输出文件。默认情况下将写入UTF\-8 BOM。 .Sp 当输入文件为UTF\-16格式,并且使用了 \f(CW\*(C`\-u\*(C'\fR选项,将写入UTF\-16 BOM。 .Sp 当输出文件不是UTF\-8、UTF\-16或GB18030格式时,请不要使用此选项。参加 \s-1UNICODE\s0 一节。 .IP "\fB\-n, \-\-newline 输入文件 输出文件 ...\fR" 4 .IX Item "-n, --newline 输入文件 输出文件 ..." 新文件模式。转换输入文件并写入到输出文件。文件名必须成对给出,并且 \fI不能\fR 使用通配符,否则你 \fI将会\fR丢失文件。 .Sp 使用新文件(配对)模式转换时,命令执行者必须为文件的所有者。新文件的读/写权限将由源文件的权限减去命令执行者的 \fIumask\fR\|(1) 得到。 .IP "\fB\-o, \-\-oldfile 文件 ...\fR" 4 .IX Item "-o, --oldfile 文件 ..." 旧文件模式。转换并将输出覆盖到源文件。程序默认使用此模式,允许使用通配符。 .Sp 在旧文件(替换)模式下,被转换的文件的所有者、组和读/写权限保持不变。当文件被其他具有写权限的用户(如root)转换时,情况也是如此。如果无法保持这些值不变,转换将会终止。改变源文件的所有者可能造成其无法读取该文件,而改变组则可能带来安全隐患,使文件被不法分子读取。只有Unix才支持转换时保留所有者、组和读/写权限。 .IP "\fB\-q, \-\-quiet\fR" 4 .IX Item "-q, --quiet" 安静模式。不显示任何警告或信息。返回值为0,除非命令行选项有误。 .IP "\fB\-r, \-\-remove\-bom\fR" 4 .IX Item "-r, --remove-bom" 移除字节序标记(BOM),不写入BOM到输出文件。这是转换到Unix断行符时的默认行为。参见选项 \f(CW\*(C`\-b\*(C'\fR。 .IP "\fB\-s, \-\-safe\fR" 4 .IX Item "-s, --safe" 跳过二进制文件(默认)。 .Sp 跳过二进制文件是为了避免可能的错误。请注意,对二进制文件的探测并不能做到100%准确。程序通过扫描二进制文件所特有的标记来将其与文本文件区分开来,但有的二进制文件可能只包含普通的文本字符,这样的文件就会被误判为文本文件。 .IP "\fB\-u, \-\-keep\-utf16\fR" 4 .IX Item "-u, --keep-utf16" 保留输入文件的UTF\-16编码。输出文件也使用UTF\-16编码和相同的尾序。这将阻止转换到UTF\-8。相应也会写入UTF\-16 BOM。可以用 \&\f(CW\*(C`\-ascii\*(C'\fR选项来禁止。 .IP "\fB\-ul, \-\-assume\-utf16le\fR" 4 .IX Item "-ul, --assume-utf16le" 假定输入文件格式为UTF\-16LE。 .Sp 输入文件中有BOM时,将会覆盖此选项。 .Sp 如果你做了错误的假设(输入文件不为UTF\-16LE格式),并且转换成功,你将会得到一个错误的UTF\-8格式的文件。你可以用 \fIiconv\fR\|(1) 来撤销转换,将其从UTF\-8转换回UTF\-16LE。这样做可以恢复源文件。 .Sp 对UTF\-16LE的假定将根据 l<转换模式> 来工作。若改变了默认的 l 模式,则这一假定将会被关闭。 .IP "\fB\-ub, \-\-assume\-utf16be\fR" 4 .IX Item "-ub, --assume-utf16be" 假定输入文件格式为UTF\-16BE。 .Sp 这一选项与 \f(CW\*(C`\-ul\*(C'\fR 类似。 .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" 显示更多信息。将会显示有关BOM和转换统计的额外信息。 .IP "\fB\-F, \-\-follow\-symlink\fR" 4 .IX Item "-F, --follow-symlink" 追踪符号链接并转换其目标。 .IP "\fB\-R, \-\-replace\-symlink\fR" 4 .IX Item "-R, --replace-symlink" 将符号链接的目标替换为转换后的文件(原来的目标文件保持不变)。 .IP "\fB\-S, \-\-skip\-symlink\fR" 4 .IX Item "-S, --skip-symlink" 保持符号链接和其目标文件不变(默认)。 .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" 显示版本信息,然后退出。 .SH "Mac模式" .IX Header "Mac模式" 普通模式下,断行符将被转换为DOS格式,或相反。Mac格式的断行符将不会被转换。 .PP Mac模式下,Mac断行符将被转换为Unix格式,或相反。DOS断行符将不会被转换。 .PP 若要以Mac模式运行,请使用命令行选项 \f(CW\*(C`\-c mac\*(C'\fR,或使用命令 \f(CW\*(C`mac2unix\*(C'\fR 或 \f(CW\*(C`unix2mac\*(C'\fR。 .SH "转换模式" .IX Header "转换模式" .IP "\fBascii\fR" 4 .IX Item "ascii" 在 \f(CW\*(C`ascii\*(C'\fR 模式下,只转换断行符。 这是默认的转换模式。 .Sp 尽管此模式名叫“ASCII”(7位编码标准),实际上转换按照8位编码进行。转换UTF\-8编码文件时请务必使用此模式。 .IP "\fB7bit\fR" 4 .IX Item "7bit" 在此模式下,所以的8位非ASCII字符(取值范围128\-255)将被转换到7位编码空间。 .IP "\fBiso\fR" 4 .IX Item "iso" Unix下,将在DOS字符集(编码页)和ISO字符集 ISO\-8859\-1(Latin\-1)之间进行转换。不具有 \s-1ISO\-8859\-1\s0 中对等字符的DOS字符将会被转换为点号(“.”)。当 \s-1ISO\-8859\-1\s0 字符集中没有DOS中的对等字符时也是如此。 .Sp 当只指定了 \f(CW\*(C`\-iso\*(C'\fR 选项时,dos2unix将尝试确定当前活动代码页。若无法确定,则使用默认代码页 CP437(普遍用于美国)。若要强制指定代码页,请使用选项 \&\f(CW\*(C`\-437\*(C'\fR(美国)、\f(CW\*(C`\-850\*(C'\fR(西欧)、\f(CW\*(C`\-860\*(C'\fR(葡萄牙)、\f(CW\*(C`\-863\*(C'\fR(法国、加拿大)或\f(CW\*(C`\-865\*(C'\fR(北欧)。 Windows CP1252代码页(西欧)也可以通过选项 \f(CW\*(C`\-1252\*(C'\fR 获得支持。若要使用其他代码页,可以结合 \fIiconv\fR\|(1) 使用dos2unix。iconv可以在很多字符编码间进行转换。 .Sp 不对Unicode编码文本使用ISO转换。因这一转换会导致UTF\-8编码文件损坏。 .Sp 一些示例: .Sp 从DOS默认编码页转换到Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-iso \-n in.txt out.txt .Ve .Sp 从DOS CP850转换到Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-850 \-n in.txt out.txt .Ve .Sp 从Windows CP1252转换到Unix Latin\-1: .Sp .Vb 1 \& dos2unix \-1252 \-n in.txt out.txt .Ve .Sp 从WIndows CP1252转换到Unix UTF\-8(Unicode): .Sp .Vb 1 \& iconv \-f CP1252 \-t UTF\-8 in.txt | dos2unix > out.txt .Ve .Sp 从Unix Latin\-1转换到DOS默认编码页: .Sp .Vb 1 \& unix2dos \-iso \-n in.txt out.txt .Ve .Sp 从Unix Latin\-1转换到DOS CP850: .Sp .Vb 1 \& unix2dos \-850 \-n in.txt out.txt .Ve .Sp 从Unix Latin\-1转换到Windows CP1252: .Sp .Vb 1 \& unix2dos \-1252 \-n in.txt out.txt .Ve .Sp 从Unix UTF\-8(Unicode)转换到Windows CP1252: .Sp .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t CP1252 > out.txt .Ve .Sp 参见 et 。 .SH "UNICODE" .IX Header "UNICODE" .SS "编码" .IX Subsection "编码" 有几种不同的Unicode编码。对于Unix和Linux中的Unicode文件,通常为UTF\-8编码。Windows中的文本文件可以是UTF\-8、UTF\-16或UTF\-16BE编码,但大多采用UTF\-16格式。 .SS "转换" .IX Subsection "转换" Unicode文本文件可以含有DOS、Unix或Mac断行符,就像普通文本文件一样。 .PP 所有版本的dos2unix和unix2dos都可以转换UTF\-8文件,因为UTF\-8向后兼容ASCII。 .PP 含有Unicode UTF\-16支持的dos2unix和unix2dos可以读取小尾序或大尾序的UTF\-16编码文本。输入 \f(CW\*(C`dos2unix \-V\*(C'\fR 来确定dos2unix在编译是是否启用了UTF\-16支持。 .PP 在Unix/Linux中,UTF\-16编码文件将被转换为区域字符编码所指定的编码。可以使用 \fIlocale\fR\|(1) 命令来查看当前的区域字符编码。若无法转换,程序将报告转换错误并跳过此文件。 .PP 在Windows中,UTF\-16文件被默认转换为UTF\-8格式。Windows和Unix/Linux均支持UTF\-8格式的文本文件。 .PP UTF\-16和UTF\-8编码相互兼容,所以彼此转换时不会丢失文本。倘若转换中出错,比如UTF\-16格式的输入文件含有错误,那么该文件将被跳过。 .PP 若使用了 \f(CW\*(C`\-u\*(C'\fR 选项,输出文件将会使用和输入文件相同的UTF\-16编码。\f(CW\*(C`\-u\*(C'\fR选项将阻止程序转换到UTF\-8。 .PP dos2unix和unix2dos没有用于转换UTF\-8到UTF\-16的选项。 .PP ISO和7位编码模式的转换无法用于UTF\-16文件。 .SS "字节序标记" .IX Subsection "字节序标记" 在Windows中,文本文件一般含有字节序标记(BOM),因为很多Windows程序(包括记事本)默认添加BOM。参见 。 .PP 在Unix中,Unicode文件一般不含BOM。假定文本文件使用区域字符编码设置所指定的编码。 .PP dos2unix只能检测含有BOM文件的UTF\-16格式。若UTF\-16文件不含BOM,dos2unix会将其视作二进制文件。 .PP 请使用选项 \f(CW\*(C`\-ul\*(C'\fR 或 \f(CW\*(C`\-ub\*(C'\fR 来转换不含BOM的UTF\-16文件。 .PP dos2unix默认不输出BOM。使用 \f(CW\*(C`\-b\*(C'\fR 选项可以让dos2unix将BOM添加到输出文件,如果输入文件也含有BOM的话。 .PP unix2dos默认输出BOM,如果输入文件也含有BOM的话。使用 \f(CW\*(C`\-r\*(C'\fR 可以移除BOM。 .PP 若使用了 \f(CW\*(C`\-m\*(C'\fR 选项,dos2unix和unix2dos将总是输出BOM。 .SS "Windows中Unicode文件的文件名" .IX Subsection "Windows中Unicode文件的文件名" dos2unix对于Windows命令提示符中读取和写入Unicode文件名有额外的支持。这意味着dos2unix可以打开那些包含非默认系统ANSI编码页字符的文件。若要查看Windows版dos2unix在编译时是否加入了Unicode文件名支持,请输入 \&\f(CW\*(C`dos2unix \-V\*(C'\fR。 .PP 在Windows终端中显示Unicode文件名有一些需要注意的问题。请参见 \f(CW\*(C`\-D\*(C'\fR 和 \f(CW\*(C`\-\-display\-enc\*(C'\fR 选项。文件名在终端中可能无法被正确显示,但写入文件时文件名仍然是正确的。 .SS "Unicode示例" .IX Subsection "Unicode示例" 转换Windows UTF\-16到Unix UTF\-8: .PP .Vb 1 \& dos2unix \-n in.txt out.txt .Ve .PP 转换Windows UTF\-16LE(不含BOM)到Unix UTF\-8: .PP .Vb 1 \& dos2unix \-ul \-n in.txt out.txt .Ve .PP 转换Unix UTF\-8到Windows UTF\-8(并添加BOM): .PP .Vb 1 \& unix2dos \-m \-n in.txt out.txt .Ve .PP 转换Unix UTF\-8到Windows UTF\-16: .PP .Vb 1 \& unix2dos < in.txt | iconv \-f UTF\-8 \-t UTF\-16 > out.txt .Ve .SH "GB18030" .IX Header "GB18030" GB18030是中国国家标准。GB18030标准的一系列子集被强制应用于中国销售的软件产品。参见 。 .PP GB18030与Unicode完全兼容,并且可以被认为是Unicode格式的变体。和UTF\-8一样,GB18030也兼容ASCII。GB18030也兼容Windows 936代码页(GBK)。 .PP 在Unix/Linux中,若区域编码被设置为GB18030,UTF\-16文件将被转换为GB18030格式。注意只有当系统支持区域设置时这一才会进行这一转换。可以使用 \&\f(CW\*(C`locale \-a\*(C'\fR 命令来获取受支持的区域。 .PP 在Windows中,你需要使用 \f(CW\*(C`\-gb\*(C'\fR 选项来转换UTF\-16文件到GB18030编码。 .PP GB18030编码的文件和Unicode文件一样可以含有BOM。 .SH "示例" .IX Header "示例" 从标准输入读取,并输出到标准输出: .PP .Vb 2 \& dos2unix < a.txt \& cat a.txt | dos2unix .Ve .PP 转换并覆盖a.txt和b.txt: .PP .Vb 2 \& dos2unix a.txt b.txt \& dos2unix \-o a.txt b.txt .Ve .PP 转换并覆盖a.txt,使用ascii模式: .PP .Vb 1 \& dos2unix a.txt .Ve .PP 转换并覆盖a.txt,使用ascii模式;转换并覆盖b.txt,使用7位编码模式: .PP .Vb 3 \& dos2unix a.txt \-c 7bit b.txt \& dos2unix \-c ascii a.txt \-c 7bit b.txt \& dos2unix \-ascii a.txt \-7 b.txt .Ve .PP 将a.txt从Mac格式转换到Unix格式: .PP .Vb 2 \& dos2unix \-c mac a.txt \& mac2unix a.txt .Ve .PP 将a.txt从Unix格式转换到Mac格式: .PP .Vb 2 \& unix2dos \-c mac a.txt \& unix2mac a.txt .Ve .PP 转换并覆盖a.txt,保留原始时间戳: .PP .Vb 2 \& dos2unix \-k a.txt \& dos2unix \-k \-o a.txt .Ve .PP 转换a.txt,并输出到e.txt: .PP .Vb 1 \& dos2unix \-n a.txt e.txt .Ve .PP 转换a.txt,并输出到e.txt,同时使e.txt的时间戳和a.txt一致: .PP .Vb 1 \& dos2unix \-k \-n a.txt e.txt .Ve .PP 转换并覆盖a.txt;转换b.txt并输出到e.txt: .PP .Vb 2 \& dos2unix a.txt \-n b.txt e.txt \& dos2unix \-o a.txt \-n b.txt e.txt .Ve .PP 转换c.txt并输出到e.txt;转换并覆盖a.txt和b.txt;转换d.txt并输出到f.txt: .PP .Vb 1 \& dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt .Ve .SH "递归转换" .IX Header "递归转换" 结合 \fIfind\fR\|(1) 和 \fIxargs\fR\|(1) 使用dos2unix可以递归地转换目录树中的文本文件。例如,转换当前目录的目录树中所有的.txt文件: .PP .Vb 1 \& find . \-name \*(Aq*.txt\*(Aq |xargs dos2unix .Ve .PP 在Windows命令提示符中,可以使用下列命令: .PP .Vb 1 \& for /R %G in (*.txt) do dos2unix "%G" .Ve .PP PowerShell用户可以在Windows PowerShell中使用如下命令: .PP .Vb 1 \& get\-childitem \-path . \-filter \*(Aq*.txt\*(Aq \-recurse | foreach\-object {dos2unix $_.Fullname} .Ve .SH "区域" .IX Header "区域" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" LANG环境变量指定了程序所使用的首选语言。它包括几个部分:第一部分是小写的语言编码,第二部分是(可选的)大写的国家/地区代码,前面用下划线连接;第三部分也是可选的,即字符编码,前面用点连接。一些POSIX规范的示例如下: .Sp .Vb 7 \& export LANG=zh 中文 \& export LANG=zh_CN 中文,中国 \& export LANG=zh_TW 中文,台湾 \& export LANG=es_ES 西班牙语,西班牙 \& export LANG=es_MX 西班牙语,墨西哥 \& export LANG=en_US.iso88591 英语,美国,Latin\-1编码 \& export LANG=en_GB.UTF\-8 英语,英国,UTF\-8编码 .Ve .Sp 完整的语言和国家/地区编码可以在gettext手册中找到: .Sp 在Unix系统中,你可以使用 \fIlocale\fR\|(1) 命令获取特定区域的信息。 .IP "\fB\s-1LANGUAGE\s0\fR" 4 .IX Item "LANGUAGE" 可以使用LANGUAGE变量指定一系列语言的优先级,各项之间由冒号分割。dos2unix首先使用LANGUAGE变量,其次才是LANG。例如,首选中文、其次英文:\f(CW\*(C`LANGUAGE= .Sp 如果你选择了一个不可用的语言,程序将会输出标准的英语信息。 .IP "\fB\s-1DOS2UNIX_LOCALEDIR\s0\fR" 4 .IX Item "DOS2UNIX_LOCALEDIR" DOS2UNIX_LOCALEDIR环境变量将覆盖编译时设置的LOCALEDIR变量。LOCALEDIR被用于查找语言文件。GNU程序的默认值为 \&\f(CW\*(C`/usr/local/share/locale\*(C'\fR。可以使用 \fB\-\-version\fR 查看当前的LOCALEDIR。 .Sp 示例(POSIX shell): .Sp .Vb 1 \& export DOS2UNIX_LOCALEDIR=$HOME/share/locale .Ve .SH "返回值" .IX Header "返回值" 若成功,返回0。若出现系统错误,则返回最近一次系统错误号。若发生其他错误,返回1。 .PP 在安静模式下,返回值总是为0,除非命令行选项有误。 .SH "遵循规范" .IX Header "遵循规范" .PP .PP .PP .SH "作者" .IX Header "作者" Benjamin Lin \- Bernd Johannes Wuebben(mac2unix模式) \- ,Christian Wurll(添加额外新行) \- ,Erwin Waterlander \- (维护者) .PP 项目主页: .PP SourceForge主页: .SH "参见" .IX Header "参见" \&\fIfile\fR\|(1) \fIfind\fR\|(1) \fIiconv\fR\|(1) \fIlocale\fR\|(1) \fIxargs\fR\|(1) dos2unix-7.3.4/man/zh_CN/man1/dos2unix.htm0000644000175500010010000014742312721132572017461 0ustar waterlanGeen dos2unix 7.3.4 - DOS/Mac - Unix文件格式转换器

名称

dos2unix - DOS/Mac - Unix文件格式转换器

概要

    dos2unix [选项] [文件 …] [-n 输入文件 输出文件 ...]
    unix2dos [选项] [文件 …] [-n 输入文件 输出文件 ...]

说明

Dos2unix软件包包括工具dos2unixunix2dos,用于将纯文本文件在DOS或Mac格式与Unix格式之间相互转换。

DOS/Windows的文本文件中,断行符是由两个字符共同表示的:回车符(CR)和换行符(LF)。Unix的文本文件中,换行符则由单个换行符(LF)表示。而Mac的文本文件则由单个回车符(CR,用于Mac OS X之前的系统)或单个换行符(LF,用于当下的新Mac OS)表示。

除了断行符,Dos2unix还可以转换文件编码。一些DOS编码页可以被转换为Unix Latin-1,Windows Unicode(UTF-16)文件也可以被转换为Unix Unicode(UTF-8)文件。

二进制文件则会被自动跳过,除非指定了强制转换选项。

特殊文件,如目录和队列,会被自动跳过。

符号链接和其所指向的目标默认不会被转换。可以用选项来指定替换符号链接,或者将输出写入到链接目标。Windows下不支持写入到符号链接的目标。

Dos2unix由SunOS/Solaris下的版本改写而成。这两个版本间有一个重大差异:本版本默认进行原位转换(旧文件模式),而原来SunOS/Solaris下的版本只支持配对转换(新文件模式),参见选项 -o-n。还有一个区别是SunOS/Solaris下的版本默认使用 iso 模式,而本版本默认使用 ascii 模式。

选项

--

将后面所有的选项当作文件名。如果你希望转换一个文件名以破折号开头的文件,可以使用这个选项。例如,要转换一个名为“-foo”的文件,你可以用这个命令:

    dos2unix -- -foo

或者在新文件模式中:

    dos2unix -n -- -foo out.txt
-ascii

只转换断行符。这是默认的转换模式。

-iso

在DOS和ISO-8859-1字符集之间转换。参见 CONVERSION MODES 一节。

-1252

使用Windows 1252 编码页(西欧)。

-437

使用DOS 437 编码页(美国)。这是ISO转换时的默认编码页。

-850

使用DOS 850 编码页(西欧)。

-860

使用DOS 860 编码页(葡萄牙)。

-863

使用DOS 863 编码页(加拿大法语)。

-865
 使用DOS 865 编码页(北欧)。
-7

将8位字符转换到7位空间。

-b, --keep-bom

保留字节序标记(BOM)。当输入文件含有BOM头时,也向输出文件写入BOM。这是转换到DOS断行符时的默认行为。参见选项 -r

-c, --convmode 转换模式

改变转换模式。转换模式可以为:ascii7bitisomac,默认为ascii。

-D, --display-enc ENCODAGE

设置显示文本的编码。编码可以为:ansiunicodeunicodebomutf8utf8bom,默认为 ansi。

这一选项只对支持Unicode文件名的Windows版dos2unix有效。它对文件名的读写无效,只影响它们的显示结果。

在Windows控制台中,有几种可以根据文本编码来显示文本的方法。它们各有利弊。

ansi

dos2unix默认使用ANSI编码文本。优点是它能提供向后兼容性,并能用于raster和TrueType字体。在一些地方,你可能需要使用 chcp 命令将活动DOS OEM编码页设置为Windows系统ANSI编码页,因为dos2unix使用Windows系统编码页。

ansi的缺点是含有非系统默认编码页中字符的国际化文件名将无法被正确显示。你会看到一些问号或其他错误的字符。如果你不需要处理外文文件名,这一方法是不错的选择。

unicode,unicodebom

Unicode编码(Windows中对UTF-16的称呼)的优点是文本可以被正确显示,也无需改变活动编码页。你可能需要设置终端字体为TrueType以便正确显示国际化字符。如果TrueType字体中不包含某个字符,你会看到一个小方块,有时方块中还会有一个问号。

当你使用ConEmu终端时,所以的文本将会被正确显示,因为ConEmu会自动选择合适的字体。

Unicode的缺点在于它与ASCII不兼容。当你将输出重定向到其他程序或文件时,它可能不那么容易控制

当使用 unicodebom 方法时,将会在Unicode文本前添加一个BOM(字节序标记)。在PowerShell中,需要根据BOM来进行正确的重定向或管道输出。

utf8,utf8bom

utf8的优点在于它与ASCII兼容。你需要设置终端的字体为TrueType字体。使用TrueType字体可以使得文本得以正确显示,就像使用 unicode 编码时那样。

缺点是当你使用默认的raster字体时,所有的非ASCII字符将无法被正确显示。不仅是unicode文件名,连翻译的消息也无法被读取。在配置为东亚地区的Windows中,当终端中显示这些消息时你可能会看到闪烁现象。

在ConEmu终端中,utf编码方式可以正常工作。

当使用 utf8bom 方法时,将会在Unicode文本前添加一个BOM(字节序标记)。在PowerShell中,需要根据BOM来进行正确的重定向或管道输出。

默认的编码方式可以通过设置 DOS2UNIX_DISPLAY_ENC 环境变量为 unicodeunicodebomutf8utf8bom 来改变。

-f, --force

强制转换二进制文件。

-gb, --gb18030

在Windows中,UTF-16默认被转换为UTF-8格式,无论区域设置为何。请使用这一选项将UTF-16文件转换为GB18030格式。此选项只在Windows下有效。参加 GB18030 一节。

-h, --help

显示帮助,然后退出。

-i[标志], --info[=标志] 文件 …

显示文件信息。不进行转换。

将会显示下列信息(按顺序):DOS断行符的数量、Unix断行符的数量、Mac断行符的数量、是否有BOM、文本/二进制、文件名。

输出示例:

     6       0       0  no_bom    text    dos.txt
     0       6       0  no_bom    text    unix.txt
     0       0       6  no_bom    text    mac.txt
     6       6       6  no_bom    text    mixed.txt
    50       0       0  UTF-16LE  text    utf16le.txt
     0      50       0  no_bom    text    utf8unix.txt
    50       0       0  UTF-8     text    utf8dos.txt
     2     418     219  no_bom    binary  dos2unix.exe

注意,二进制文件有时会被误判为文本文件。参见选项 -s

可以为输出设置额外的标志(一个或多个)。

d

显示DOS断行符的数量。

u

显示Unix断行符的数量。

m

显示Mac断行符的数量。

b

显示BOM状况。

t

显示文件为文本或二进制。

c

只显示将会被转换的文件。

若设置了 c标志,dos2unix将只显示含有DOS断行符的文件,unix2dos将只显示含有Unix断行符的文件。

h

显示头部。

p

显示不含路径的文件名。

示例:

显示所有 *.txt 文件的信息:

    dos2unix -i *.txt

只显示DOS断行符和Unix断行符的数量:

    dos2unix -idu *.txt

只显示BOM状况:

    dos2unix --info=b *.txt

列出含有DOS断行符的文件:

    dos2unix -ic *.txt

列出含有Unix断行符的文件:

    unix2dos -ic *.txt

只转换含有DOS断行符的文件,保持其他文件不变:

    dos2unix -ic *.txt | xargs dos2unix

查找含有DOS断行符的文本文件:

    find -name '*.txt' | xargs dos2unix -ic
-k, --keepdate

将输入文件的时间戳应用到输出文件。

-L, --license

显示程序许可证。

-l, --newline

添加额外的新行。

dos2unix:只有DOS断行符会被转换为两个Unix断行符。在Mac模式下,只有Mac断行符会被转换为Unix断行符。

unix2dos:只有Unix断行符会被转换为两个DOS断行符。在Mac模式下,Unix断行符会被转换为两个Mac断行符。

-m, --add-bom

将字节序标记(BOM)写入到输出文件。默认情况下将写入UTF-8 BOM。

当输入文件为UTF-16格式,并且使用了 -u选项,将写入UTF-16 BOM。

当输出文件不是UTF-8、UTF-16或GB18030格式时,请不要使用此选项。参加 UNICODE 一节。

-n, --newline 输入文件 输出文件 ...

新文件模式。转换输入文件并写入到输出文件。文件名必须成对给出,并且 不能 使用通配符,否则你 将会丢失文件。

使用新文件(配对)模式转换时,命令执行者必须为文件的所有者。新文件的读/写权限将由源文件的权限减去命令执行者的 umask(1) 得到。

-o, --oldfile 文件 ...

旧文件模式。转换并将输出覆盖到源文件。程序默认使用此模式,允许使用通配符。

在旧文件(替换)模式下,被转换的文件的所有者、组和读/写权限保持不变。当文件被其他具有写权限的用户(如root)转换时,情况也是如此。如果无法保持这些值不变,转换将会终止。改变源文件的所有者可能造成其无法读取该文件,而改变组则可能带来安全隐患,使文件被不法分子读取。只有Unix才支持转换时保留所有者、组和读/写权限。

-q, --quiet

安静模式。不显示任何警告或信息。返回值为0,除非命令行选项有误。

-r, --remove-bom

移除字节序标记(BOM),不写入BOM到输出文件。这是转换到Unix断行符时的默认行为。参见选项 -b

-s, --safe

跳过二进制文件(默认)。

跳过二进制文件是为了避免可能的错误。请注意,对二进制文件的探测并不能做到100%准确。程序通过扫描二进制文件所特有的标记来将其与文本文件区分开来,但有的二进制文件可能只包含普通的文本字符,这样的文件就会被误判为文本文件。

-u, --keep-utf16

保留输入文件的UTF-16编码。输出文件也使用UTF-16编码和相同的尾序。这将阻止转换到UTF-8。相应也会写入UTF-16 BOM。可以用 -ascii选项来禁止。

-ul, --assume-utf16le

假定输入文件格式为UTF-16LE。

输入文件中有BOM时,将会覆盖此选项。

如果你做了错误的假设(输入文件不为UTF-16LE格式),并且转换成功,你将会得到一个错误的UTF-8格式的文件。你可以用 iconv(1) 来撤销转换,将其从UTF-8转换回UTF-16LE。这样做可以恢复源文件。

对UTF-16LE的假定将根据 l<转换模式> 来工作。若改变了默认的 l<ascii> 模式,则这一假定将会被关闭。

-ub, --assume-utf16be

假定输入文件格式为UTF-16BE。

这一选项与 -ul 类似。

-v, --verbose

显示更多信息。将会显示有关BOM和转换统计的额外信息。

追踪符号链接并转换其目标。

将符号链接的目标替换为转换后的文件(原来的目标文件保持不变)。

保持符号链接和其目标文件不变(默认)。

-V, --version

显示版本信息,然后退出。

Mac模式

普通模式下,断行符将被转换为DOS格式,或相反。Mac格式的断行符将不会被转换。

Mac模式下,Mac断行符将被转换为Unix格式,或相反。DOS断行符将不会被转换。

若要以Mac模式运行,请使用命令行选项 -c mac,或使用命令 mac2unixunix2mac

转换模式

ascii

ascii 模式下,只转换断行符。 这是默认的转换模式。

尽管此模式名叫“ASCII”(7位编码标准),实际上转换按照8位编码进行。转换UTF-8编码文件时请务必使用此模式。

7bit

在此模式下,所以的8位非ASCII字符(取值范围128-255)将被转换到7位编码空间。

iso

Unix下,将在DOS字符集(编码页)和ISO字符集 ISO-8859-1(Latin-1)之间进行转换。不具有 ISO-8859-1 中对等字符的DOS字符将会被转换为点号(“.”)。当 ISO-8859-1 字符集中没有DOS中的对等字符时也是如此。

当只指定了 -iso 选项时,dos2unix将尝试确定当前活动代码页。若无法确定,则使用默认代码页 CP437(普遍用于美国)。若要强制指定代码页,请使用选项 -437(美国)、-850(西欧)、-860(葡萄牙)、-863(法国、加拿大)或-865(北欧)。 Windows CP1252代码页(西欧)也可以通过选项 -1252 获得支持。若要使用其他代码页,可以结合 iconv(1) 使用dos2unix。iconv可以在很多字符编码间进行转换。

不对Unicode编码文本使用ISO转换。因这一转换会导致UTF-8编码文件损坏。

一些示例:

从DOS默认编码页转换到Unix Latin-1:

    dos2unix -iso -n in.txt out.txt

从DOS CP850转换到Unix Latin-1:

    dos2unix -850 -n in.txt out.txt

从Windows CP1252转换到Unix Latin-1:

    dos2unix -1252 -n in.txt out.txt

从WIndows CP1252转换到Unix UTF-8(Unicode):

    iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt

从Unix Latin-1转换到DOS默认编码页:

    unix2dos -iso -n in.txt out.txt

从Unix Latin-1转换到DOS CP850:

    unix2dos -850 -n in.txt out.txt

从Unix Latin-1转换到Windows CP1252:

    unix2dos -1252 -n in.txt out.txt

从Unix UTF-8(Unicode)转换到Windows CP1252:

    unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt

参见 http://czyborra.com/charsets/codepages.html et http://czyborra.com/charsets/iso8859.html

UNICODE

编码

有几种不同的Unicode编码。对于Unix和Linux中的Unicode文件,通常为UTF-8编码。Windows中的文本文件可以是UTF-8、UTF-16或UTF-16BE编码,但大多采用UTF-16格式。

转换

Unicode文本文件可以含有DOS、Unix或Mac断行符,就像普通文本文件一样。

所有版本的dos2unix和unix2dos都可以转换UTF-8文件,因为UTF-8向后兼容ASCII。

含有Unicode UTF-16支持的dos2unix和unix2dos可以读取小尾序或大尾序的UTF-16编码文本。输入 dos2unix -V 来确定dos2unix在编译是是否启用了UTF-16支持。

在Unix/Linux中,UTF-16编码文件将被转换为区域字符编码所指定的编码。可以使用 locale(1) 命令来查看当前的区域字符编码。若无法转换,程序将报告转换错误并跳过此文件。

在Windows中,UTF-16文件被默认转换为UTF-8格式。Windows和Unix/Linux均支持UTF-8格式的文本文件。

UTF-16和UTF-8编码相互兼容,所以彼此转换时不会丢失文本。倘若转换中出错,比如UTF-16格式的输入文件含有错误,那么该文件将被跳过。

若使用了 -u 选项,输出文件将会使用和输入文件相同的UTF-16编码。-u选项将阻止程序转换到UTF-8。

dos2unix和unix2dos没有用于转换UTF-8到UTF-16的选项。

ISO和7位编码模式的转换无法用于UTF-16文件。

字节序标记

在Windows中,文本文件一般含有字节序标记(BOM),因为很多Windows程序(包括记事本)默认添加BOM。参见 http://en.wikipedia.org/wiki/Byte_order_mark

在Unix中,Unicode文件一般不含BOM。假定文本文件使用区域字符编码设置所指定的编码。

dos2unix只能检测含有BOM文件的UTF-16格式。若UTF-16文件不含BOM,dos2unix会将其视作二进制文件。

请使用选项 -ul-ub 来转换不含BOM的UTF-16文件。

dos2unix默认不输出BOM。使用 -b 选项可以让dos2unix将BOM添加到输出文件,如果输入文件也含有BOM的话。

unix2dos默认输出BOM,如果输入文件也含有BOM的话。使用 -r 可以移除BOM。

若使用了 -m 选项,dos2unix和unix2dos将总是输出BOM。

Windows中Unicode文件的文件名

dos2unix对于Windows命令提示符中读取和写入Unicode文件名有额外的支持。这意味着dos2unix可以打开那些包含非默认系统ANSI编码页字符的文件。若要查看Windows版dos2unix在编译时是否加入了Unicode文件名支持,请输入 dos2unix -V

在Windows终端中显示Unicode文件名有一些需要注意的问题。请参见 -D--display-enc 选项。文件名在终端中可能无法被正确显示,但写入文件时文件名仍然是正确的。

Unicode示例

转换Windows UTF-16到Unix UTF-8:

    dos2unix -n in.txt out.txt

转换Windows UTF-16LE(不含BOM)到Unix UTF-8:

    dos2unix -ul -n in.txt out.txt

转换Unix UTF-8到Windows UTF-8(并添加BOM):

    unix2dos -m -n in.txt out.txt

转换Unix UTF-8到Windows UTF-16:

    unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt

GB18030

GB18030是中国国家标准。GB18030标准的一系列子集被强制应用于中国销售的软件产品。参见 http://en.wikipedia.org/wiki/GB_18030

GB18030与Unicode完全兼容,并且可以被认为是Unicode格式的变体。和UTF-8一样,GB18030也兼容ASCII。GB18030也兼容Windows 936代码页(GBK)。

在Unix/Linux中,若区域编码被设置为GB18030,UTF-16文件将被转换为GB18030格式。注意只有当系统支持区域设置时这一才会进行这一转换。可以使用 locale -a 命令来获取受支持的区域。

在Windows中,你需要使用 -gb 选项来转换UTF-16文件到GB18030编码。

GB18030编码的文件和Unicode文件一样可以含有BOM。

示例

从标准输入读取,并输出到标准输出:

    dos2unix < a.txt
    cat a.txt | dos2unix

转换并覆盖a.txt和b.txt:

    dos2unix a.txt b.txt
    dos2unix -o a.txt b.txt

转换并覆盖a.txt,使用ascii模式:

    dos2unix a.txt

转换并覆盖a.txt,使用ascii模式;转换并覆盖b.txt,使用7位编码模式:

    dos2unix a.txt -c 7bit b.txt
    dos2unix -c ascii a.txt -c 7bit b.txt
    dos2unix -ascii a.txt -7 b.txt

将a.txt从Mac格式转换到Unix格式:

    dos2unix -c mac a.txt
    mac2unix a.txt

将a.txt从Unix格式转换到Mac格式:

    unix2dos -c mac a.txt
    unix2mac a.txt

转换并覆盖a.txt,保留原始时间戳:

    dos2unix -k a.txt
    dos2unix -k -o a.txt

转换a.txt,并输出到e.txt:

    dos2unix -n a.txt e.txt

转换a.txt,并输出到e.txt,同时使e.txt的时间戳和a.txt一致:

    dos2unix -k -n a.txt e.txt

转换并覆盖a.txt;转换b.txt并输出到e.txt:

    dos2unix a.txt -n b.txt e.txt
    dos2unix -o a.txt -n b.txt e.txt

转换c.txt并输出到e.txt;转换并覆盖a.txt和b.txt;转换d.txt并输出到f.txt:

    dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt

递归转换

结合 find(1) 和 xargs(1) 使用dos2unix可以递归地转换目录树中的文本文件。例如,转换当前目录的目录树中所有的.txt文件:

    find . -name '*.txt' |xargs dos2unix

在Windows命令提示符中,可以使用下列命令:

    for /R %G in (*.txt) do dos2unix "%G"

PowerShell用户可以在Windows PowerShell中使用如下命令:

    get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}

区域

LANG

LANG环境变量指定了程序所使用的首选语言。它包括几个部分:第一部分是小写的语言编码,第二部分是(可选的)大写的国家/地区代码,前面用下划线连接;第三部分也是可选的,即字符编码,前面用点连接。一些POSIX规范的示例如下:

    export LANG=zh               中文
    export LANG=zh_CN            中文,中国
    export LANG=zh_TW            中文,台湾
    export LANG=es_ES            西班牙语,西班牙
    export LANG=es_MX            西班牙语,墨西哥
    export LANG=en_US.iso88591   英语,美国,Latin-1编码
    export LANG=en_GB.UTF-8      英语,英国,UTF-8编码

完整的语言和国家/地区编码可以在gettext手册中找到:http://www.gnu.org/software/gettext/manual/html_node/Usual-Language-Codes.html

在Unix系统中,你可以使用 locale(1) 命令获取特定区域的信息。

LANGUAGE

可以使用LANGUAGE变量指定一系列语言的优先级,各项之间由冒号分割。dos2unix首先使用LANGUAGE变量,其次才是LANG。例如,首选中文、其次英文:LANGUAGE=<zh:en。在使用语言优先级之前,必须先启用区域化功能,即将LANG(或LC_ALL)变量设置为除了“C”以外的其他值。参见gettext手册:http://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html

如果你选择了一个不可用的语言,程序将会输出标准的英语信息。

DOS2UNIX_LOCALEDIR

DOS2UNIX_LOCALEDIR环境变量将覆盖编译时设置的LOCALEDIR变量。LOCALEDIR被用于查找语言文件。GNU程序的默认值为 /usr/local/share/locale。可以使用 --version 查看当前的LOCALEDIR。

示例(POSIX shell):

    export DOS2UNIX_LOCALEDIR=$HOME/share/locale

返回值

若成功,返回0。若出现系统错误,则返回最近一次系统错误号。若发生其他错误,返回1。

在安静模式下,返回值总是为0,除非命令行选项有误。

遵循规范

http://en.wikipedia.org/wiki/Text_file

http://en.wikipedia.org/wiki/Carriage_return

http://en.wikipedia.org/wiki/Newline

http://en.wikipedia.org/wiki/Unicode

作者

Benjamin Lin - <blin@socs.uts.edu.au> Bernd Johannes Wuebben(mac2unix模式) - <wuebben@kde.org>,Christian Wurll(添加额外新行) - <wurll@ira.uka.de>,Erwin Waterlander - <waterlan@xs4all.nl>(维护者)

项目主页:http://waterlan.home.xs4all.nl/dos2unix.html

SourceForge主页:http://sourceforge.net/projects/dos2unix/

参见

file(1) find(1) iconv(1) locale(1) xargs(1)

dos2unix-7.3.4/man/zh_CN/man1/dos2unix.pod0000644000175500010010000005436012721132555017451 0ustar waterlanGeen ***************************************************** * GENERATED FILE, DO NOT EDIT * * THIS IS NO SOURCE FILE, BUT RESULT OF COMPILATION * ***************************************************** This file was generated by po4a(7). Do not store it (in VCS, for example), but store the PO file used as source file by po4a-translate. In fact, consider this as a binary, and the PO file as a regular .c file: If the PO get lost, keeping this translation up-to-date will be harder. =pod =encoding UTF-8 =head1 名称 dos2unix - DOS/Mac - Unix文件格式转换器 =head1 概要 dos2unix [选项] [文件 …] [-n 输入文件 输出文件 ...] unix2dos [选项] [文件 …] [-n 输入文件 输出文件 ...] =head1 说明 Dos2unix软件包包括工具C 和 C,用于将纯文本文件在DOS或Mac格式与Unix格式之间相互转换。 DOS/Windows的文本文件中,断行符是由两个字符共同表示的:回车符(CR)和换行符(LF)。Unix的文本文件中,换行符则由单个换行符(LF)表示。而Mac的文本文件则由单个回车符(CR,用于Mac OS X之前的系统)或单个换行符(LF,用于当下的新Mac OS)表示。 除了断行符,Dos2unix还可以转换文件编码。一些DOS编码页可以被转换为Unix Latin-1,Windows Unicode(UTF-16)文件也可以被转换为Unix Unicode(UTF-8)文件。 二进制文件则会被自动跳过,除非指定了强制转换选项。 特殊文件,如目录和队列,会被自动跳过。 符号链接和其所指向的目标默认不会被转换。可以用选项来指定替换符号链接,或者将输出写入到链接目标。Windows下不支持写入到符号链接的目标。 Dos2unix由SunOS/Solaris下的版本改写而成。这两个版本间有一个重大差异:本版本默认进行原位转换(旧文件模式),而原来SunOS/Solaris下的版本只支持配对转换(新文件模式),参见选项 C<-o> 和 C<-n>。还有一个区别是SunOS/Solaris下的版本默认使用 I 模式,而本版本默认使用 I 模式。 =head1 选项 =over 4 =item B<--> 将后面所有的选项当作文件名。如果你希望转换一个文件名以破折号开头的文件,可以使用这个选项。例如,要转换一个名为“-foo”的文件,你可以用这个命令: dos2unix -- -foo 或者在新文件模式中: dos2unix -n -- -foo out.txt =item B<-ascii> 只转换断行符。这是默认的转换模式。 =item B<-iso> 在DOS和ISO-8859-1字符集之间转换。参见 CONVERSION MODES 一节。 =item B<-1252> 使用Windows 1252 编码页(西欧)。 =item B<-437> 使用DOS 437 编码页(美国)。这是ISO转换时的默认编码页。 =item B<-850> 使用DOS 850 编码页(西欧)。 =item B<-860> 使用DOS 860 编码页(葡萄牙)。 =item B<-863> 使用DOS 863 编码页(加拿大法语)。 =item B<-865> 使用DOS 865 编码页(北欧)。 =item B<-7> 将8位字符转换到7位空间。 =item B<-b, --keep-bom> 保留字节序标记(BOM)。当输入文件含有BOM头时,也向输出文件写入BOM。这是转换到DOS断行符时的默认行为。参见选项 C<-r>。 =item B<-c, --convmode 转换模式> 改变转换模式。转换模式可以为:I、I<7bit>、I或I,默认为ascii。 =item B<-D, --display-enc ENCODAGE> 设置显示文本的编码。编码可以为:I、I、I、I、I,默认为 ansi。 这一选项只对支持Unicode文件名的Windows版dos2unix有效。它对文件名的读写无效,只影响它们的显示结果。 在Windows控制台中,有几种可以根据文本编码来显示文本的方法。它们各有利弊。 =over 4 =item B dos2unix默认使用ANSI编码文本。优点是它能提供向后兼容性,并能用于raster和TrueType字体。在一些地方,你可能需要使用 C 命令将活动DOS OEM编码页设置为Windows系统ANSI编码页,因为dos2unix使用Windows系统编码页。 ansi的缺点是含有非系统默认编码页中字符的国际化文件名将无法被正确显示。你会看到一些问号或其他错误的字符。如果你不需要处理外文文件名,这一方法是不错的选择。 =item B Unicode编码(Windows中对UTF-16的称呼)的优点是文本可以被正确显示,也无需改变活动编码页。你可能需要设置终端字体为TrueType以便正确显示国际化字符。如果TrueType字体中不包含某个字符,你会看到一个小方块,有时方块中还会有一个问号。 当你使用ConEmu终端时,所以的文本将会被正确显示,因为ConEmu会自动选择合适的字体。 Unicode的缺点在于它与ASCII不兼容。当你将输出重定向到其他程序或文件时,它可能不那么容易控制 当使用 C 方法时,将会在Unicode文本前添加一个BOM(字节序标记)。在PowerShell中,需要根据BOM来进行正确的重定向或管道输出。 =item B utf8的优点在于它与ASCII兼容。你需要设置终端的字体为TrueType字体。使用TrueType字体可以使得文本得以正确显示,就像使用 C 编码时那样。 缺点是当你使用默认的raster字体时,所有的非ASCII字符将无法被正确显示。不仅是unicode文件名,连翻译的消息也无法被读取。在配置为东亚地区的Windows中,当终端中显示这些消息时你可能会看到闪烁现象。 在ConEmu终端中,utf编码方式可以正常工作。 当使用 C 方法时,将会在Unicode文本前添加一个BOM(字节序标记)。在PowerShell中,需要根据BOM来进行正确的重定向或管道输出。 =back 默认的编码方式可以通过设置 DOS2UNIX_DISPLAY_ENC 环境变量为 C 、C、C 或 C 来改变。 =item B<-f, --force> 强制转换二进制文件。 =item B<-gb, --gb18030> 在Windows中,UTF-16默认被转换为UTF-8格式,无论区域设置为何。请使用这一选项将UTF-16文件转换为GB18030格式。此选项只在Windows下有效。参加 GB18030 一节。 =item B<-h, --help> 显示帮助,然后退出。 =item B<-i[标志], --info[=标志] 文件 …> 显示文件信息。不进行转换。 将会显示下列信息(按顺序):DOS断行符的数量、Unix断行符的数量、Mac断行符的数量、是否有BOM、文本/二进制、文件名。 输出示例: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe 注意,二进制文件有时会被误判为文本文件。参见选项 C<-s>。 可以为输出设置额外的标志(一个或多个)。 =over 4 =item B 显示DOS断行符的数量。 =item B 显示Unix断行符的数量。 =item B 显示Mac断行符的数量。 =item B 显示BOM状况。 =item B 显示文件为文本或二进制。 =item B 只显示将会被转换的文件。 若设置了 C标志,dos2unix将只显示含有DOS断行符的文件,unix2dos将只显示含有Unix断行符的文件。 =item B 显示头部。 =item B

显示不含路径的文件名。 =back 示例: 显示所有 *.txt 文件的信息: dos2unix -i *.txt 只显示DOS断行符和Unix断行符的数量: dos2unix -idu *.txt 只显示BOM状况: dos2unix --info=b *.txt 列出含有DOS断行符的文件: dos2unix -ic *.txt 列出含有Unix断行符的文件: unix2dos -ic *.txt 只转换含有DOS断行符的文件,保持其他文件不变: dos2unix -ic *.txt | xargs dos2unix 查找含有DOS断行符的文本文件: find -name '*.txt' | xargs dos2unix -ic =item B<-k, --keepdate> 将输入文件的时间戳应用到输出文件。 =item B<-L, --license> 显示程序许可证。 =item B<-l, --newline> 添加额外的新行。 B:只有DOS断行符会被转换为两个Unix断行符。在Mac模式下,只有Mac断行符会被转换为Unix断行符。 B:只有Unix断行符会被转换为两个DOS断行符。在Mac模式下,Unix断行符会被转换为两个Mac断行符。 =item B<-m, --add-bom> 将字节序标记(BOM)写入到输出文件。默认情况下将写入UTF-8 BOM。 当输入文件为UTF-16格式,并且使用了 C<-u>选项,将写入UTF-16 BOM。 当输出文件不是UTF-8、UTF-16或GB18030格式时,请不要使用此选项。参加 UNICODE 一节。 =item B<-n, --newline 输入文件 输出文件 ...> 新文件模式。转换输入文件并写入到输出文件。文件名必须成对给出,并且 I<不能> 使用通配符,否则你 I<将会>丢失文件。 使用新文件(配对)模式转换时,命令执行者必须为文件的所有者。新文件的读/写权限将由源文件的权限减去命令执行者的 umask(1) 得到。 =item B<-o, --oldfile 文件 ...> 旧文件模式。转换并将输出覆盖到源文件。程序默认使用此模式,允许使用通配符。 在旧文件(替换)模式下,被转换的文件的所有者、组和读/写权限保持不变。当文件被其他具有写权限的用户(如root)转换时,情况也是如此。如果无法保持这些值不变,转换将会终止。改变源文件的所有者可能造成其无法读取该文件,而改变组则可能带来安全隐患,使文件被不法分子读取。只有Unix才支持转换时保留所有者、组和读/写权限。 =item B<-q, --quiet> 安静模式。不显示任何警告或信息。返回值为0,除非命令行选项有误。 =item B<-r, --remove-bom> 移除字节序标记(BOM),不写入BOM到输出文件。这是转换到Unix断行符时的默认行为。参见选项 C<-b>。 =item B<-s, --safe> 跳过二进制文件(默认)。 跳过二进制文件是为了避免可能的错误。请注意,对二进制文件的探测并不能做到100%准确。程序通过扫描二进制文件所特有的标记来将其与文本文件区分开来,但有的二进制文件可能只包含普通的文本字符,这样的文件就会被误判为文本文件。 =item B<-u, --keep-utf16> 保留输入文件的UTF-16编码。输出文件也使用UTF-16编码和相同的尾序。这将阻止转换到UTF-8。相应也会写入UTF-16 BOM。可以用 C<-ascii>选项来禁止。 =item B<-ul, --assume-utf16le> 假定输入文件格式为UTF-16LE。 输入文件中有BOM时,将会覆盖此选项。 如果你做了错误的假设(输入文件不为UTF-16LE格式),并且转换成功,你将会得到一个错误的UTF-8格式的文件。你可以用 iconv(1) 来撤销转换,将其从UTF-8转换回UTF-16LE。这样做可以恢复源文件。 对UTF-16LE的假定将根据 l<转换模式> 来工作。若改变了默认的 l 模式,则这一假定将会被关闭。 =item B<-ub, --assume-utf16be> 假定输入文件格式为UTF-16BE。 这一选项与 C<-ul> 类似。 =item B<-v, --verbose> 显示更多信息。将会显示有关BOM和转换统计的额外信息。 =item B<-F, --follow-symlink> 追踪符号链接并转换其目标。 =item B<-R, --replace-symlink> 将符号链接的目标替换为转换后的文件(原来的目标文件保持不变)。 =item B<-S, --skip-symlink> 保持符号链接和其目标文件不变(默认)。 =item B<-V, --version> 显示版本信息,然后退出。 =back =head1 Mac模式 普通模式下,断行符将被转换为DOS格式,或相反。Mac格式的断行符将不会被转换。 Mac模式下,Mac断行符将被转换为Unix格式,或相反。DOS断行符将不会被转换。 若要以Mac模式运行,请使用命令行选项 C<-c mac>,或使用命令 C 或 C。 =head1 转换模式 =over 4 =item B 在 C 模式下,只转换断行符。 这是默认的转换模式。 尽管此模式名叫“ASCII”(7位编码标准),实际上转换按照8位编码进行。转换UTF-8编码文件时请务必使用此模式。 =item B<7bit> 在此模式下,所以的8位非ASCII字符(取值范围128-255)将被转换到7位编码空间。 =item B Unix下,将在DOS字符集(编码页)和ISO字符集 ISO-8859-1(Latin-1)之间进行转换。不具有 ISO-8859-1 中对等字符的DOS字符将会被转换为点号(“.”)。当 ISO-8859-1 字符集中没有DOS中的对等字符时也是如此。 当只指定了 C<-iso> 选项时,dos2unix将尝试确定当前活动代码页。若无法确定,则使用默认代码页 CP437(普遍用于美国)。若要强制指定代码页,请使用选项 C<-437>(美国)、C<-850>(西欧)、C<-860>(葡萄牙)、C<-863>(法国、加拿大)或C<-865>(北欧)。 Windows CP1252代码页(西欧)也可以通过选项 C<-1252> 获得支持。若要使用其他代码页,可以结合 iconv(1) 使用dos2unix。iconv可以在很多字符编码间进行转换。 不对Unicode编码文本使用ISO转换。因这一转换会导致UTF-8编码文件损坏。 一些示例: 从DOS默认编码页转换到Unix Latin-1: dos2unix -iso -n in.txt out.txt 从DOS CP850转换到Unix Latin-1: dos2unix -850 -n in.txt out.txt 从Windows CP1252转换到Unix Latin-1: dos2unix -1252 -n in.txt out.txt 从WIndows CP1252转换到Unix UTF-8(Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt 从Unix Latin-1转换到DOS默认编码页: unix2dos -iso -n in.txt out.txt 从Unix Latin-1转换到DOS CP850: unix2dos -850 -n in.txt out.txt 从Unix Latin-1转换到Windows CP1252: unix2dos -1252 -n in.txt out.txt 从Unix UTF-8(Unicode)转换到Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt 参见 L et L。 =back =head1 UNICODE =head2 编码 有几种不同的Unicode编码。对于Unix和Linux中的Unicode文件,通常为UTF-8编码。Windows中的文本文件可以是UTF-8、UTF-16或UTF-16BE编码,但大多采用UTF-16格式。 =head2 转换 Unicode文本文件可以含有DOS、Unix或Mac断行符,就像普通文本文件一样。 所有版本的dos2unix和unix2dos都可以转换UTF-8文件,因为UTF-8向后兼容ASCII。 含有Unicode UTF-16支持的dos2unix和unix2dos可以读取小尾序或大尾序的UTF-16编码文本。输入 C 来确定dos2unix在编译是是否启用了UTF-16支持。 在Unix/Linux中,UTF-16编码文件将被转换为区域字符编码所指定的编码。可以使用 locale(1) 命令来查看当前的区域字符编码。若无法转换,程序将报告转换错误并跳过此文件。 在Windows中,UTF-16文件被默认转换为UTF-8格式。Windows和Unix/Linux均支持UTF-8格式的文本文件。 UTF-16和UTF-8编码相互兼容,所以彼此转换时不会丢失文本。倘若转换中出错,比如UTF-16格式的输入文件含有错误,那么该文件将被跳过。 若使用了 C<-u> 选项,输出文件将会使用和输入文件相同的UTF-16编码。C<-u>选项将阻止程序转换到UTF-8。 dos2unix和unix2dos没有用于转换UTF-8到UTF-16的选项。 ISO和7位编码模式的转换无法用于UTF-16文件。 =head2 字节序标记 在Windows中,文本文件一般含有字节序标记(BOM),因为很多Windows程序(包括记事本)默认添加BOM。参见 L。 在Unix中,Unicode文件一般不含BOM。假定文本文件使用区域字符编码设置所指定的编码。 dos2unix只能检测含有BOM文件的UTF-16格式。若UTF-16文件不含BOM,dos2unix会将其视作二进制文件。 请使用选项 C<-ul> 或 C<-ub> 来转换不含BOM的UTF-16文件。 dos2unix默认不输出BOM。使用 C<-b> 选项可以让dos2unix将BOM添加到输出文件,如果输入文件也含有BOM的话。 unix2dos默认输出BOM,如果输入文件也含有BOM的话。使用 C<-r> 可以移除BOM。 若使用了 C<-m> 选项,dos2unix和unix2dos将总是输出BOM。 =head2 Windows中Unicode文件的文件名 dos2unix对于Windows命令提示符中读取和写入Unicode文件名有额外的支持。这意味着dos2unix可以打开那些包含非默认系统ANSI编码页字符的文件。若要查看Windows版dos2unix在编译时是否加入了Unicode文件名支持,请输入 C。 在Windows终端中显示Unicode文件名有一些需要注意的问题。请参见 C<-D> 和 C<--display-enc> 选项。文件名在终端中可能无法被正确显示,但写入文件时文件名仍然是正确的。 =head2 Unicode示例 转换Windows UTF-16到Unix UTF-8: dos2unix -n in.txt out.txt 转换Windows UTF-16LE(不含BOM)到Unix UTF-8: dos2unix -ul -n in.txt out.txt 转换Unix UTF-8到Windows UTF-8(并添加BOM): unix2dos -m -n in.txt out.txt 转换Unix UTF-8到Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt =head1 GB18030 GB18030是中国国家标准。GB18030标准的一系列子集被强制应用于中国销售的软件产品。参见 L。 GB18030与Unicode完全兼容,并且可以被认为是Unicode格式的变体。和UTF-8一样,GB18030也兼容ASCII。GB18030也兼容Windows 936代码页(GBK)。 在Unix/Linux中,若区域编码被设置为GB18030,UTF-16文件将被转换为GB18030格式。注意只有当系统支持区域设置时这一才会进行这一转换。可以使用 C 命令来获取受支持的区域。 在Windows中,你需要使用 C<-gb> 选项来转换UTF-16文件到GB18030编码。 GB18030编码的文件和Unicode文件一样可以含有BOM。 =head1 示例 从标准输入读取,并输出到标准输出: dos2unix < a.txt cat a.txt | dos2unix 转换并覆盖a.txt和b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt 转换并覆盖a.txt,使用ascii模式: dos2unix a.txt 转换并覆盖a.txt,使用ascii模式;转换并覆盖b.txt,使用7位编码模式: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt 将a.txt从Mac格式转换到Unix格式: dos2unix -c mac a.txt mac2unix a.txt 将a.txt从Unix格式转换到Mac格式: unix2dos -c mac a.txt unix2mac a.txt 转换并覆盖a.txt,保留原始时间戳: dos2unix -k a.txt dos2unix -k -o a.txt 转换a.txt,并输出到e.txt: dos2unix -n a.txt e.txt 转换a.txt,并输出到e.txt,同时使e.txt的时间戳和a.txt一致: dos2unix -k -n a.txt e.txt 转换并覆盖a.txt;转换b.txt并输出到e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt 转换c.txt并输出到e.txt;转换并覆盖a.txt和b.txt;转换d.txt并输出到f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt =head1 递归转换 结合 find(1) 和 xargs(1) 使用dos2unix可以递归地转换目录树中的文本文件。例如,转换当前目录的目录树中所有的.txt文件: find . -name '*.txt' |xargs dos2unix 在Windows命令提示符中,可以使用下列命令: for /R %G in (*.txt) do dos2unix "%G" PowerShell用户可以在Windows PowerShell中使用如下命令: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} =head1 区域 =over 4 =item B LANG环境变量指定了程序所使用的首选语言。它包括几个部分:第一部分是小写的语言编码,第二部分是(可选的)大写的国家/地区代码,前面用下划线连接;第三部分也是可选的,即字符编码,前面用点连接。一些POSIX规范的示例如下: export LANG=zh 中文 export LANG=zh_CN 中文,中国 export LANG=zh_TW 中文,台湾 export LANG=es_ES 西班牙语,西班牙 export LANG=es_MX 西班牙语,墨西哥 export LANG=en_US.iso88591 英语,美国,Latin-1编码 export LANG=en_GB.UTF-8 英语,英国,UTF-8编码 完整的语言和国家/地区编码可以在gettext手册中找到:L 在Unix系统中,你可以使用 locale(1) 命令获取特定区域的信息。 =item B 可以使用LANGUAGE变量指定一系列语言的优先级,各项之间由冒号分割。dos2unix首先使用LANGUAGE变量,其次才是LANG。例如,首选中文、其次英文:C。在使用语言优先级之前,必须先启用区域化功能,即将LANG(或LC_ALL)变量设置为除了“C”以外的其他值。参见gettext手册:L 如果你选择了一个不可用的语言,程序将会输出标准的英语信息。 =item B DOS2UNIX_LOCALEDIR环境变量将覆盖编译时设置的LOCALEDIR变量。LOCALEDIR被用于查找语言文件。GNU程序的默认值为 C。可以使用 B<--version> 查看当前的LOCALEDIR。 示例(POSIX shell): export DOS2UNIX_LOCALEDIR=$HOME/share/locale =back =head1 返回值 若成功,返回0。若出现系统错误,则返回最近一次系统错误号。若发生其他错误,返回1。 在安静模式下,返回值总是为0,除非命令行选项有误。 =head1 遵循规范 L L L L =head1 作者 Benjamin Lin - Bernd Johannes Wuebben(mac2unix模式) - ,Christian Wurll(添加额外新行) - ,Erwin Waterlander - (维护者) 项目主页:L SourceForge主页:L =head1 参见 file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/man/zh_CN/man1/dos2unix.txt0000644000175500010010000005557612721132570017515 0ustar waterlanGeen名称 dos2unix - DOS/Mac - Unix文件格式转换器 概要 dos2unix [选项] [文件 …] [-n 输入文件 输出文件 ...] unix2dos [选项] [文件 …] [-n 输入文件 输出文件 ...] 说明 Dos2unix软件包包括工具"dos2unix" 和 "unix2dos",用于将纯文本文件在DOS或Mac格式与Unix格式之间相互转换。 DOS/Windows的文本文件中,断行符是由两个字符共同表示的:回车符(CR)和换行符(LF)。Unix的文本文件中,换行符则由单个换行符(L F)表示。而Mac的文本文件则由单个回车符(CR,用于Mac OS X之前的系统)或单个换行符(LF,用于当下的新Mac OS)表示。 除了断行符,Dos2unix还可以转换文件编码。一些DOS编码页可以被转换为Unix Latin-1,Windows Unicode(UTF-16)文件也可以被转换为Unix Unicode(UTF-8)文件。 二进制文件则会被自动跳过,除非指定了强制转换选项。 特殊文件,如目录和队列,会被自动跳过。 符号链接和其所指向的目标默认不会被转换。可以用选项来指定替换符号链接,或者将输出写入到链接目标。Windows下不支持写入到符号链接的目标。 Dos2unix由SunOS/Solaris下的版本改写而成。这两个版本间有一个重大差异:本版本默认进行原位转换(旧文件模式),而原来SunOS /Solaris下的版本只支持配对转换(新文件模式),参见选项 "-o" 和 "-n"。还有一个区别是SunOS/Solaris下的版本默认使用 *iso* 模式,而本版本默认使用 *ascii* 模式。 选项 -- 将后面所有的选项当作文件名。如果你希望转换一个文件名以破折号开头的文件,可以使用这个选项。例如,要转换一个名为“-foo”的文件,你可以 用这个命令: dos2unix -- -foo 或者在新文件模式中: dos2unix -n -- -foo out.txt -ascii 只转换断行符。这是默认的转换模式。 -iso 在DOS和ISO-8859-1字符集之间转换。参见 CONVERSION MODES 一节。 -1252 使用Windows 1252 编码页(西欧)。 -437 使用DOS 437 编码页(美国)。这是ISO转换时的默认编码页。 -850 使用DOS 850 编码页(西欧)。 -860 使用DOS 860 编码页(葡萄牙)。 -863 使用DOS 863 编码页(加拿大法语)。 -865 使用DOS 865 编码页(北欧)。 -7 将8位字符转换到7位空间。 -b, --keep-bom 保留字节序标记(BOM)。当输入文件含有BOM头时,也向输出文件写入BOM。这是转换到DOS断行符时的默认行为。参见选项 "-r"。 -c, --convmode 转换模式 改变转换模式。转换模式可以为:*ascii*、*7bit*、*iso*或*mac*,默认为ascii。 -D, --display-enc ENCODAGE 设置显示文本的编码。编码可以为:*ansi*、*unicode*、*unicodebom*、*utf8*、*utf8bom*,默认为 ansi。 这一选项只对支持Unicode文件名的Windows版dos2unix有效。它对文件名的读写无效,只影响它们的显示结果。 在Windows控制台中,有几种可以根据文本编码来显示文本的方法。它们各有利弊。 ansi dos2unix默认使用ANSI编码文本。优点是它能提供向后兼容性,并能用于raster和TrueType字体。在一些地方,你可 能需要使用 "chcp" 命令将活动DOS OEM编码页设置为Windows系统ANSI编码页,因为dos2unix使用Windows系统编码页。 ansi的缺点是含有非系统默认编码页中字符的国际化文件名将无法被正确显示。你会看到一些问号或其他错误的字符。如果你不需要处理外文 文件名,这一方法是不错的选择。 unicode,unicodebom Unicode编码(Windows中对UTF-16的称呼)的优点是文本可以被正确显示,也无需改变活动编码页。你可能需要设置终端字 体为TrueType以便正确显示国际化字符。如果TrueType字体中不包含某个字符,你会看到一个小方块,有时方块中还会有一个问 号。 当你使用ConEmu终端时,所以的文本将会被正确显示,因为ConEmu会自动选择合适的字体。 Unicode的缺点在于它与ASCII不兼容。当你将输出重定向到其他程序或文件时,它可能不那么容易控制 当使用 "unicodebom" 方法时,将会在Unicode文本前添加一个BOM(字节序标记)。在PowerShell中,需要根据BOM来进行正确的重定向或管道 输出。 utf8,utf8bom utf8的优点在于它与ASCII兼容。你需要设置终端的字体为TrueType字体。使用TrueType字体可以使得文本得以正确显 示,就像使用 "unicode" 编码时那样。 缺点是当你使用默认的raster字体时,所有的非ASCII字符将无法被正确显示。不仅是unicode文件名,连翻译的消息也无法被 读取。在配置为东亚地区的Windows中,当终端中显示这些消息时你可能会看到闪烁现象。 在ConEmu终端中,utf编码方式可以正常工作。 当使用 "utf8bom" 方法时,将会在Unicode文本前添加一个BOM(字节序标记)。在PowerShell中,需要根据BOM来进行正确的重定向或管道 输出。 默认的编码方式可以通过设置 DOS2UNIX_DISPLAY_ENC 环境变量为 "unicode" 、"unicodebom"、"utf8" 或 "utf8bom" 来改变。 -f, --force 强制转换二进制文件。 -gb, --gb18030 在Windows中,UTF-16默认被转换为UTF-8格式,无论区域设置为何。请使用这一选项将UTF-16文件转换为GB18030格式。 此选项只在Windows下有效。参加 GB18030 一节。 -h, --help 显示帮助,然后退出。 -i[标志], --info[=标志] 文件 … 显示文件信息。不进行转换。 将会显示下列信息(按顺序):DOS断行符的数量、Unix断行符的数量、Mac断行符的数量、是否有BOM、文本/二进制、文件名。 输出示例: 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 2 418 219 no_bom binary dos2unix.exe 注意,二进制文件有时会被误判为文本文件。参见选项 "-s"。 可以为输出设置额外的标志(一个或多个)。 d 显示DOS断行符的数量。 u 显示Unix断行符的数量。 m 显示Mac断行符的数量。 b 显示BOM状况。 t 显示文件为文本或二进制。 c 只显示将会被转换的文件。 若设置了 "c"标志,dos2unix将只显示含有DOS断行符的文件,unix2dos将只显示含有Unix断行符的文件。 h 显示头部。 p 显示不含路径的文件名。 示例: 显示所有 *.txt 文件的信息: dos2unix -i *.txt 只显示DOS断行符和Unix断行符的数量: dos2unix -idu *.txt 只显示BOM状况: dos2unix --info=b *.txt 列出含有DOS断行符的文件: dos2unix -ic *.txt 列出含有Unix断行符的文件: unix2dos -ic *.txt 只转换含有DOS断行符的文件,保持其他文件不变: dos2unix -ic *.txt | xargs dos2unix 查找含有DOS断行符的文本文件: find -name '*.txt' | xargs dos2unix -ic -k, --keepdate 将输入文件的时间戳应用到输出文件。 -L, --license 显示程序许可证。 -l, --newline 添加额外的新行。 dos2unix:只有DOS断行符会被转换为两个Unix断行符。在Mac模式下,只有Mac断行符会被转换为Unix断行符。 unix2dos:只有Unix断行符会被转换为两个DOS断行符。在Mac模式下,Unix断行符会被转换为两个Mac断行符。 -m, --add-bom 将字节序标记(BOM)写入到输出文件。默认情况下将写入UTF-8 BOM。 当输入文件为UTF-16格式,并且使用了 "-u"选项,将写入UTF-16 BOM。 当输出文件不是UTF-8、UTF-16或GB18030格式时,请不要使用此选项。参加 UNICODE 一节。 -n, --newline 输入文件 输出文件 ... 新文件模式。转换输入文件并写入到输出文件。文件名必须成对给出,并且 *不能* 使用通配符,否则你 *将会*丢失文件。 使用新文件(配对)模式转换时,命令执行者必须为文件的所有者。新文件的读/写权限将由源文件的权限减去命令执行者的 umask(1) 得到。 -o, --oldfile 文件 ... 旧文件模式。转换并将输出覆盖到源文件。程序默认使用此模式,允许使用通配符。 在旧文件(替换)模式下,被转换的文件的所有者、组和读/写权限保持不变。当文件被其他具有写权限的用户(如root)转换时,情况也是如此。如 果无法保持这些值不变,转换将会终止。改变源文件的所有者可能造成其无法读取该文件,而改变组则可能带来安全隐患,使文件被不法分子读取。只有U nix才支持转换时保留所有者、组和读/写权限。 -q, --quiet 安静模式。不显示任何警告或信息。返回值为0,除非命令行选项有误。 -r, --remove-bom 移除字节序标记(BOM),不写入BOM到输出文件。这是转换到Unix断行符时的默认行为。参见选项 "-b"。 -s, --safe 跳过二进制文件(默认)。 跳过二进制文件是为了避免可能的错误。请注意,对二进制文件的探测并不能做到100%准确。程序通过扫描二进制文件所特有的标记来将其与文本文件 区分开来,但有的二进制文件可能只包含普通的文本字符,这样的文件就会被误判为文本文件。 -u, --keep-utf16 保留输入文件的UTF-16编码。输出文件也使用UTF-16编码和相同的尾序。这将阻止转换到UTF-8。相应也会写入UTF-16 BOM。可以用 "-ascii"选项来禁止。 -ul, --assume-utf16le 假定输入文件格式为UTF-16LE。 输入文件中有BOM时,将会覆盖此选项。 如果你做了错误的假设(输入文件不为UTF-16LE格式),并且转换成功,你将会得到一个错误的UTF-8格式的文件。你可以用 iconv(1) 来撤销转换,将其从UTF-8转换回UTF-16LE。这样做可以恢复源文件。 对UTF-16LE的假定将根据 l<转换模式> 来工作。若改变了默认的 l 模式,则这一假定将会被关闭。 -ub, --assume-utf16be 假定输入文件格式为UTF-16BE。 这一选项与 "-ul" 类似。 -v, --verbose 显示更多信息。将会显示有关BOM和转换统计的额外信息。 -F, --follow-symlink 追踪符号链接并转换其目标。 -R, --replace-symlink 将符号链接的目标替换为转换后的文件(原来的目标文件保持不变)。 -S, --skip-symlink 保持符号链接和其目标文件不变(默认)。 -V, --version 显示版本信息,然后退出。 Mac模式 普通模式下,断行符将被转换为DOS格式,或相反。Mac格式的断行符将不会被转换。 Mac模式下,Mac断行符将被转换为Unix格式,或相反。DOS断行符将不会被转换。 若要以Mac模式运行,请使用命令行选项 "-c mac",或使用命令 "mac2unix" 或 "unix2mac"。 转换模式 ascii 在 "ascii" 模式下,只转换断行符。 这是默认的转换模式。 尽管此模式名叫“ASCII”(7位编码标准),实际上转换按照8位编码进行。转换UTF-8编码文件时请务必使用此模式。 7bit 在此模式下,所以的8位非ASCII字符(取值范围128-255)将被转换到7位编码空间。 iso Unix下,将在DOS字符集(编码页)和ISO字符集 ISO-8859-1(Latin-1)之间进行转换。不具有 ISO-8859-1 中对等字符的DOS字符将会被转换为点号(“.”)。当 ISO-8859-1 字符集中没有DOS中的对等字符时也是如此。 当只指定了 "-iso" 选项时,dos2unix将尝试确定当前活动代码页。若无法确定,则使用默认代码页 CP437(普遍用于美国)。若要强制指定代码页,请使用选项 -437(美国)、-850(西欧)、-860(葡萄牙)、-863(法国、加拿大)或-865(北欧)。 Windows CP1252代码页(西欧)也可以通过选项 -1252 获得支持。若要使用其他代码页,可以结合 iconv(1) 使用dos2unix。iconv可以在很多字符编码间进行转换。 不对Unicode编码文本使用ISO转换。因这一转换会导致UTF-8编码文件损坏。 一些示例: 从DOS默认编码页转换到Unix Latin-1: dos2unix -iso -n in.txt out.txt 从DOS CP850转换到Unix Latin-1: dos2unix -850 -n in.txt out.txt 从Windows CP1252转换到Unix Latin-1: dos2unix -1252 -n in.txt out.txt 从WIndows CP1252转换到Unix UTF-8(Unicode): iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt 从Unix Latin-1转换到DOS默认编码页: unix2dos -iso -n in.txt out.txt 从Unix Latin-1转换到DOS CP850: unix2dos -850 -n in.txt out.txt 从Unix Latin-1转换到Windows CP1252: unix2dos -1252 -n in.txt out.txt 从Unix UTF-8(Unicode)转换到Windows CP1252: unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt 参见 et 。 UNICODE 编码 有几种不同的Unicode编码。对于Unix和Linux中的Unicode文件,通常为UTF-8编码。Windows中的文本文件可以是UTF-8 、UTF-16或UTF-16BE编码,但大多采用UTF-16格式。 转换 Unicode文本文件可以含有DOS、Unix或Mac断行符,就像普通文本文件一样。 所有版本的dos2unix和unix2dos都可以转换UTF-8文件,因为UTF-8向后兼容ASCII。 含有Unicode UTF-16支持的dos2unix和unix2dos可以读取小尾序或大尾序的UTF-16编码文本。输入 "dos2unix -V" 来确定dos2unix在编译是是否启用了UTF-16支持。 在Unix/Linux中,UTF-16编码文件将被转换为区域字符编码所指定的编码。可以使用 locale(1) 命令来查看当前的区域字符编码。若无法转换,程序将报告转换错误并跳过此文件。 在Windows中,UTF-16文件被默认转换为UTF-8格式。Windows和Unix/Linux均支持UTF-8格式的文本文件。 UTF-16和UTF-8编码相互兼容,所以彼此转换时不会丢失文本。倘若转换中出错,比如UTF-16格式的输入文件含有错误,那么该文件将被跳过。 若使用了 "-u" 选项,输出文件将会使用和输入文件相同的UTF-16编码。"-u"选项将阻止程序转换到UTF-8。 dos2unix和unix2dos没有用于转换UTF-8到UTF-16的选项。 ISO和7位编码模式的转换无法用于UTF-16文件。 字节序标记 在Windows中,文本文件一般含有字节序标记(BOM),因为很多Windows程序(包括记事本)默认添加BOM。参见 。 在Unix中,Unicode文件一般不含BOM。假定文本文件使用区域字符编码设置所指定的编码。 dos2unix只能检测含有BOM文件的UTF-16格式。若UTF-16文件不含BOM,dos2unix会将其视作二进制文件。 请使用选项 "-ul" 或 "-ub" 来转换不含BOM的UTF-16文件。 dos2unix默认不输出BOM。使用 "-b" 选项可以让dos2unix将BOM添加到输出文件,如果输入文件也含有BOM的话。 unix2dos默认输出BOM,如果输入文件也含有BOM的话。使用 "-r" 可以移除BOM。 若使用了 "-m" 选项,dos2unix和unix2dos将总是输出BOM。 Windows中Unicode文件的文件名 dos2unix对于Windows命令提示符中读取和写入Unicode文件名有额外的支持。这意味着dos2unix可以打开那些包含非默认系统AN SI编码页字符的文件。若要查看Windows版dos2unix在编译时是否加入了Unicode文件名支持,请输入 "dos2unix -V"。 在Windows终端中显示Unicode文件名有一些需要注意的问题。请参见 "-D" 和 "--display-enc" 选项。文件名在终端中可能无法被正确显示,但写入文件时文件名仍然是正确的。 Unicode示例 转换Windows UTF-16到Unix UTF-8: dos2unix -n in.txt out.txt 转换Windows UTF-16LE(不含BOM)到Unix UTF-8: dos2unix -ul -n in.txt out.txt 转换Unix UTF-8到Windows UTF-8(并添加BOM): unix2dos -m -n in.txt out.txt 转换Unix UTF-8到Windows UTF-16: unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt GB18030 GB18030是中国国家标准。GB18030标准的一系列子集被强制应用于中国销售的软件产品。参见 。 GB18030与Unicode完全兼容,并且可以被认为是Unicode格式的变体。和UTF-8一样,GB18030也兼容ASCII。GB1803 0也兼容Windows 936代码页(GBK)。 在Unix/Linux中,若区域编码被设置为GB18030,UTF-16文件将被转换为GB18030格式。注意只有当系统支持区域设置时这一才会进 行这一转换。可以使用 "locale -a" 命令来获取受支持的区域。 在Windows中,你需要使用 "-gb" 选项来转换UTF-16文件到GB18030编码。 GB18030编码的文件和Unicode文件一样可以含有BOM。 示例 从标准输入读取,并输出到标准输出: dos2unix < a.txt cat a.txt | dos2unix 转换并覆盖a.txt和b.txt: dos2unix a.txt b.txt dos2unix -o a.txt b.txt 转换并覆盖a.txt,使用ascii模式: dos2unix a.txt 转换并覆盖a.txt,使用ascii模式;转换并覆盖b.txt,使用7位编码模式: dos2unix a.txt -c 7bit b.txt dos2unix -c ascii a.txt -c 7bit b.txt dos2unix -ascii a.txt -7 b.txt 将a.txt从Mac格式转换到Unix格式: dos2unix -c mac a.txt mac2unix a.txt 将a.txt从Unix格式转换到Mac格式: unix2dos -c mac a.txt unix2mac a.txt 转换并覆盖a.txt,保留原始时间戳: dos2unix -k a.txt dos2unix -k -o a.txt 转换a.txt,并输出到e.txt: dos2unix -n a.txt e.txt 转换a.txt,并输出到e.txt,同时使e.txt的时间戳和a.txt一致: dos2unix -k -n a.txt e.txt 转换并覆盖a.txt;转换b.txt并输出到e.txt: dos2unix a.txt -n b.txt e.txt dos2unix -o a.txt -n b.txt e.txt 转换c.txt并输出到e.txt;转换并覆盖a.txt和b.txt;转换d.txt并输出到f.txt: dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt 递归转换 结合 find(1) 和 xargs(1) 使用dos2unix可以递归地转换目录树中的文本文件。例如,转换当前目录的目录树中所有的.txt文件: find . -name '*.txt' |xargs dos2unix 在Windows命令提示符中,可以使用下列命令: for /R %G in (*.txt) do dos2unix "%G" PowerShell用户可以在Windows PowerShell中使用如下命令: get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname} 区域 LANG LANG环境变量指定了程序所使用的首选语言。它包括几个部分:第一部分是小写的语言编码,第二部分是(可选的)大写的国家/地区代码,前面用下 划线连接;第三部分也是可选的,即字符编码,前面用点连接。一些POSIX规范的示例如下: export LANG=zh 中文 export LANG=zh_CN 中文,中国 export LANG=zh_TW 中文,台湾 export LANG=es_ES 西班牙语,西班牙 export LANG=es_MX 西班牙语,墨西哥 export LANG=en_US.iso88591 英语,美国,Latin-1编码 export LANG=en_GB.UTF-8 英语,英国,UTF-8编码 完整的语言和国家/地区编码可以在gettext手册中找到: 在Unix系统中,你可以使用 locale(1) 命令获取特定区域的信息。 LANGUAGE 可以使用LANGUAGE变量指定一系列语言的优先级,各项之间由冒号分割。dos2unix首先使用LANGUAGE变量,其次才是LANG。 例如,首选中文、其次英文:"LANGUAGE= 如果你选择了一个不可用的语言,程序将会输出标准的英语信息。 DOS2UNIX_LOCALEDIR DOS2UNIX_LOCALEDIR环境变量将覆盖编译时设置的LOCALEDIR变量。LOCALEDIR被用于查找语言文件。GNU程序的 默认值为 "/usr/local/share/locale"。可以使用 --version 查看当前的LOCALEDIR。 示例(POSIX shell): export DOS2UNIX_LOCALEDIR=$HOME/share/locale 返回值 若成功,返回0。若出现系统错误,则返回最近一次系统错误号。若发生其他错误,返回1。 在安静模式下,返回值总是为0,除非命令行选项有误。 遵循规范 作者 Benjamin Lin - Bernd Johannes Wuebben(mac2unix模式) - ,Christian Wurll(添加额外新行) - ,Erwin Waterlander - (维护者) 项目主页: SourceForge主页: 参见 file(1) find(1) iconv(1) locale(1) xargs(1) dos2unix-7.3.4/NEWS.txt0000644000175500010010000002047512721132543014074 0ustar waterlanGeen2016-05-24: Version 7.3.4 * Safer temporary file creation on Windows. * Code cleanup. * Updated translations. 2016-02-13: Version 7.3.3 * Fixed printing of East-Asian text on Windows with an East-Asian regional setting. * Fixed printing text in unicode UTF-16 mode on Windows, so that when it is redirected to a file, a correct UTF-16 file is created. * New flags h (print header) and p (show file names without path) for option -i, --info 2015-11-20: Version 7.3.2 * New: Swedish translation of messages and manual. * Updated: Danish and Brazilian Portuguese translations. * Fix: The -iso option was misinterpreted as a corrupted -i option. * Fix: Compilation for MSYS 1. 2015-09-30: Version 7.3.1 * New: Simplified Chinese translation of messages and manual. * Fix: Compilation error "'wchar_t' undeclared" when Unicode support is disabled. * Fix: Compilation errors when MinGW compiler was used (MinGW-w64 was OK). 2015-08-24: Version 7.3 * New: Unicode file name support on Windows. * Fix: Options -ul and -ub caused option -i to report wrong BOM for no_bom. 2015-07-01: Version 7.2.3 * Fix: Check for file I/O errors while reading input files, and added a few missing checks while writing output files. * Fix: Compilation for msys. 2015-05-22: Version 7.2.2 * Fix: Fixed symlink support on FreeBSD. * Fix: Skip GB18030 test on FreeBSD. * Fix: When conversion of an UTF-16 file with binary symbols was forced, null characters were not written in the output. * Fix: Check UTF-16 input for invalid surrogate pairs. 2015-04-01: Version 7.2.1 * Fix: Skip the GB18030 tests when the system does not support the Chinese locale with GB18030 character encoding. * Fix: Small corrections in the manual in section GB18030 and OPTIONS -m. 2015-02-11: Version 7.2 * New: Japanese translation of the UI messages. * New: Support Chinese GB18030 locale. * Change: On Unix/Linux convert UTF-16 to the locale encoding. It is no longer required that the locale encoding is UTF-8. 2014-10-06: Version 7.1 * New: Option -i, --info to print file information. This new option prints number of DOS, Unix, and Mac line breaks, the byte order mark, and if the file is text or binary. And it can print the names of files that would be converted. 2014-09-09: Version 7.0 * New: automated self-tests. * New: option -u to keep UTF-16 encoding. * New: option -v to print information about BOMs and converted line breaks. * Change: stdio mode does not automatically set quiet mode. * Change: stdio mode does not automatically force conversion of binaries. An error is returned when the stdin stream contains a binary symbol. * Bugfix: dos2unix -l created DOS line breaks from Mac line breaks. * Bugfix: system error number was not always returned. * Bugfix: an Unicode input file disabled 7bit and iso mode for next input files. * Bugfix: mac2unix help text, options -b and -r. * The code has been cleaned up. 2014-08-03: Version 6.0.6 * Bugfix: mac2unix conversion produced corrupted output from UTF-16 input file. * New options -b (keep BOM) and -r (remove BOM). * New translation of the UI messages: Norwegian Bokmaal. 2014-04-17: Version 6.0.5 * Dos2unix is part of the Translation Project (TP). All translations go via the Translation Project. See http://translationproject.org/ * New translations of UI messages: Brazilian Portuguese, Chinese (traditional), Danish, French, Hungarian, Polish, Serbian, Ukrainian, Vietnamese. * New translations of the manual: Brazilian Portuguese, French, German, Polish, Ukrainian. * Generated man pages are included in the source package to prevent compilation problems with very old or very new perl/pod2man versions. * Manuals are now generated from gettext PO files with po4a for easier translation. * All manuals are now in UTF-8 encoding. * Skip symbolic links on Windows by default (same as on Unix). 2013-12-30: Version 6.0.4 * New options -ul and -ub to convert UTF-16 files without BOM. * New Russian translation of the messages. * Build 32 bit Windows binaries with Large File Support (LFS) by using mingw-w64 for 32 bit Windows. * When a binary symbol is encountered the value is printed. 2013-01-25: Version 6.0.3 * Source code compiles with Microsoft Visual C. * Print system error when writing output fails. 2012-09-06: Version 6.0.2 * The locale encoding detection has been fixed when NLS was disabled. * Print line number when a binary symbol is found. * Updated makefiles for Watcom C, and added a new one for OS/2. 2012-07-25: Version 6.0.1 * Update Spanish translations. * Update manual. 2012-05-06: Version 6.0 * Conversion of Windows UTF-16 files to Unix UTF-8 files. * Conversion of Unix UTF-8 files to Windows UTF-8 files with byte order mark. 2012-03-10: Version 5.3.3 * Enabled wildcard expansion for all versions. * Fixed a compilation error when debug was enabled. 2012-01-27: Version 5.3.2 * New homepage URL: http://waterlan.home.xs4all.nl/dos2unix.html * Compiles for native MSYS. * Compile with OpenWatcom for DOS32 and Win32. * Detect code page on OS/2. * Support wild cards on OS/2. 2011-08-09: Version 5.3.1 * Spanish translation of messages and manual. * File ownership is maintained in old file mode (Unix only). * Dos2unix and Unix2dos share the same language files. * Code cleanup. 2011-04-26: Version 5.3 * Improved handling of symbolic links. New options -F, -R, -S. * Improved handling and reporting of errors. * Source code improvements for Cygwin. Behave exactly as on Linux. * New option --. Treat all following options as file names. 2011-03-04: Version 5.2.1 * PDF and PostScript generation is optional. No default dependency on GhostScript and Groff. * Enable optional Large File Support (LFS). * Esperanto x-notation is optional. No longer installation of non-standard locale 'eo-x'. * Improved error messages. 2011-01-31: Version 5.2 * ISO conversion mode supports same DOS code pages as SunOS dos2unix does: CP437 (US), CP850 (Western European), CP860 (Portuguese), CP863 (French Canadian), and CP865 (Nordic). * ISO conversion mode supports Windows code page CP1252 (Western). * SunOS compatible options -ascii, -iso, -7, -437, -850, -860, -863, and -865. * Active code page detection for ISO mode. * Fixed ISO conversion of non-breaking space (NBSP). * ISO and 7bit mode can be used in Mac mode. * Treat ASCII Form Feed control characters as valid text. * Update manual pages. * Don't include generated documentation files in Unix source package. * Create a source package in DOS text format. 2010-08-18: Version 5.1.1 * Added Dutch translation of the manual. * Win64 port. * Win32 binary package uses patched MinGW's libintl, with builtin * relocation support. * Support compilation in DOSBox (8.3 file names where needed). * Fixed compilation on Darwin OS. 2010-04-03: Version 5.1 * Esperanto translations have been added. * Ports to 16 bit DOS have been made. * Command-line options can be set in stdio mode. * Bugfix dos2unix MAC mode: Don't change DOS line endings. * Create stubs for DOS32 versions of mac2unix and unix2mac. * Localization information has been added to the manual. * Man pages have been merged. * Man page generation from Perl POD file. 2010-02-16: Version 5.0 * Dos2unix and Unix2dos have been bundled in a single package. * German translations have been added. * Dos2unix -l --newline also works in MAC mode. * Unix2dos also got option -l, --newline. * Added MAC mode to Unix2dos: Convert Unix line endings to Mac line endings. * Cleanup of messages and manual. 2010-01-24: Version 4.1.2 * Preserves file modes in new file mode. 2010-01-21: Version 4.1.1 * Fixes a compilation problem on FreeBSD. 2009-12-28: Version 4.1 Automatically skips binary and non-regular files, and the ISO mode has been cleaned up (see ChangeLog). 2009-12-21: Version 4.0.1 Adds a port to OS/2 Warp. Two wrong conversions in ISO mode have been fixed. The manual page has been updated. 2009-12-15: Version 4.0 Adds internationalisation (Native Language Support, NLS). A Dutch translation has been added. Ports to Windows and DOS have been made. The problem in DOS/Windows stdio mode has been fixed. The manual has been updated. dos2unix-7.3.4/po/0000755000175500010010000000000012721132543013165 5ustar waterlanGeendos2unix-7.3.4/po/da.po0000644000175500010010000005214512721132612014115 0ustar waterlanGeen# Danish translation dos2unix. # Copyright (C) 2016 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # Thomas Pryds , 2014. # Joe Hansen , 2015, 2016. # msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-15 12:07+0100\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish \n" "Language: da\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Ophavsret © 2009-%d Erwin Waterlander\n" "Ophavsret © 1998 Christian Wurll (Version 3.1)\n" "Ophavsret © 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Ophavsret © 1994-1995 Benjamin Lin\n" "Alle rettigheder forbeholdes.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Binært symbol 0x00%02X fundet på linje %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "programfejl, ugyldig omdannelsestilstand %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Konverterede %u ud af %u linjeskift.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "bruger tegnkodningstabel %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Binært symbol 0x%02X fundet på linje %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "fejl: Værdien af miljøvariabel DOS2UNIX_LOCALEDIR er for lang.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Ophavsret © 2009-%d Erwin Waterlander\n" "Ophavsret © 1994-1995 Benjamin Lin\n" "Alle rettigheder forbeholdes.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Redistribuering og brug i kilde- og binær form, med eller uden\n" "modificering, er tilladt, givet at de følgende betingelser\n" "er opfyldt:\n" "1. Redistribuering af kildekode skal bibeholde ovenstående notits\n" " om ophavsret, denne liste over betingelser og den følgende\n" " ansvarsfraskrivelse.\n" "2. Redistribuering i binær form skal indeholde ovenstående notits\n" " om ophavsret i dokumentationen og/eller andre materialer, der\n" " stilles til rådighed med distribueringen.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "DENNE SOFTWARE LEVERES AF FORFATTEREN SOM DEN ER; ALLE UDTRYKTE ELLER\n" "ANTYDEDE GARANTIER, INKLUSIVE, MEN IKKE BEGRÆNSET TIL, DE UNDERFORSTÅEDE\n" "GARANTIER OMKRING SALGBARHED ELLER EGNETHED TIL ET BESTEMT FORMÅL, ER\n" "ANSVARSFRASKREVET. UNDER INGEN OMSTÆNDIGHEDER SKAL FORFATTEREN BLIVE\n" "HOLDT ANSVARLIG FOR DIREKTE, INDIREKTE, HÆNDELIGE, SPECIELLE,\n" "EKSEMPLARISKE ELLER FØLGESKADER (HERUNDER, MEN IKKE BEGRÆNSET TIL, KRAV\n" "OM UDSKIFTNING AF VARER ELLER TJENESTER; TAB AF FUNKTIONALITET, DATA\n" "ELLER FORTJENESTE; ELLER FORRETNINGSAFBRYDELSE) SKABT ELLER ANDET\n" "TEORETISK ERSTATNINGSANSVAR, BÅDE I KONTRAKT, RENT ANSVAR ELLER TORT\n" "(GÆLDER SELV VED IGNORERING ELLER ANDET) SOM KOMMER UD AF BRUGEN AF\n" "DENNE SOFTWARE, SELVOM INFORMATION ER GIVET, AT DET VIL MEDFØRE SKADE.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Brug: %s [tilvalg] [fil …] [-n indfil udfil …]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii omdan kun linjeskift (standard)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso omdannelse mellem DOS- og ISO-8859-1-tegnsæt\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 brug Windows-tegnkodningstabel 1252 (Vesteuropa)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 brug DOS-tegnkodningstabel 437 (US) (standard)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 brug DOS-tegnkodningstabel 850 (Vesteuropa)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 brug DOS-tegnkodningstabel 860 (portugisisk)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 brug DOS-tegnkodningstabel 863 (fransk-canadisk)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 brug DOS-tegnkodningstabel 865 (nordisk)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 omdan 8-bit-tegn til 7-bit-plads\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom behold byte-rækkefølge-markering (BOM)\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom behold byte-rækkefølge-markering (standard)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode omdannelsestilstand\n" " convmode ascii, 7bit, iso, mac, standard er ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc angiv kodning for viste tekstbeskeder\n" " kodning ansi, unicode, utf8, standarden er ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force gennemtving omdannelse af binære filer\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 konverter UTF-16 til GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help vis denne hjælpetekst\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=FLAG] vis filinformation\n" " fil … filer at analysere\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate behold outputfils dato\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license vis softwarelicens\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline tilføj ekstra linjeskift\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom tilføj byte-rækkefølge-markering (standard UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile skriv til ny fil\n" " infile originalfil i ny-fil-tilstand\n" " outfile outputfil i ny-fil-tilstand\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile skriv til gammel fil (standard)\n" " file … filter til omdannelse i gammel-fil-tilstand\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet stilletilstand, tilbagehold alle advarsler\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom fjern byte-rækkefølge-markering (standard)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom fjern byte-rækkefølge-markering\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe spring binære filer over (standard)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 behold UTF-16-kodning\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le antag at inputformatet er UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be antag at inputformatet er UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose uddybende operation\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink følg symbolske henvisninger og omdan deres mål\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink erstat symbolske henvisninger med omdannede filer\n" " (oprindelige målfiler forbliver uændrede)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink behold symbolske henvisninger og deres mål uændrede (standard)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version vis versionsnummer\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16-bit-version (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16-bit-version (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32-bit-version (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32-bit-version (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "MSYS-version.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Cygwin-version.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64-bit-version (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32-bit-version (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32-bit-version (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32-bit-version (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64-bit-version (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32-bit-version (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2-version (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "OS/2-version (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "%s-version.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Med Unicode UTF-16-understøttelse.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Uden Unicode UTF-16-understøttelse.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Med Unicode filnavnsunderstøttelse.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Uden Unicode filnavnsunderstøttelse.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Med understøttelse for lokale sprog.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "Sti til midlertidig uddatafil er for lang:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Skriver %s BOM.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Inddatafilen %s har %s BOM.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Antager UTF-16LE-kodning.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Antager UTF-16BE-kodning.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Åbning af midlertidig outputfil mislykkedes: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "bruger %s som midlertidig fil\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Kunne ikke lukke inddatafil %s:" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Skrivning til midlertidig outputfil %s mislykkedes:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Ændring af tilladelser for midlertidig outputfil %s mislykkedes:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Ændring af ejer og gruppe for midlertidig outputfil %s mislykkedes:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "problemer med at følge symbolsk henvisning \"%s\"\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " outputfil forbliver i \"%s\"\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "der opstod problemer under omdøbning af »%s« til »%s«:" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " som er målet for symbolsk henvisning \"%s\"\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Springer binær fil %s over\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "tegnkodningstabel %d understøttes ikke.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Springer UTF-16-filen %s over. Størrelsen på wchar_t er %d byte.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Springer UTF-16-filen %s over. Der opstod en UTF-16-konverteringsfejl på linje %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Springer UTF-16-filen %s over. UTF-16-konvertering er ikke understøttet i denne version af %s.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Springer %s over, ikke en almindelig fil.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Springer %s over. Outputfil %s er en symbolsk henvisning.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Springer symbolsk henvisning %s over. Målet er ikke en almindelig fil.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Springer %s over. Målet for symbolsk henvisning %s er ikke en almindelig fil.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "omdanner fil %s til fil %s i Unix-format …\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "omdanner fil %s til fil %s i Mac-format …\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "omdanner fil %s til fil %s i DOS-format …\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "omdanner %s-filen %s til %s-filen %s i Unix-format …\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "omdanner %s-filen %s til %s-filen %s i Mac-format …\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "omdanner %s-filen %s til %s-filen %s i DOS-format …\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "problemer under omdannelse af fil %s til fil %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Springer symbolsk henvisning %s over.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "omdanner fil %s til Unix-format …\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "omdanner fil %s til Mac-format …\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "omdanner fil %s til DOS-format …\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "omdanner %s-filen %s til %s-Unix-format …\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "omdanner %s-filen %s til %s-Mac-format …\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "omdanner %s-filen %s til %s-DOS-format …\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "problemer under omdannelse af fil %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "kan ikke læse fra inputfilen %s:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "forkert flag »%c« for tilvalget -i eller --info\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "aktuel tegnkodningstabel: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "ugyldig %s omdannelsestilstand specificeret\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "tilvalg \"%s\" kræver et argument\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "ugyldig %s visningstilstand specificeret\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "mål for fil %s er ikke angivet i ny-fil-tilstand\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "kan ikke læse fra inputfil: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "kan ikke skrive til outputfil: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "fejl: Ugyldigt surrogatpar. Mangler lav surrogat.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "fejl: Ugyldigt surrogatpar. Mangler høj surrogat.\n" dos2unix-7.3.4/po/de.po0000644000175500010010000005515712721132611014126 0ustar waterlanGeen# German messages for dos2unix. # This file is distributed under the same license as the dos2unix package. # Philipp Thomas , 2009, 2010, 2011, 2012. # Lars Wendler , 2013. # Mario Blättermann , 2014, 2015. # Philipp Thomas , 2014, 2015, 2016. msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-17 07:50+0200\n" "Last-Translator: Philipp Thomas \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.5\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright © 2009-%d Erwin Waterlander\n" "Copyright © 1998 Christian Wurll (Version 3.1)\n" "Copyright © 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright © 1994,1995 Benjamin Lin\n" "Alle Rechte vorbehalten.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Das binäre Symbol 0x00%02X wurde in Zeile %u gefunden\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "Programmfehler, der Umwandlungsmodus %d ist unzulässig\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Es wurden %u von %u Zeilenumbrüchen umgewandelt.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "Codepage %d wird verwendet.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Das binäres Symbol 0x%02X wurde in Zeile %u gefunden\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "Fehler: Der Inhalt der Umgebungsvariablen DOS2UNIX_LOCALEDIR ist zu lang.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright © 2009-%d Erwin Waterlander\n" "Copyright © 1994,1995 Benjamin Lin\n" "Alle Rechte vorbehalten.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Verbreitung und Verwendung als Quelltext oder Binärdatei, in geänderter\n" "oder ungeänderter Form sind gestattet, soweit die folgenden Bedingungen\n" "eingehalten werden:\n" "1. Weiterverbreitung des Quellcodes muss den obigen Copyrightshinweis,\n" " diese Liste von Bedingungen sowie den folgenden Haftungsausschluss\n" " beibehalten.\n" "2. Weiterverbreitung in binärer Form muss den obigen Copyright-Hinweis\n" " in der Dokumentation oder anderem der Distribution beiliegenden\n" " Material wiedergeben.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "DIESE SOFTWARE WIRD VOM AUTOR WIE VORLIEGEND ZUR VERFÜGUNG GESTELLT\n" "UND JEGLICHE AUSDRÜCKLICH GENANNTEN ODER IMPLIZITEN GARANTIEN,\n" "EINSCHLIESSLICH, ABER NICHT DARAUF BESCHRÄNKT, DER GARANTIE DER\n" "HANDELBARKEIT UND DER EIGNUNG FÜR EINEN BESTIMMTEN ZWECK WERDEN\n" "HIERMIT AUSGESCHLOSSEN. IN KEINEM WIE AUCH IMMER GELAGERTEN FALL KANN\n" "DER AUTOR FÜR IRGENDWELCHE DIREKTEN ODER INDIREKTEN, ZUFÄLLIGEN,\n" "BESONDEREN ODER BEISPIELHAFTEN SCHÄDEN (EINSCHLIESSLICH ABER NICHT\n" "AUSSCHLIESSLICH DER LIEFERUNG VON ERSATZGÜTERN ODER DIENSTEN; VERLUST\n" "DER NUTZBARKEIT, DER DATEN ODER DER GEWINNE ODER ETWAIGEN VERDIENST-\n" "AUSFALL-ENTSCHÄDIGUNGEN) HAFTBAR GEMACHT WERDEN, WIE AUCH IMMER SIE\n" "VERURSACHT WURDEN UND WELCHE HAFTUNGSMÖGLICHKEIT ZUGRUNDE GELEGT WIRD,\n" "SEI ES DURCH VERTRAG, VERBINDLICHKEIT ODER SCHADEN (EINSCHLIESSLICH\n" "FAHRLÄSSIGKEIT), DIE AUS DER VERWENDUNG DIESER SOFTWARE ERWÄCHST,\n" "SELBST WENN AUF DIE MÖGLICHKEIT SOLCHER SCHÄDEN HINGEWIESEN WURDE.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Aufruf: %s [Optionen] [Datei …] [-n Eingabedatei Ausgabedatei …]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii wandelt nur Zeilenumbrüche um (Vorgabe)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso wandelt zwischen DOS- und ISO-8859-1-Zeichensatz um\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 verwendet Windows Codepage 1252 (Westeuropäisch)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 verwendet DOS Codepage 437 (US) (Vorgabe)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 verwendet DOS Codepage 850 (Westeuropäisch)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 verwendet DOS Codepage 860 (Portugiesisch)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 verwendet DOS Codepage 863 (Kanadisches Französisch)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 verwendet DOS Codepage 865 (Nordisch)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 wandelt 8Bit-Zeichen in solche aus dem 7Bit-Raum um\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom erhält die Bytereihenfolge-Markierung\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom erhält die Bytereihenfolge-Markierung (Vorgabe)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode gibt den Umwandlungsmodus an\n" " convmode ascii, 7bit, iso, mac, Standard ist nach ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc die Kodierung für angezeigte Meldungen setzen\n" " encoding ansi, unicode, utf8, Vorgabe ist ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force erzwingt die Umwandlung binärer Dateien\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 wandelt UTF-16 in GB18030 um\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help gibt diese Hilfe aus\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=FLAGS] Dateiinformation anzeigen\n" " Datei … zu analysierende Dateien\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate erhält das Datum der Ausgabedatei\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license gibt die Software-Lizenz aus\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline fügt einen Zeilenumbruch hinzu\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom eine Bytereihenfolge-Markierung hinzufen (Vorgabe UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile erzeugt eine neue Datei\n" " Eingabedatei Originaldatei im Neue-Datei-Modus\n" " Ausgabedatei Ausgabedatei im Neue-Datei-Modus\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile überschreibt die alte Datei (Vorgabe)\n" " Datei ... die im Alte-Datei-Modus umzuwandelnden Dateien\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet stiller Modus, unterdrückt alle Warnungen\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom entfernt die Bytereihenfolge-Markierung (Vorgabe)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom entfernt die Bytereihenfolge-Markierung\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe überspringt binäre Dateien (Vorgabe)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 UTF-16-Kodierung beibehalten\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le setzt UTF-16LE als Eingabeformat voraus\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be setzt UTF-16BE als Eingabeformat voraus\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose ausführliche Ausgabe\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink folgt symbolischen Verknüpfungen und wandelt die Ziele um\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink ersetzt symbolische Verknüpfungen durch die umgewandelten\n" " Dateien (die originale Ziele bleiben unangetastet)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr "" " -S, --skip-symlink lässt symbolische Verknüpfungen und deren Ziele\n" " unangetastet (Vorgabe)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version gibt die Versionsnummer aus\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16-bit-Version (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16-bit-Version (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32-bit-Version (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32-bit-Version (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "MSYS-Version.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Cygwin-Version.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64-bit-Version (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32-bit-Version (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32-bit-Version (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32-bit-Version (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64-bit-Version (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32-bit-Version (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2-Version (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "OS/2-Version (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "%s-Version.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Mit Unterstützung für Unicode UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Ohne Unterstützung für Unicode UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Mit Unterstützung für Unicode-Dateinamen.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Ohne Unterstützung für Unicode-Dateinamen.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Mit Unterstützung von Landessprachen.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "Der Pfad für die temporäre Ausgabedatei ist zu lang:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Das %s BOM wird geschrieben.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Die EIngabedatei %s hat ein %s BOM.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Es wird UTF-16LE-Kodierung angenommen.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Es wird UTF-16LE-Kodierung angenommen.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Die temporäre Ausgabedatei konnte nicht geöffnet werden: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "%s wird als temporäre Datei verwendet\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Die Eingabedatei konnte nicht geschlossen werden: %s" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Die temporäre Ausgabedatei %s konnte nicht geschrieben werden:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Das Ändern der Rechte der temporären Ausgabedatei %s scheiterte:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Das Ändern des Eigentümers und der Gruppe der temporären Ausgabedatei %s scheiterte:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "Es gab Probleme beim Auflösen der symbolischen Verknüpfung »%s«.\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " Die Ausgabedatei verbleibt in »%s«\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "Beim Umbenennen von »%s« zu »%s« sind Probleme aufgetreten:" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " welche das Ziel der symbolischen Verknüpfung »%s« ist\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "binäre Datei %s wird übersprungen\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "Codepage %d wird nicht unterstützt.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "UTF-16 Datei %s wird übersprungen, da wchar_t %d Bytes groß ist.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "UTF-16-Datei %s wird übersprungen, da beim Umwandeln ein Fehler in Zeile %u auftrat.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "UTF-16-Datei %s wird übersprungen, da die Umwandlung von UTF-16 in dieser Version von %s nicht unterstützt wird.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "%s wird übersprungen, da es keine reguläre Datei ist\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "%s wird übersprungen, Ausgabedatei %s ist eine symbolische Verknüpfung.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Symbolische Verknüpfung %s wird übersprungen, da das Ziel keine reguläre Datei ist.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "%s wird übersprungen, das Ziel der symbolischen Verknüpfung %s ist keine reguläre Datei.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "Datei %s wird zu Datei %s im Unix-Format umgewandelt …\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "Datei %s wird in Datei %s im Mac-Format umgewandelt …\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "Datei %s wird in Datei %s im DOS-Format umgewandelt …\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "%s-Datei %s wird zu %s-Datei %s im Unix-Format umgewandelt …\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "%s-Datei %s wird in %s-Datei %s im Mac-Format umgewandelt …\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "%s-Datei %s wird in %s-Datei %s im DOS-Format umgewandelt …\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "Beim Umwandeln von Datei %s zu Datei %s sind Probleme aufgetreten\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Symbolische Verknüpfung %s wird übersprungen.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "Datei %s wird ins Unix-Format umgewandelt …\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "Datei %s wird ins Mac-Format umgewandelt …\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "Datei %s wird ins DOS-Format umgewandelt …\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "%s-Datei %s wird ins %s-Unix-Format umgewandelt …\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "%s-Datei %s wird ins %s-Mac-Format umgewandelt …\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "%s-Datei %s wird ins %s-DOS-Format umgewandelt …\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "Beim Umwandeln von Datei %s sind Probleme aufgetreten\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "Aus der Eingabedatei %s kann nicht gelesen werden:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "falsches Flag »%c« für Option -i oder --info\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "Aktive Codepage: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "Der angegebene Umwandlungsmodus %s ist unzulässig\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "Die Option »%s« benötigt ein Argument\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "Die angegebene Ausgabekodierung %s ist unzulässig\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "Das Ziel der Datei %s wurde für den Neudatei-Modus nicht angegeben\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "Aus der Eingabedatei kann nicht gelesen werden: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "In die Ausgabedatei kann nicht geschrieben werden: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "Fehler: Ungültiges Surrogate-Paar. Das Low-Surrogate fehlt.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "Fehler: Ungültiges Surrogate-Paar. Das High-Surrogate fehlt.\n" #~ msgid "can not read from input file %s: %s\n" #~ msgstr "Aus der Eingabedatei %s kann nicht gelesen werden: %s\n" #~ msgid "WINVER 0x%X\n" #~ msgstr "WINVER 0x%X\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "UTF-16 Datei %s wird übersprungen, da die derzeitige Zeichenkodierung nicht UTF-8 ist.\n" dos2unix-7.3.4/po/dos2unix.pot0000644000175500010010000003315312721132605015470 0ustar waterlanGeen# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-24 22:11+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr "" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr "" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr "" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr "" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr "" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr "" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr "" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr "" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr "" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr "" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr "" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr "" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr "" #: common.c:637 msgid " -h, --help display this help text\n" msgstr "" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr "" #: common.c:641 msgid " -L, --license display software license\n" msgstr "" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr "" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr "" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr "" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr "" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr "" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr "" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr "" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr "" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr "" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr "" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr "" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr "" #: common.c:669 msgid " -V, --version display version number\n" msgstr "" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "" #: common.c:689 msgid "MSYS version.\n" msgstr "" #: common.c:691 msgid "Cygwin version.\n" msgstr "" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "" #: common.c:727 msgid "With native language support.\n" msgstr "" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr "" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr "" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "" dos2unix-7.3.4/po/eo.po0000644000175500010010000005123112721132612014127 0ustar waterlanGeen# Esperanto translations for the dos2unix converter programs. # This file is distributed under the same license as the dos2unix package. # # «"Door open"? That is the least of your problems, haha!» # # Ruĝulo , 2010. # Benno Schulenberg , 2014, 2015. msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3-beta8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:42+0200\n" "PO-Revision-Date: 2015-08-23 11:37+0200\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Esperanto \n" "Language: eo\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Lokalize 1.0\n" #: dos2unix.c:79 #, fuzzy, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-2015 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (versio 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (versio 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Ĉiuj rajtoj estas rezervitaj.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Duuma signo 0x00%02X troviĝis en linio %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "**programeraro**: malvalida konvertmoduso %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Konvertiĝis %u el %u linifinoj.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "uziĝas kodpaĝo %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Duuma signo 0x%02X troviĝis en linio %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "eraro: Valoro de ĉirkaŭaĵa variablo DOS2UNIX_LOCALEDIR tro longas.\n" #: unix2dos.c:69 #, fuzzy, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-2015 Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Ĉiuj rajtoj estas rezervitaj.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Redistribuo kaj uzo en teksta kaj en duuma formo, sen aŭ kun modifoj,\n" "estas permesata se vi observas la jenajn kondiĉojn:\n" "1. Redistribuoj de la programteksto devas reteni la supran kopirajtan afiŝon,\n" " kaj ĉi tiun liston de kondiĉoj, kaj la suban malgarantion.\n" "2. Redistribuoj en duuma formo devas prezenti la supran kopirajtan afiŝon en\n" " la manlibro kaj/aŭ en la aliaj materialoj kiuj akompanis la distribuon.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Uzmaniero: %s [opcioj] [dosiero ...] [-n enigdosiero eligdosiero ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii konverti nur linifinojn (defaŭlto)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso konverti inter signaroj DOS kaj ISO-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 uzi Vindozan kodpaĝon 1252 (Okcident-Eŭropa)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 uzi DOS-kodpaĝon 437 (Usona) (defaŭlto)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 uzi DOS-kodpaĝon 850 (Okcident-Eŭropa)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 uzi DOS-kodpaĝon 860 (Portugala)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 uzi DOS-kodpaĝon 863 (Kebekia)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 uzi DOS-kodpaĝon 865 (Nordlandaj)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 konverti signojn kun jesa oka bito al spacetojn\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom reteni bajtordo-markon\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom reteni bajtordo-markon (defaŭlto)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode uzenda konvertmoduso\n" " MODUSO 'ascii', '7bit', 'iso', aŭ 'mac' (defaŭltas al 'ascii')\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc uzenda kodprezento por montritaj mesaĝoj\n" " KODPREZENTO 'ansi', 'unicode', aŭ 'utf8' (defaŭltas al 'ansi')\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force perforte konverti ankaŭ duumajn dosierojn\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 konverti UTF-16 al GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help montri ĉi tiun helptekston\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=FLAGOJ] montri (specifajn) informojn pri dosieroj\n" " DOSIERO... ekzamenendaj dosieroj\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate konservi dattempon de eliga dosiero\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license montri la permesilon de la programo\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline aldoni aldonan linifinon\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom aldoni bajtordo-markon\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile skribi al nova dosiero\n" " ENIGDOSIERO eniga dosiero en novdosiera moduso\n" " ELIGDOSIERO eliga dosiero en novdosiera moduso\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile skribi al ekzistanta dosiero (defaŭlto)\n" " DOSIERO... konvertendaj dosieroj en olddosiera moduso\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet subpremi ĉiujn avertojn\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom forigi bajtordo-markon (defaŭlto)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom forigi bajtordo-markon\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe preterpasi duumajn dosierojn (defaŭlto)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 reteni UTF-16-kodprezenton\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le trakti enigon kvazaŭ UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be trakti enigo kvazaŭ UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose parolema funkciado\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink sekvi simbolajn ligojn kaj konverti ties celojn\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink anstataŭigi simbolajn ligojn per la konvertitaj dosieroj\n" " (la celaj dosieroj ne ŝanĝiĝas)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink ne ŝanĝi simbolajn ligojn nek ties celojn (defaŭlto)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version montri programversion\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16-bita versio (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16-bita versio (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32-bita versio (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32-bita versio (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "MSYS-versio.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Cygwin-versio.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64-bita versio (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32-bita versio (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32-bita versio (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32-bita versio (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64-bita versio (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32-bita versio (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2-versio (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "OS/2-versio (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "%s-versio.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Kun subteno por Unikoda UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Sen subteno por Unikoda UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Kun subteno por Unikodaj dosiernomoj.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Sen subteno por Unikodaj dosiernomoj.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Kun subteno por lokaĵoj.\n" #: common.c:861 #, fuzzy msgid "Path for temporary output file is too long:" msgstr "Malsukcesis skribi al provizora eliga dosiero %s:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Skribiĝas %s-BOM.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Eniga dosiero %s havas %s-BOM.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Supoziĝas UTF-16LE-kodprezento.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Supoziĝas UTF-16BE-kodprezento.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Malsukcesis malfermi provizoran eligan dosieron: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "uziĝas %s kiel provizora dosiero\n" #: common.c:1499 common.c:2158 #, fuzzy, c-format msgid "Failed to close input file %s:" msgstr "Malsukcesis malfermi provizoran eligan dosieron: %s\n" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Malsukcesis skribi al provizora eliga dosiero %s:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Malsukcesis ŝanĝi la permesojn de provizora eliga dosiero %s:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Malsukcesis ŝanĝi posedanton kaj grupon de provizora eliga dosiero %s:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "problemoj dum redukto de simbola ligo '%s'\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " eliga dosiero restas en '%s'\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "problemoj dum alinomigo de '%s' al '%s':" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " kiu estas la celo de simbola ligo '%s'\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Preterpasiĝas duuma dosiero %s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "Kodpaĝo %d ne subtenatas.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Preterpasiĝas UTF-16-a dosiero %s; la grando de 'wchar_t' estas %d bajtoj.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Preterpasiĝas UTF-16-a dosiero %s; okazis konverteraro de UTF-16 en linio %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, fuzzy, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Preterpasiĝas UTF-16-a dosiero %s; okazis konverteraro de UTF-16 en linio %u.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Preterpasiĝas %s; ĝi ne estas normala dosiero.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Preterpasiĝas %s; eliga dosiero %s estas simbola ligo.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Preterpasiĝas simbola ligo %s; la celo ne estas normala dosiero.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Preterpasiĝas %s; la celo de simbola ligo %s ne estas normala dosiero.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "konvertiĝas dosiero %s al dosiero %s Unix-en...\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "konvertiĝas dosiero %s al dosiero %s Mac-en...\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "konvertiĝas dosiero %s al dosiero %s DOS-en...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "konvertiĝas dosiero %2$s (%1$s) Unix-en al dosiero %4$s (%3$s)...\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "konvertiĝas dosiero %2$s (%1$s) Mac-en al dosiero %4$s (%3$s)...\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "konvertiĝas dosiero %2$s (%1$s) DOS-en al dosiero %4$s (%3$s)...\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "problemoj dum konverto de dosiero %s al dosiero %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Preterpasiĝas simbola ligo %s.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "konvertiĝas dosiero %s Unix-en...\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "konvertiĝas dosiero %s Mac-en...\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "konvertiĝas dosiero %s DOS-en...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "konvertiĝas dosiero %2$s (%1$s) Unix-en (%3$s)...\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "konvertiĝas dosiero %2$s (%1$s) Mac-en (%3$s)...\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "konvertiĝas dosiero %2$s (%1$s) DOS-en (%3$s)...\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "problemoj dum konverto de dosiero %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "ne eblas legi el eniga dosiero %s:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "malĝusta flago '%c' por opcio '-i' aŭ '--info'\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "aktiva kodpaĝo: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "malvalida konvertmoduso %s indikatas\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "opcio '%s' bezonas argumenton\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "malvalida montra kodprezento %s indikatas\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "celo de dosiero %s ne indikatas (en novdosiera moduso)\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "ne eblas legi el eniga dosiero: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "ne eblas skribi al eliga dosiero: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "eraro: nevalida surogata paro -- mankas la baza parto\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "eraro: nevalida surogata paro -- mankas la supra parto\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "Preterpasiĝas UTF-16-a dosiero %s; la nuntempa lokaĵa kodo ne estas UTF-8.\n" dos2unix-7.3.4/po/es.po0000644000175500010010000005502312721132611014135 0ustar waterlanGeen# Spanish translations for the dos2unix package. # Traducciones al español para el paquete dos2unix. # Copyright (C) 2011,2014 THE dos2unix'S COPYRIGHT HOLDER # This file is distributed under the same license as the dos2unix package. # # Julio A. Freyre-Gonzalez , 2011, 2012, 2013. # Enrique Lazcorreta Puigmartí , 2014, 2015. msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.1-beta5\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:42+0200\n" "PO-Revision-Date: 2015-09-20 14:17+0200\n" "Last-Translator: Enrique Lazcorreta Puigmartí \n" "Language-Team: Spanish \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.8.4\n" #: dos2unix.c:79 #, fuzzy, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-2015 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Todos los derechos reservados.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Símbolo binario 0x00%02X encontrado en la línea %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "error, modo de conversión %d inválido\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Convertidos %u saltos de línea de un total de %u.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "usando página de códigos %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Símbolo binario 0x%02X encontrado en la línea %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "error: El valor de la variable de entorno DOS2UNIX_LOCALEDIR es demasiado largo.\n" #: unix2dos.c:69 #, fuzzy, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-2015 Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Todos los derechos reservados.\n" "\n" # Traducción obtenida de http://es.wikipedia.org/wiki/Licencia_BSD #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "La redistribución y el uso en las formas de código fuente y binario, con o sin\n" "modificaciones, están permitidos siempre que se cumplan las siguientes\n" "condiciones:\n" "1. Las redistribuciones del código fuente deben conservar el aviso de copyright\n" " anterior, esta lista de condiciones y el siguiente descargo de responsabilidad.\n" "2. Las redistribuciones en formato binario deben reproducir el aviso de copyright\n" " anterior, esta lista de condiciones y la siguiente renuncia en la documentación\n" " y/u otros materiales suministrados con la distribución.\n" "\n" # Traducción obtenida de http://es.wikipedia.org/wiki/Licencia_BSD #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "ESTE SOFTWARE SE SUMINISTRA POR EL AUTOR ``COMO ESTÁ'' Y CUALQUIER\n" "GARANTÍA EXPRESA O IMPLÍCITAS, INCLUYENDO, PERO NO LIMITADO A, LAS\n" "GARANTÍAS IMPLÍCITAS DE COMERCIALIZACIÓN Y APTITUD PARA UN PROPÓSITO\n" "DETERMINADO SON RECHAZADAS. EN NINGÚN CASO EL AUTOR SERÁ RESPONSABLE\n" "POR NINGÚN DAÑO DIRECTO, INDIRECTO, INCIDENTAL, ESPECIAL, EJEMPLAR O\n" "CONSECUENTE (INCLUYENDO, PERO NO LIMITADO A, LA ADQUISICIÓN DE BIENES O\n" "SERVICIOS; LA PÉRDIDA DE USO, DE DATOS O DE BENEFICIOS; O INTERRUPCIÓN DE LA\n" "ACTIVIDAD EMPRESARIAL) O POR CUALQUIER TEORÍA DE RESPONSABILIDAD, YA SEA\n" "POR CONTRATO, RESPONSABILIDAD ESTRICTA O AGRAVIO (INCLUYENDO NEGLIGENCIA\n" "O CUALQUIER OTRA CAUSA) QUE SURJA DE CUALQUIER MANERA DEL USO DE ESTE\n" "SOFTWARE, INCLUSO SI SE HA ADVERTIDO DE LA POSIBILIDAD DE TALES DAÑOS.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Uso: %s [parámetros] [archivo ...] [-n archivo_de_entrada archivo_de_salida ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii solamente convierte los saltos de línea (por defecto)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso conversión entre DOS y el conjunto de caracteres ISO-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 usa la página de códigos Windows 1252 (Europa Occidental)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 usa la página de códigos DOS 437 (EE. UU.) (por defecto)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 usa la página de códigos DOS 850 (Europa Occidental)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 usa la página de códigos DOS 860 (Portugués)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 usa la página de códigos DOS 863 (Francocanadiense)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 usa la página de códigos DOS 865 (Nórdico)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 convierte caracteres de 8 bits al espacio de 7 bits\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom conserva la Marca de Orden del Byte, BOM\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom conserva la Marca de Orden del Byte, BOM (por defecto)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode modo de conversión\n" " modo_de_conversion ascii, 7bit, iso, mac, por defecto es ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc establece la codificación de los mensajes de texto que se muestran\n" " codificación ansi, unicode, utf8, default to ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force fuerza la conversión de archivos binarios\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 convierte UTF-16 a GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help arroja esta ayuda\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=FLAGS] muestra información del archivo\n" " archivo ... archivos a analizar\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate conserva la fecha en el archivo de salida\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license muestra la licencia del programa\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline añade salto de línea adicional\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom añade la Marca de Orden del Byte, BOM (por defecto en UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile escribe a un nuevo archivo\n" " archivo_de_entrada archivo original en el modo de archivo nuevo\n" " archivo_de_salida archivo de salida en el modo de archivo nuevo\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile escribe al archivo antiguo (por defecto)\n" " archivo ... archivos a convertir en el modo de archivo antiguo\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet modo silencioso, suprime todas las advertencias\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom elimina la Marca de Orden del Byte, BOM (por defecto)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom elimina la Marca de Orden del Byte, BOM\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe ignora archivos binarios (por defecto)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 mantiene la codificación UTF-16\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le supone que el formato de entrada es UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be supone que el formato de entrada es UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose operación detallada\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink sigue los enlaces simbólicos y convierte los destinos\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink reemplaza los enlaces simbólicos con los archivos convertidos\n" " (los archivos destino originales no son alterados)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink no altera los enlaces simbólicos ni sus destinos (por defecto)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version despliega el número de versión\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "Versión DOS de 16 bit (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "Versión DOS de 16 bit (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "Versión DOS de 32 bit (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "Versión DOS de 32 bit (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "Versión para MSYS.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Versión para Cygwin.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Versión Windows de 64 bit (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Versión Windows de 32 bit (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Versión Windows de 32 bit (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Versión Windows de 32 bit (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Versión Windows de 64 bit (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Versión Windows de 32 bit (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "Versión para OS/2 (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "Versión para OS/2 (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "Versión para %s.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Con soporte Unicode UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Sin soporte Unicode UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Con soporte Unicode UTF-16.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Sin soporte Unicode UTF-16.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Con soporte de idioma materno.\n" #: common.c:861 #, fuzzy msgid "Path for temporary output file is too long:" msgstr "Error al escribir el archivo de salida temporal %s:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Escribiendo BOM %s.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "El archivo de entrada %s tiene BOM %s.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Se asume codificación UTF-16LE.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Se asume codificación UTF-16BE.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Error al abrir el archivo de salida temporal: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "usando %s como archivo temporal\n" #: common.c:1499 common.c:2158 #, fuzzy, c-format msgid "Failed to close input file %s:" msgstr "Error al abrir el archivo de salida temporal: %s\n" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Error al escribir el archivo de salida temporal %s:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Error al cambiar los permisos del archivo temporal de salida %s:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Error al cambiar el propietario y grupo del archivo temporal de salida %s:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "problemas al resolver el enlace simbólico '%s'\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " el archivo de salida permanece en '%s'\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "problemas al renombrar '%s' como '%s':" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " cual es el destino del enlace simbólico '%s'\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Ignorando archivo binario %s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "La página de códigos %d no está soportada.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Ignorando archivo UTF-16 %s, el tamaño de wchar_t es %d bytes.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Ignorando archivo UTF-16 %s, ocurrió un error de conversión a UTF-16 en la línea %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Ignorando archivo UTF-16 %s, la conversión a UTF-16 no está soportada en esta versión de %s.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Ignorando %s, no es un archivo regular.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Ignorando %s, el archivo de salida %s es un enlace simbólico.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Ignorando enlace simbólico %s, el destino no es un archivo regular.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Ignorando %s, el destino del enlace simbólico %s no es un archivo regular.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "convirtiendo archivo %s a %s in formato Unix...\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "convirtiendo archivo %s a %s in formato Mac...\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "convirtiendo archivo %s a %s en formato DOS...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "convirtiendo archivo %s %s en archivo %s %s en formato Unix...\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "convirtiendo archivo %s %s en archivo %s %s en formato Mac...\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "convirtiendo archivo %s %s en archivo %s %s en formato DOS...\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "problemas al convertir el archivo %s a %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Ignorando enlace simbólico %s.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "convirtiendo archivo %s a formato Unix...\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "convirtiendo archivo %s a formato Mac...\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "convirtiendo archivo %s a formato DOS...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "convirtiendo archivo %s %s a formato %s Unix...\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "convirtiendo archivo %s %s a formato %s Mac...\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "convirtiendo archivo %s %s a formato %s DOS...\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "problemas convirtiendo el archivo %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "no puedo escribir al archivo de salida: %s" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "'%c' es un valor incorrecto para la opción -i o --info\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "Página de códigos activa: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "modo de conversión %s especificado es inválido\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "el parámetro '%s' requiere un argumento\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "el modo de conversión %s especificado no es válido\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "el destino del archivo %s no se especificó en el modo de archivo nuevo\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "no puedo escribir al archivo de salida: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "no puedo escribir al archivo de salida: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "error: Par sustituto no válido. Falta el sustituto bajo.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "error: Par sustituto no válido. Falta el sustituto alto.\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "Ignorando archivo UTF-16 %s, la codificación actual no es UTF-8.\n" #~ msgid " -m, --add-bom add UTF-8 Byte Order Mark\n" #~ msgstr " -m, --add-bom añade marca de orden de bytes para UTF-8\n" dos2unix-7.3.4/po/fr.po0000644000175500010010000005456212721132611014144 0ustar waterlanGeen# Message français pour dos2unix. # Copyright (C) 2016 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # Frédéric Marchal , 2016. msgid "" msgstr "" "Project-Id-Version: dos2unix-7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-13 13:32+0200\n" "Last-Translator: Frédéric Marchal \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Tous droits réservés.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Symbole binaire 0x00%02X rencontré à la ligne %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "erreur du programme, mode de conversion %d invalide\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "A converti %u sauts de lignes sur %u.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "utilise le code page %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Symbole binaire 0x%02X rencontré à la ligne %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "erreur: La valeur de la variable d'environnement DOS2UNIX_LOCALEDIR est trop longue.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Tous droits réservés.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "La distribution et l'utilisation du code source ou de sa forme binaire,\n" "avec ou sans modifications, sont permises pour autant que les conditions\n" "suivantes soient respectées :\n" "1. La distribution du code source doit conserver le copyright ci-dessus\n" " cette liste de conditions et l'avis de non-responsabilité ci-dessous.\n" "2. La distribution sous forme binaire doit reproduire le copyright ci-dessus\n" " dans la documentation ou tout autre matériel fournis avec la distribution.\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "CE LOGICIEL EST FOURNI PAR L'AUTEUR TEL QUEL SANS AUCUNE GARANTIE\n" "EXPRESSE OU IMPLICITE, Y COMPRIS, MAIS SANS ÊTRE LIMITÉ À, LA GARANTIE\n" "IMPLICITE DE QUALITÉ MARCHANDE OU D'ADÉQUATION À UNE TÂCHE PARTICULIÈRE.\n" "DANS AUCUN CAS, L'AUTEUR NE SERA TENU RESPONSABLE DES DÉGÂTS DIRECTS,\n" "INDIRECTS, INCIDENTAUX, SPÉCIAUX, EXEMPLAIRES, OU RÉSULTANTS (Y COMPRIS,\n" "MAIS NON LIMITÉ À, LA FOURNITURE OU LE REMPLACEMENT DE BIENS OU SERVICES,\n" "PERTE D'UTILISATION, DONNÉES, OU PROFITS ; OU INTERRUPTION DE TRAVAIL) CAUSÉS\n" "DE QUELQUE MANIÈRE ET SELON TOUTE THÉORIE DE RESPONSABILITÉ, PAR CONTRAT,\n" "RESPONSABILITÉ STRICT, OU TORT (Y COMPRIS LA NÉGLIGENCE OU AUTRE) SURVENANT\n" "DE QUELQUE MANIÈRE D'UTILISATION DE CE LOGICIEL, MÊME SI LA POSSIBILITÉ\n" "D'UN TEL DOMMAGE A ÉTÉ ANNONCÉE.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Usage: %s [options] [fichier …] [-n fichier_entrée fichier_sortie …]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii converti uniquement les sauts de ligne (par défaut)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso conversion entre les jeux de caractères DOS et ISO-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 utilise le code page 1252 de Windows (Europe de l'ouest)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 utilise le code page 437 du DOS (US) (par défaut)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 utilise le code page 850 du DOS (Europe de l'ouest)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 utilise le code page 860 du DOS (Portugais)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 utilise le code page 863 du DOS (Français Canadien)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 utilise le code page 865 du DOS (Nordique)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 converti les caractères 8 bits vers l'espace 7 bits\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom garde la marque d'ordre des octets\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom garde la marque d'ordre des octets (par défaut)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode mode de conversion\n" " modeconv ascii, 7bit, iso, mac, ascii par défaut\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc choisi l'encodage pour afficher les messages textes\n" " encodage ansi, unicode ou utf8 (ansi par défaut)\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force force la conversion de fichiers binaires\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 converti UTF-16 en GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help affiche ce texte d'aide\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=FANIONS] affiche les informations du fichier\n" " fichier … fichiers à analyser\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate conserve la date du fichier de sortie\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license affiche la licence du logiciel\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline ajoute des sauts de ligne supplémentaires\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom ajoute la marque d'ordre des octets (par défaut avec UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile écrit dans un nouveau fichier\n" " fichier_entrée fichier original dans le mode « nouveau fichier »\n" " fichier_sortie fichier de sortie dans le mode « nouveau fichier »\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile écrit dans l'ancien fichier (par défaut)\n" " fichier … fichiers à convertir dans le mode « ancien fichier »\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet mode silencieux, supprime tous les avertissements\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom supprime la marque d'ordre des octets (par défaut)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom supprime la marque d'ordre des octets\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe ignore les fichiers binaires (par défaut)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 conserve l'encodage UTF-16\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le suppose que le format d'entrée est UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be suppose que le format d'entrée est UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose opération verbeuse\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink suit les liens symboliques et converti les cibles\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink remplace les liens symboliques par les fichiers convertis\n" " (les fichiers cibles originaux restent inchangés)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink conserve les liens symboliques et les cibles inchangés (par défaut)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version affiche le numéro de version\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "Version DOS 16 bits (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "Version DOS 16 bits (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "Version DOS 32 bits (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "Version DOS 32 bits (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "Version MSYS.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Version Cygwin.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Version Windows 64 bit (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Version Windows 32 bits (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Version Windows 32 bits (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Version Windows 32 bits (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Version Windows 64 bits (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Version Windows 32 bits (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "Version OS/2 (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "Version OS/2 (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "Version %s.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Avec support pour l'Unicode UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Sans support pour l'Unicode UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Avec support pour les noms de fichiers Unicode.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Sans support pour les noms de fichiers Unicode.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Avec support pour la langue native.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "Le chemin pour le fichier de sortie temporaire est trop long :" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Écriture de la BOM %s.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Le fichier d'entrée %s a une BOM %s.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Suppose un encodage UTF-16LE.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Suppose un encodage UTF-16BE.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Échec à l'ouverture du fichier temporaire de sortie : %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "utilise %s comme fichier temporaire\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Échec à la fermeture du fichier d'entrée %s :" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Échec d'écriture dans le fichier temporaire de sortie %s :" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Échec lors du changement des permissions du fichier temporaire de sortie %s :" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Échec lors du changement du propriétaire et du groupe du fichier temporaire de sortie %s :" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "problème lors de la résolution du lien symbolique « %s »\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " le fichier de sortie reste dans « %s »\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "problèmes en renommant « %s » en « %s » :" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " quelle est la cible du lien symbolique « %s »\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Ignore le fichier binaire %s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "le code page %d n'est pas supporté.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Ignore le fichier UTF-16 %s, la taille de wchar_t n'est pas de %d octets.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Ignore le fichier UTF-16 %s, une erreur de conversion UTF-16 a eu lieu à la ligne %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Ignore le fichier UTF-16 %s, la conversion UTF-16 n'est pas supportée dans cette version de %s.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Ignore %s, pas un fichier régulier.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Ignore %s, le fichier de sortie %s est un lien symbolique.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Ignore le lien symbolique %s, la cible n'est pas un fichier régulier.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Ignore %s, la cible du lien symbolique %s n'est pas un fichier régulier.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "conversion du fichier %s vers le fichier %s au format Unix…\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "conversion du fichier %s vers le fichier %s au format Mac…\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "conversion du fichier %s vers le fichier %s au format DOS…\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "conversion du fichier %s %s vers le fichier %s %s au format Unix…\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "conversion du fichier %s %s vers le fichier %s %s au format Mac…\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "conversion du fichier %s %s vers le fichier %s %s au format DOS…\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "problèmes lors de la conversion du fichier %s vers le fichier %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Ignore le lien symbolique %s.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "conversion du fichier %s au format Unix…\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "conversion du fichier %s au format Mac…\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "conversion du fichier %s au format DOS…\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "conversion du fichier %s %s au format Unix %s…\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "conversion du fichier %s %s au format Mac %s…\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "conversion du fichier %s %s au format DOS %s…\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "problèmes lors de la conversion du fichier %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "impossible de lire depuis le fichier d'entrée %s :" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "mauvais fanion « %c » pour l'option -i ou --info\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "code page actif : %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "mode de conversion %s spécifié invalide\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "l'option « %s » requiert un argument\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "l'encodage %s spécifié pour l'affichage est invalide\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "la cible du fichier %s n'est pas spécifiée en mode nouveau fichier\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "impossible de lire depuis le fichier d'entrée : %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "impossible d'écrire dans le fichier de sortie : %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "erreur: Demi-codet invalide. Le demi-codet bas est manquant.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "erreur: Demi-codet invalide. Le demi-codet haut est manquant.\n" #~ msgid "has %s BOM.\n" #~ msgstr "a une BOM %s.\n" #~ msgid "WINVER 0x%X\n" #~ msgstr "WINVER 0x%X\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "Ignore le fichier UTF-16 %s, l'encodage des caractères de l'environnement linguistique actuel n'est pas UTF-8.\n" #~ msgid " -m, --add-bom add UTF-8 Byte Order Mark\n" #~ msgstr " -m, --add-bom ajoute la marque d'ordre des octets de l'UTF-8\n" dos2unix-7.3.4/po/hu.po0000644000175500010010000005551612721132612014152 0ustar waterlanGeen# Hungarian translation of dos2unix # Copyright (C) 2014 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # # Balázs Úr , 2014, 2015. msgid "" msgstr "" "Project-Id-Version: dos2unix 7.2.3-beta3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:42+0200\n" "PO-Revision-Date: 2015-06-30 13:38+0200\n" "Last-Translator: Balázs Úr \n" "Language-Team: Hungarian \n" "Language: hu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.5\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: dos2unix.c:79 #, fuzzy, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-2015 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (3.1-es verzió)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (3.0-s verzió)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Minden jog fenntartva.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Bináris szimbólum (0x00%02X) található a(z) %u. sorban\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "programhiba, érvénytelen átalakítási mód: %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "%u / %u sortörés átalakítva.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "%d kódlap használata.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Bináris szimbólum (0x%02X) található a(z) %u. sorban\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "hiba: a DOS2UNIX_LOCALEDIR környezeti változó értéke túl hosszú.\n" #: unix2dos.c:69 #, fuzzy, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-2015 Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Minden jog fenntartva.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Engedélyezett a forráskód és bináris formában történő felhasználás és\n" "terjesztés, módosítással vagy anélkül, amennyiben a következő feltételek\n" "teljesülnek:\n" "1. A forráskód terjesztésekor meg kell őrizni a fenti szerzői jogi\n" " megjegyzést, ezt a feltétellistát és a következő nyilatkozatot.\n" "2. Bináris formában történő terjesztéskor tovább kell adni a fenti szerzői\n" " jogi megjegyzést, ezt a feltétellistát és a következő nyilatkozatot a\n" " dokumentációban, illetve a csomaggal részét képező egyéb anyagokban.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "EZT A SZOFTVERT A SZERZŐI JOG TULAJDONOSAI ÉS A HOZZÁJÁRULÓK ÚGY\n" "BIZTOSÍTJÁK, „AHOGY VAN”, ÉS SEMMILYEN NYÍLT VAGY BURKOLT GARANCIA\n" "– BELEÉRTVE, DE NEM ERRE KORLÁTOZVA AZ ELADHATÓSÁGOT VAGY EGY ADOTT\n" "CÉLRA VALÓ ALKALMATOSSÁGOT – NEM ÉRVÉNYESÍTHETŐ. A SZERZŐI JOG\n" "TULAJDONOSAI ÉS A HOZZÁJÁRULÓK SEMMILYEN ESETBEN SEM VONHATÓK\n" "FELELŐSSÉGRE A SZOFTVER HASZNÁLATÁBÓL EREDŐ SEMMILYEN KÖZVETLEN,\n" "KÖZVETETT, VÉLETLENSZERŰ, KÜLÖNLEGES, PÉLDAADÓ VAGY SZÜKSÉGSZERŰ\n" "KÁROKÉRT (BELEÉRTVE, DE NEM ERRE KORLÁTOZVA A HELYETTESÍTŐ TERMÉKEK\n" "VAGY SZOLGÁLTATÁSOK BESZERZÉSÉT, ÜZEMKIESÉST, ADATVESZTÉST, ELMARADT\n" "HASZNOT VAGY ÜZLETMENET MEGSZAKADÁSÁT), BÁRHOGY IS KÖVETKEZETT BE,\n" "VALAMINT A FELELŐSSÉG BÁRMILYEN ELMÉLETÉVEL – AKÁR SZERZŐDÉSBEN, AKÁR\n" "OKOZOTT KÁRBAN (BELEÉRTVE A HANYAGSÁGOT ÉS EGYEBET), AKKOR IS, HA AZ\n" "ILYEN KÁR LEHETŐSÉGÉRE FELHÍVTÁK A FIGYELMET.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Használat: %s [kapcsolók] [fájl ...] [-n be_fájl ki_fájl ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii csak sortörések átalakítása (alapértelmezett)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso átalakítás DOS és ISO-8859-1 karakterkészlet között\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 Windows 1252-es kódlap használata (Nyugat-európai)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 DOS 437-es kódlap használata (US) (alapértelmezett)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 DOS 850-es kódlap használata (Nyugat-európai)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 DOS 860-as kódlap használata (portugál)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 DOS 863-as kódlap használata (francia-kanadai)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 DOS 865-ös kódlap használata (északi)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 8-bites karakterek átalakítása 7-bitesre\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom bájtsorrendjel megtartása\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom bájtsorrendjel megtartása (alapértelmezett)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode átalakítási mód\n" " convmode ascii, 7bit, iso, mac, alapértelmezetten asci\n" #: common.c:628 #, fuzzy msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -c, --convmode átalakítási mód\n" " convmode ascii, 7bit, iso, mac, alapértelmezetten asci\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force bináris fájlok átalakításának kényszerítése\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 UTF-16 átalakítása GB18030-ra\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help ezen súgószöveg megjelenítése\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=JELZŐK] fájlinformációk megjelenítése\n" " fájl ... elemzendő fájlok\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate kimeneti fájl dátumának megtartása\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license szoftverlicenc megjelenítése\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline további új sor hozzáadása\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom bájtsorrendjel hozzáadása (alapértelmezetten UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile kiírás új fájlba\n" " infile eredeti fájl új-fájl módban\n" " outfile kimeneti fájl új-fájl módban\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile kiírás a régi fájlba (alapértelmezett)\n" " file ... átalakítandó fájl régi-fájl módban\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet csöndes mód, minden figyelmeztetés elnyomása\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom bájtsorrendjel eltávolítása (alapértelmezett)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom bájtsorrendjel eltávolítása\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe bináris fájlok kihagyása (alapértelmezett)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 UTF-16 kódolás megtartása\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le feltételezze, hogy a bemeneti formátum UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be feltételezze, hogy a bemeneti formátum UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose részletes működés\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink szimbolikus linkek követése és a célok átalakítása\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink szimbolikus linkek cseréje az átalakított fájlokkal\n" " (az eredeti célfájlok változatlanok maradnak)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr "" " -S, --skip-symlink szimbolikus linkek és célok változatlanul hagyása\n" " (alapértelmezett)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version verziószám megjelenítése\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "16-bites DOS verzió (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "16-bites DOS verzió (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "32-bites DOS verzió (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "32-bites DOS verzió (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "MSYS verzió.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Cygwin verzió.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "64-bites Windows verzió (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "32-bites Windows verzió (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "32-bites Windows verzió (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "32-bites Windows verzió (MinGW)\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "64-bites Windows verzió (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "32-bites Windows verzió (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2 verzió (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "OS/2 verzió (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "%s verzió.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Unicode UTF-16 támogatással.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Unicode UTF-16 támogatás nélkül.\n" #: common.c:721 #, fuzzy msgid "With Unicode file name support.\n" msgstr "Unicode UTF-16 támogatással.\n" #: common.c:723 #, fuzzy msgid "Without Unicode file name support.\n" msgstr "Unicode UTF-16 támogatás nélkül.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Natív nyelvi támogatással.\n" #: common.c:861 #, fuzzy msgid "Path for temporary output file is too long:" msgstr "Nem sikerült írni a(z) %s átmeneti kimeneti fájlba: %s\n" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "%s BOM írása.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, fuzzy, c-format msgid "Input file %s has %s BOM.\n" msgstr "A(z) %s bemeneti fájl %s BOM-mal rendelkezik.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "UTF-16LE kódolás feltételezése.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "UTF-16BE kódolás feltételezése.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Nem sikerült megnyitni az átmeneti kimeneti fájlt: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "%s használata átmeneti fájlként\n" #: common.c:1499 common.c:2158 #, fuzzy, c-format msgid "Failed to close input file %s:" msgstr "Nem sikerült megnyitni az átmeneti kimeneti fájlt: %s\n" #: common.c:1512 #, fuzzy, c-format msgid "Failed to write to temporary output file %s:" msgstr "Nem sikerült írni a(z) %s átmeneti kimeneti fájlba: %s\n" #: common.c:1535 #, fuzzy, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Nem sikerült megváltoztatni a(z) %s átmeneti kimeneti fájl jogosultságait: %s\n" #: common.c:1552 #, fuzzy, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Nem sikerült megváltoztatni a(z) %s átmeneti kimeneti fájl tulajdonosát és csoportját: %s\n" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "hiba a(z) „%s” szimbolikus link feloldásakor\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " kimeneti fájl maradt ebben: „%s”\n" #: common.c:1626 #, fuzzy, c-format msgid "problems renaming '%s' to '%s':" msgstr "hiba a(z) „%s” átnevezésekor erre: „%s”: %s\n" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " mi a(z) „%s” szimbolikus link célja\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "A(z) %s bináris fájl kihagyása\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "a(z) %d kódlap nem támogatott.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "A(z) %s UTF-16 fájl kihagyása, a wchar_t mérete %d bájt.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "A(z) %s UTF-16 fájl kihagyása, egy UTF-16 átalakítási hiba történt a(z) %u. sorban.\n" #: common.c:1707 common.c:1799 common.c:1885 #, fuzzy, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "A(z) %s UTF-16 fájl kihagyása, egy UTF-16 átalakítási hiba történt a(z) %u. sorban.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "A(z) %s kihagyása, nem egy szabályos fájl.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "A(z) %s kihagyása, a(z) %s kimeneti fájl egy szimbolikus link.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "A(z) %s szimbolikus link kihagyása, a cél nem egy szabályos fájl.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "A(z) %s kihagyása, a(z) %s szimbolikus link célja nem egy szabályos fájl.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "a(z) %s fájl átalakítása %s fájlra Unix formátumban…\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "a(z) %s fájl átalakítása %s fájlra Mac formátumban…\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "a(z) %s fájl átalakítása %s fájlra DOS formátumban…\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "a(z) %s kódolású %s fájl átalakítása %s kódolású %s fájlra Unix formátumban…\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "a(z) %s kódolású %s fájl átalakítása %s kódolású %s fájlra Mac formátumban…\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "a(z) %s kódolású %s fájl átalakítása %s kódolású %s fájlra DOS formátumban…\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "hiba a(z) %s fájl %s fájlra való átalakításakor\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "A(z) %s szimbolikus link kihagyása.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "a(z) %s fájl átalakítása Unix formátumra…\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "a(z) %s fájl átalakítása Mac formátumra…\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "a(z) %s fájl átalakítása DOS formátumra…\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "a(z) %s kódolású %s fájl átalakítása %s kódolású Unix formátumra…\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "a(z) %s kódolású %s fájl átalakítása %s kódolású Mac formátumra…\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "a(z) %s kódolású %s fájl átalakítása %s kódolású DOS formátumra…\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "hiba a(z) %s fájl átalakításakor\n" #: common.c:2039 common.c:2089 #, fuzzy, c-format msgid "can not read from input file %s:" msgstr "nem sikerült olvasni a(z) %s bemeneti fájlból: %s\n" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "hibás „%c” jelző a -i vagy --info kapcsolókhoz\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "aktív kódlap: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "érvénytelen %s átalakítási mód lett megadva\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "a(z) „%s” kapcsolóhoz argumentum szükséges\n" #: common.c:2467 #, fuzzy, c-format msgid "invalid %s display encoding specified\n" msgstr "érvénytelen %s átalakítási mód lett megadva\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "a(z) %s fájl célja nincs megadva az új-fájl módban\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "nem sikerült olvasni a bemeneti fájlból: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "nem sikerült írni a kimeneti fájlba: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "hiba: Érvénytelen helyettesítő pár. Hiányzó alacsony helyettesítő.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "hiba: Érvénytelen helyettesítő pár. Hiányzó magas helyettesítő.\n" #, fuzzy #~ msgid "has %s BOM.\n" #~ msgstr "%s BOM írása.\n" #~ msgid "WINVER 0x%X\n" #~ msgstr "WINVER 0x%X\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "A(z) %s UTF-16 fájl kihagyása, a jelenlegi területi beállítás karakterkódolása nem UTF-8.\n" #~ msgid " -m, --add-bom add UTF-8 Byte Order Mark\n" #~ msgstr " -m, --add-bom UTF-8 bájtsorrendjel hozzáadása\n" dos2unix-7.3.4/po/ja.po0000644000175500010010000005665212721132612014132 0ustar waterlanGeen# Japanese gettext message file for dos2unix # Copyright (C) 2016 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # Yasuaki Taniguchi , 2014. # Takeshi Hamasaki , 2016. # msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-15 00:11+0900\n" "Last-Translator: Takeshi Hamasaki \n" "Language-Team: Japanese \n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.8.7.1\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "バイナリ文字 0x00%02X が %u 行目で見つかりました\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "プログラムエラー、無効な変換モード %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "%2$u 行のうち、 %1$u 行を変換しました。\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "コードページ %d を使用します。\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "バイナリ文字 0x%02X が %u 行目で見つかりました\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "エラー: 環境変数 DOS2UNIX_LOCALEDIR の値が長すぎます。\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" # ライセンス条項なので翻訳しません #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" # ライセンス条項なので翻訳しません #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "使用法: %s [options] [file ...] [-n infile outfile ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii 改行のみ変換する (既定)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso DOS と ISO-8859-1 文字セット間で変換する\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 Windows コードページ 1252 (西欧) を使用する\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 DOS コードページ 437 (US) を使用する (既定)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 DOS コードページ 850 (西欧) を使用する\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 DOS コードページ 860 (ポルトガル語) を使用する\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 DOS コードページ 863 (カナダのフランス語) を使用する\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 DOS コードページ 865 (北欧) を使用する\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 8 ビット文字を 7 ビットに変換する\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom バイト順マークを保つ\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom バイト順マークを残す (既定)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode 変換モード\n" " convmode ascii, 7bit, iso, mac, 既定は ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc 表示されるメッセージのエンコーディングを設定する\n" " encoding ansi, unicode, utf8, デフォルトは ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force バイナリファイルを強制的に変換する\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 UTF-16 を GB18030 に変換する\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help このヘルプメッセージを表示する\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=FLAGS] ファイル情報を表示する\n" " file ... 分析するファイル\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate ファイルの日付を保持する\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license ソフトウェアライセンスを表示する\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline 改行を追加する\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom バイト順マークを加える (UTF-8 の既定)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile 新規ファイルに書き込む\n" " infile このモードでの入力ファイル\n" " outfile このモードでの出力ファイル\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile 元のファイルに書き込む (既定)\n" " file ... このモードでの変換するファイル\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet 抑止モード、全ての警告を抑止する\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom バイト順マークを削除する (既定)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom バイト順マークを削除する\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe バイナリファイルをスキップする (既定)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 UTF-16 エンコーディングを保つ\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le 入力の形式を UTF-16LE と見なす\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be 入力の形式を UTF-16BE と見なす\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose 冗長表示をする\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink シンボリックリンクを辿り、対象を変換する\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink シンボリックリンクを変換後の対象ファイルに置換する\n" " (元の対象ファイルは変更されずそのまま残る)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink シンボリックリンクを辿らず、対象をそのままにする (既定)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version バージョン番号を表示する\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16 ビットバージョン (WATCOMC)。\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16 ビットバージョン (TURBOC)。\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32 ビットバージョン (WATCOMC)。\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32 ビットバージョン (DJGPP)。\n" #: common.c:689 msgid "MSYS version.\n" msgstr "MSYS バージョン。\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Cygwin バージョン。\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64 ビットバージョン (MinGW-w64)。\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32 ビットバージョン (WATCOMC)。\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32 ビットバージョン (MinGW-w64)。\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32 ビットバージョン (MinGW)。\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64 ビットバージョン (MSVC %d)。\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32 ビットバージョン (MSVC %d)。\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2 バージョン (WATCOMC)。\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "OS/2 バージョン (EMX)。\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "%s バージョン。\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Unicode UTF-16 サポート付き。\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Unicode UTF-16 サポート無し。\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Unicode ファイル名 サポート付き。\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Unicode ファイル名 サポート無し。\n" #: common.c:727 msgid "With native language support.\n" msgstr "ネイティブ言語サポート。\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "一時出力ファイルのパスが長過ぎます:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "%s BOM を書き込んでいます。\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "入力ファイル %s には %s BOM が存在します。\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "UTF-16LE エンコーディングと見なしています。\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "UTF-16BE エンコーディングと見なしています。\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "一時出力ファイルを開くのに失敗しました: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "%s を一時ファイルとして使用しています\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "入力ファイル %s を閉じるのに失敗しました:" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "一時出力ファイル %s への書き込みに失敗しました:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "一時出力ファイル %s のパーミッション変更に失敗しました:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "一時出力ファイル %s の所有者とグループの変更に失敗しました:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "シンボリックリンク '%s' の解決中に問題が発生しました\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " 出力ファイルは '%s' に残っています\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr " '%s' から '%s' への名前変更で問題が発生しました:" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " これはシンボリックリンク '%s' のターゲットです\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "バイナリファイル %s をスキップしています\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "コードページ %d はサポートされていません\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "UTF-16 ファイル %s をスキップしています。wchar_t のサイズは %d バイトです。\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "UTF-16 ファイル %s をスキップしています。%u 行目の UTF-16 変換でエラーが発生しました。\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "UTF-16 ファイル %s をスキップしています。UTF-16 変換はこのバージョンの %s ではサポートされていません。\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "%s をスキップしています。通常ファイルではありません。\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "%s をスキップしています。出力ファイル %s はシンボリックリンクです。\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "シンボリックリンク %s をスキップしています。対象が通常ファイルではありません。\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "%s をスキップしています。シンボリックリンク %s を辿った先が通常ファイルではありません。\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "%s から %s へ Unix 形式でファイル変換しています。\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "%s から %s へ Mac 形式でファイル変換しています。\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "%s から %s へ DOS 形式で変換しています。\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "%s ファイルの %s から %s ファイルの %s へ Unix 形式でファイル変換しています...\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "%s ファイルの %s から %s ファイルの %s へ Mac 形式でファイル変換しています...\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "%s ファイルの %s から %s ファイルの %s へ DOS 形式で変換しています...\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "ファイル %s からファイル %s へ変換中に問題が発生しました\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "シンボリックリンク %s をスキップしています。\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "ファイル %s を Unix 形式へ変換しています。\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "ファイル %s を Mac 形式へ変換しています。\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "ファイル %s を DOS 形式へ変換しています。\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "%s ファイル %s を %s の Unix 形式へ変換しています...\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "%s ファイル %s を %s の Mac 形式へ変換しています。\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "%s ファイル %s を %s の DOS 形式へ変換しています。\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "ファイル %s 変換中に問題が発生しました。\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "入力ファイル %s から読み込めません:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "オプション -i または --info に対する間違ったフラグ '%c' です。\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "有効なコードページ: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "無効な %s 変換モードが指定されました\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "オプション '%s' には引数が必要です。\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "無効な %s 表示エンコーディングが指定されました\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "対象ファイル %s が新規ファイルモードで指定されていません\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "入力ファイルから読み込めません: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "出力ファイルに書き込めません: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "エラー: 無効なサロゲートペアです。下位サロゲートがありません。\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "エラー: 無効なサロゲートペアです。上位サロゲートがありません。\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "UTF-16 ファイル %s をスキップしています。現在のロケールの文字エンコーディングは UTF-8 ではありません。\n" dos2unix-7.3.4/po/nb.po0000644000175500010010000005254512721132611014133 0ustar waterlanGeen# Norwegian (bokmål) translation of dos2unix. # Copyright (C) 2015 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # Åka Sikrom , 2015-2016. # msgid "" msgstr "" "Project-Id-Version: dos2unix-7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-22 13:26+0100\n" "Last-Translator: Åka Sikrom \n" "Language-Team: Norwegian Bokmaal \n" "Language: Norwegian Bokmål\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.5.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Opphavsrett (C) 2009-%d Erwin Waterlander\n" "Opphavsrett (C) 1998 Christian Wurll (Versjon 3.1)\n" "Opphavsrett (C) 1998 Bernd Johannes Wuebben (Versjon 3.0)\n" "Opphavsrett (C) 1994-1995 Benjamin Lin\n" "Alle rettigheter tilhører opphavsrettseieren.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Fant binærsymbol 0x00%02X på linje %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "programfeil: %d er en ugyldig konverteringsmodus\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Konvertert %u av %u linjeskift.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "bruker kodeside %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Fant binærsymbol 0x%02X på linje %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "feil: Verdien av miljøvariabelen DOS2UNIX_LOCALEDIR er for lang.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Opphavsrett (C) 2009-%d Erwin Waterlander\n" "Opphavsrett (C) 1994-1995 Benjamin Lin\n" "Alle rettigheter tilhører rettighetshaveren.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Du kan dele og/eller endre både kildekode og binærfiler, gitt at følgende\n" "vilkår oppfylles:\n" "1. Redistribuert kildekode må beholde opphavsrettsteksten som\n" " ligger ovenfor, samt denne lista over vilkår og følgende ansvarsfraskrivelse.\n" "2. Redistribuerte binærfiler må kunne produsere opphavsrettsteksten\n" " i dokumentasjonen og/eller i annet materiell som inngår i\n" " distribusjonen.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "DENNE PROGRAMVAREN TILBYS AV FORFATTEREN «SLIK DET ER», OG\n" "DET STILLES INGEN EKSPLISITT ELLER IMPLISITT GARANTI FOR AT DET EGNER\n" "SEG TIL NOE SOM HELST. UTVIKLEREN SKAL UNDER INGEN OMSTENDIGHETERREGNES SOM \n" "ANSVARLIG FOR DIREKTE, INDIREKTE, TILFELDIGE, SPESIELLE, EKSEMPLARISKE\n" "ELLER KONSEKVENTE SKADER (INLKUSIVE - MEN IKKE BEGRENSET TIL - INNKJØP\n" "AV RESERVEVARER ELLER -TJENESTER, TAP AV DATA, TAP AV FORTJENESTE, ELLER\n" "FORSTYRRELSE AV FORRETNINGER) UANSETT HVORDAN DETTE OPPSTÅR OG HVILKEN,\n" "TEORI OM SKYLD SOM BENYTTES I EVENTUELLE BERØRTE KONTRAKTER, OBJEKTIVT \n" "ANSVAR, ELLER TORT (UAKTSOMHET INKLUDERT) SOM OPPSTÅR VED BRUK AV DENNE \n" "PROGRAMVAREN, SELV NÅR VEDKOMMENDE ER INFORMERT OM AT SLIK SKADE KAN \n" "OPPSTÅ.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Bruk: %s [valg] [fil …] [-n inndatafil utdatafil …]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii bare konverter linjeskift (standard)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso konverter mellom tegnsettene DOS og ISO-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 bruk Windows-kodeside 1252 (Vesteuropeisk)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 bruk DOS-kodeside 437 (US) (standard)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 bruk DOS-kodeside 850 (vesteuropeisk)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 bruk DOS-kodeside 860 (portugisisk)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 bruk DOS-kodeside 863 (fransk-kanadisk)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 bruk DOS-kodeside 865 (nordisk)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 konverter 8-bit-tegn til 7-bit\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom behold «Byte Order»-merke\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom behold «Byte Order»-merke (standard)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode konverteringsmodus\n" " convmode ascii, 7bit, iso, mac (standardmodus er ascii)\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc endre koding av tekstmeldinger\n" " encoding ansi, unicode, utf8 (ansi er standard)\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force tving konvertering av binærfiler\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 konverter UTF-16 til GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help vis denne hjelpeteksten\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=FLAGG] vis informasjon om fil\n" " file … filer som skal undersøkes\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate behold utdata-filens dato\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license vis programvarelisens\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline legg til en ekstra ny linje\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom legg til «Byte Order»-merke (standard: UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile skriv til ny fil\n" " infile opprinnelig fil i ny fil-modus\n" " outfile utdata-fil i ny fil-modus\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile skriv til gammel fil (standard)\n" " file … filer som skal konverteres i gammel fil-modus\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet stillemodus, uten advarsler\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom fjern «Byte Order»-merke (standard)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom fjern «Byte Order»-merke\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe hopp over binærfiler (standard)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 behold UTF-16-koding\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le anta at inndata-formatet er UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be anta at inndata-formatet er UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose detaljert utskrift\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink følg symbolske lenker, og konverter lenkemål\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink erstatt symbolske lenker med konverterte filer\n" " (opprinnelig målfil forblir uendret)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink hold både symbolske lenker og lenkemål uendret (standard)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version vis versjonsnummer\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16-bit-versjon (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16-bit-versjon (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32-bit-versjon (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32-bit-versjon (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "MSYS-versjon.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Cygwin-versjon.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64-bit-versjon (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32-bit-versjon (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32-bit-versjon (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32-bit-versjon (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64-bit-versjon (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32-bit-versjon (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2-versjon (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "OS/2-versjon (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "%s-versjon.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Med støtte for Unicode UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Uten støtte for Unicode UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Med støtte for Unicode-filnavn.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Uten støtte for Unicode-filnavn.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Med innebygd språkstøtte.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "Sti til midlertidig utdatafil er for lang:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Skriver «Byte Order»-merke %s.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Inndatafil %s har %s BOM.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Forventer UTF-16LE-koding.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Forventer UTF-16BE-koding.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Klarte ikke å åpne midlertidig utdata-fil: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "bruker %s som midlertidig fil\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Klarte ikke å lukke inndatafil %s." #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Klarte ikke å skrive til midlertidig utdata-fil %s." #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Klarte ikke å endre rettigheter til midlertidig utdata-fil %s." #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Klarte ikke å endre eier og gruppetilhørighet for midlertidig utdata-fil %s." #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "det oppstod problemer med å følge den symbolske lenka «%s»\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " utdata-fil blir liggende i «%s»\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "det oppstod problemer med å gi «%s» det nye navnet «%s»." #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " som den symbolske lenka «%s» peker på\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Hopper over binærfil %s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "kodesiden %d støttes ikke.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Hopper over UTF-16-fil %s. Størrelsen på wchar_t er %d byte.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Hopper over UTF-16-fil %s. Det oppstod en UTF-16-konverteringsfeil på linje %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Hopper over fila %s. Konvertering av UTF-16 støttes ikke av denne versjonen av %s.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Hopper over %s, som ikke er en vanlig fil.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Hopper over %s. Utdata-fil %s er en symbolsk lenke.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Hopper over symbolsk lenke %s. Målet er ikke en vanlig fil.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Hopper over %s. Målet for symbolsk lenke %s er ikke en vanlig fil.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "konverterer fila %s til %s i Unix-format …\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "konverterer fila %s til %s Mac-format …\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "konverterer fila %s til %s i DOS-format …\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "konverterer %s-fila %s til %s-fila %s i Unix-format …\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "konverterer %s-fila %s til %s-fila %s i Mac-format …\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "konverterer %s-fila %s til %s-fila %s DOS-format …\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "det oppstod problemer under konvertering av fila %s til %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Hopper over symbolsk lenke %s.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "konverterer fila %s til Unix-format …\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "konverterer fila %s til Mac-format …\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "konverterer fila %s til DOS-format …\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "konverterer %s-fila %s til %s-Unix-format …\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "konverterer %s-fila %s til %s-Mac-format …\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "konverterer %s-fila %s til %s-DOS-format …\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "det oppstod problemer under konvertering av fila %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "klarte ikke å lese fra inndata-fil %s." #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "«%c» er et ugyldig flagg for -i (--info)\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "aktiv kodeside: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "du har valgt en ugyldig %s-konverteringsmodus\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "valget «%s» krever at du bruker et argument\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "du har valgt en ugyldig %s-koding\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "mål for fila %s er ikke valgt i ny fil-modus\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "klarte ikke å lese fra inndata-fil: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "klarte ikke å skrive til utdata-fil: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "feil: ugyldig surrogatpar. Nedre surrogat mangler.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "feil: ugyldig surrogatpar. Øvre surrogat mangler.\n" #~ msgid "has %s BOM.\n" #~ msgstr "har %s BOM.\n" #~ msgid "WINVER 0x%X\n" #~ msgstr "WINVER 0x%X\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "Hopper over UTF-16-fila «%s». Gjeldende lokaltilpasset tegnkoding er ikke UTF-8.\n" #~ msgid " -m, --add-bom add UTF-8 Byte Order Mark\n" #~ msgstr " -m, --add-bom legg til UTF-8 «Byte Order»-merke\n" dos2unix-7.3.4/po/nl.po0000644000175500010010000005240712721132611014142 0ustar waterlanGeen# Dutch translations for dos2unix, a DOS/Mac to Unix text-file format converter. # This file is distributed under the same license as the dos2unix package. # # Benno Schulenberg , 2014, 2015, 2016. # Erwin Waterlander , 2009-2014. msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-20 09:58+0200\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Dutch \n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Lokalize 1.0\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (versie 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (versie 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Alle rechten voorbehouden.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Binair teken 0x00%02X gevonden op regel %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "**programmafout**: ongeldige conversiemodus %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Er zijn %u van %u regeleindes geconverteerd.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "codetabel %d wordt gebruikt.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Binair teken 0x%02X gevonden op regel %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "fout: Waarde van omgevingsvariabele DOS2UNIX_LOCALEDIR is te lang.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Alle rechten voorbehouden.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Heruitgave en gebruik van de programmatekst en van de binaire vorm, al dan niet\n" "gewijzigd, zijn toegestaan mits aan de volgende voorwaarden voldaan is:\n" "1. Heruitgave van de programmatekst moet bovenstaande copyright-vermelding, deze\n" " lijst van voorwaarden, en onderstaande disclaimer behouden.\n" "2. Heruitgave in binaire vorm moet bovenstaande copyright-vermelding weergeven\n" " in de documentatie en/of andere materialen die bij de uitgave horen.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Gebruik: %s [opties] [bestand ...] [-n invoerbestand uitvoerbestand ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii alleen regeleindes converteren (standaard)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso converteren tussen de tekensets DOS en ISO-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 Windows-codetabel 1252 gebruiken (West-Europees)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 DOS-codetabel 437 gebruiken (VS) (standaard)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 DOS-codetabel 850 gebruiken (West-Europees)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 DOS-codetabel 860 gebruiken (Portugees)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 DOS-codetabel 863 gebruiken (Canadees Frans)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 DOS-codetabel 865 gebruiken (Scandinavisch)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 lettertekens met achtste bit gezet converteren naar spaties\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom een \"Byte Order Mark\" behouden\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom een \"Byte Order Mark\" behouden (standaard)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode te gebruiken conversiemodus\n" " MODUS 'ascii', '7bit', 'iso', of 'mac' (standaard is 'ascii')\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc te gebruiken codering voor getoonde berichten\n" " CODERING 'ansi', 'unicode', of 'utf8' (standaard is 'ansi')\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force conversie van binaire bestanden afdwingen\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 UTF-16 naar GB18030 converteren\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help deze hulptekst tonen\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=VLAGGEN] bestandsinformatie weergeven\n" " BESTAND... te analyseren bestand(en)\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate tijdsstempel van uitvoerbestand behouden\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license softwarelicentie tonen\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline extra regeleinde toevoegen\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom een \"Byte Order Mark\" toevoegen\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile naar een nieuw bestand schrijven\n" " INVOERBESTAND het originele bestand in nieuwbestand-modus\n" " UITVOERBESTAND het geconverteerde bestand in nieuwbestand-modus\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile het oude bestand overschrijven (standaard)\n" " BESTAND... te converteren bestand(en) in oudbestand-modus\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet alle waarschuwingen onderdrukken\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom een \"Byte Order Mark\" verwijderen (standaard)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom een \"Byte Order Mark\" verwijderen\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe binaire bestanden overslaan (standaard)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 UTF-16-codering behouden\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le aannemen dat de invoeropmaak UTF-16LE is\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be aannemen dat de invoeropmaak UTF-16BE is\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose gedetailleerde uitvoer produceren\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink symbolische koppelingen volgen en de doelen converteren\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink symbolische koppelingen vervangen door geconverteerde bestanden\n" " (de originele doelbestanden blijven ongewijzigd)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink symbolische koppelingen en doelen ongewijzigd laten (standaard)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version programmaversie tonen\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16-bits versie (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16-bits versie (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32-bits versie (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32-bits versie (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "MSYS-versie.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Cygwin-versie.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64-bits versie (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32-bits versie (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32-bits versie (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32-bits versie (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64-bits versie (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32-bits versie (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2-versie (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "OS/2-versie (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "%s-versie.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Met ondersteuning voor Unicode UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Zonder ondersteuning voor Unicode UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Met ondersteuning voor Unicode-bestandsnamen.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Zonder ondersteuning voor Unicode-bestandsnamen.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Met ondersteuning voor taalregio's.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "Pad voor tijdelijk uitvoerbestand is te lang:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Schrijven van %s-BOM.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Invoerbestand %s heeft een %s-BOM.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "UTF-16LE-codering wordt aangenomen.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "UTF-16BE-codering wordt aangenomen.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Kan tijdelijk uitvoerbestand niet openen: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "%s wordt als tijdelijk bestand gebruikt\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Sluiten van invoerbestand %s is mislukt:" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Kan niet schrijven naar tijdelijk uitvoerbestand %s:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Kan toegangsrechten van tijdelijk uitvoerbestand %s niet wijzigen:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Kan eigenaar en groep van tijdelijk uitvoerbestand %s niet wijzigen:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "problemen met het herleiden van symbolische koppeling '%s'\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " uitvoerbestand blijft in '%s'\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "problemen met hernoemen van '%s' naar '%s':" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " welke het doel is van symbolische koppeling '%s'\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Binair bestand %s wordt overgeslagen\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "Codetabel %d wordt niet ondersteund.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "UTF-16-bestand %s wordt overgeslagen; de grootte van 'wchar_t' is %d bytes.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "UTF-16-bestand %s wordt overgeslagen; er is een UTF-16-conversiefout opgetreden op regel %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "UTF-16-bestand %s wordt overgeslagen; UTF-16-conversie wordt niet ondersteund in deze versie van %s.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "%s wordt overgeslagen, omdat het geen regulier bestand is.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "%s wordt overgeslagen; uitvoerbestand %s is een symbolische koppeling.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Symbolische koppeling %s wordt overgeslagen, omdat het doel geen regulier bestand is.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "%s wordt overgeslagen, omdat het doel van symbolische koppeling %s geen regulier bestand is.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "converteren van bestand %s naar bestand %s in Unix-opmaak...\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "converteren van bestand %s naar bestand %s in Mac-opmaak...\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "converteren van bestand %s naar bestand %s in DOS-opmaak...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "converteren van bestand %2$s (%1$s) naar bestand %4$s (%3$s) in Unix-opmaak...\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "converteren van bestand %2$s (%1$s) naar bestand %4$s (%3$s) in Mac-opmaak...\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "converteren van bestand %2$s (%1$s) naar bestand %4$s (%3$s) in DOS-opmaak...\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "problemen met conversie van bestand %s naar bestand %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Symbolische koppeling %s wordt overgeslagen.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "converteren van bestand %s naar Unix-opmaak...\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "converteren van bestand %s naar Mac-opmaak...\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "converteren van bestand %s naar DOS-opmaak...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "converteren van bestand %2$s (%1$s) naar Unix-opmaak (%3$s)...\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "converteren van bestand %2$s (%1$s) naar Mac-opmaak (%3$s)...\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "converteren van bestand %2$s (%1$s) naar DOS-opmaak (%3$s)...\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "problemen met conversie van bestand %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "kan niet lezen uit invoerbestand %s:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "onjuiste vlag '%c' voor optie '-i' of '--info'\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "actieve codetabel: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "ongeldige conversiemodus %s opgegeven\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "optie '%s' vereist een argument\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "ongeldige weergavecodering %s opgegeven\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "doel van bestand %s is niet opgegeven in 'nieuwbestand-modus'\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "kan niet lezen uit invoerbestand: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "kan niet schrijven naar uitvoerbestand: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "fout: ongeldig surrogaatpaar -- het lage deel ontbreekt\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "fout: ongeldig surrogaatpaar -- het hoge deel ontbreekt\n" #~ msgid "has %s BOM.\n" #~ msgstr "heeft een %s-BOM.\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "UTF-16-bestand %s wordt overgeslagen; de tekencodering van de huidige taalregio is niet UTF-8.\n" dos2unix-7.3.4/po/pl.po0000644000175500010010000005270712721132611014147 0ustar waterlanGeen# Polish translation for dos2unix. # This file is distributed under the same license as the dos2unix package. # Jakub Bogusz , 2014-2016. # msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-13 15:20+0200\n" "Last-Translator: Jakub Bogusz \n" "Language-Team: Polish \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (wersja 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (wersja 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Wszelkie prawa zastrzeżone.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Napotkano symbol binarny 0x00%02X w linii %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "błąd programu, błędny tryb konwersji %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Przekonwertowano znaków końca linii: %u z %u.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "użycie strony kodowej %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Napotkano symbol binarny 0x%02X w linii %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "błąd: wartość zmiennej środowiskowej DOS2UNIX_LOCALEDIR jest zbyt długa.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Wszelkie prawa zastrzeżone.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Rozpowszechnianie i wykorzystywanie w postaci źródłowej i binarnej,\n" "z lub bez modyfikacji, jest dozwolone pod warunkiem zachowania\n" "następujących warunków:\n" "1. Przy rozprowadzaniu kodu źródłowego musi być zachowana powyższa\n" " informacja o prawach autorskich, niniejsza lista warunków oraz\n" " poniższe oświadczenie.n2. Przy rozprowadzaniu w postaci binarnej powyższa informacja o prawach\n" " autorskich musi być dołączona w dokumentacji i/lub innych materiałach\n" " dołączonych do dystrybucji.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "TO OPROGRAMOWANIE JEST UDOSTĘPNIONE PRZEZ AUTORA \"JAKO TAKIE\", BEZ\n" "ŻADNEJ WYRAŻONEJ ANI DOMNIEMANEJ GWARANCJI, W TYM, ALE NIE TYLKO,\n" "DOMNIEMANEJ GWARANCJI SPRZEDAWALNOŚCI ANI PRZYDATNOŚCI DO KONKRETNYCH\n" "CELÓW. AUTOR W ŻADEN SPOSÓB NIE ODPOWIADA ZA ŻADNE BEZPOŚREDNIE,\n" "NIEBEZPOŚREDNIE, PRZYPADKOWE, NADZWYCZAJNE, PRZYKŁADOWE ANI WYNIKOWE\n" "STRATY (W TYM MIĘDZY INNYMI: DOSTARCZENIE ZAMIENNIKÓW TOWARÓW LUB\n" "USŁUG; UTRATĘ ZASTOSOWAŃ, DANYCH LUB ZYSKÓW; PRZERW W PRACY) SPOWODOWANE\n" "W JAKIKOLWIEK SPOSÓB I NA PODSTAWIE ODPOWIEDZIALNOŚCI UMOWNEJ, CAŁKOWITEJ\n" "LUB DELIKTOWEJ (W TYM WYNIKŁEJ Z NIEDBALSTWA I INNYCH POWODÓW), POWSTAŁE\n" "W JAKIKOLWIEK SPOSÓB W WYNIKU UŻYCIA TEGO OPROGRAMOWANIA, NAWET JEŚLI\n" "OSTRZEŻONO O MOŻLIWOŚCI TAKICH SZKÓD.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Składnia: %s [opcje] [plik ...] [-n plik_wej plik_wyj ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii konwersja tylko końców linii (domyślne)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso konwersja między zestawem znaków DOS-a i ISO-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 użycie strony kodowej Windows 1252 (zachodnioeuropejskiej)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 użycie strony kodowej DOS 437 (US; domyślna)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 użycie strony kodowej DOS 850 (zachodnioeuropejskiej)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 użycie strony kodowej DOS 860 (portugalskiej)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 użycie strony kodowej DOS 863 (kanadyjskiej francuskiej)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 użycie strony kodowej DOS 865 (nordyckiej)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 konwersja znaków 8-bitowych do przestrzeni 7-bitowej\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom zachowanie znacznika BOM (Byte Order Mark)\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom zachowanie znacznika BOM (Byte Order Mark) (domyślne)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode tryb konwersji\n" " tryb konwersji ascii, 7bit, iso, mac; domyślnie ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc ustawienie kodowania wyświetlanych komunikatów\n" " kodowanie ansi, unicode, utf8; domyślnie ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force wymuszenie konwersji plików binarnych\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 konwersja UTF-16 do GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help wyświetlenie tego opisu\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=FLAGI] wyświetlenie informacji o pliku\n" " plik ... pliki do analizy\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate zachowanie daty pliku wyjściowego\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license wyświetlenie licencji oprogramowania\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline dodanie dodatkowego znaku nowej linii\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom dodanie znacznika BOM (domyślnie UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile zapis do nowego pliku\n" " plik_wej plik oryginalny w trybie nowego pliku\n" " plik_wyj plik wyjściowy w trybie nowego pliku\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile zapis do starego pliku (domyślne)\n" " plik ... pliki do konwersji w trybie starego pliku\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet tryb cichy, pominięcie wszystkich ostrzeżeń\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom usunięcie znacznika BOM (Byte Order Mark) (domyślne)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom usunięcie znacznika BOM (Byte Order Mark)\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe pomijanie plików binarnych (domyślne)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 zachowanie kodowania UTF-16\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le przyjęcie formatu pliku wejściowego UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be przyjęcie formatu pliku wejściowego UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose działanie ze szczegółowym opisem\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink podążanie za dowiązaniami symbolicznymi i konwersja celów\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink zastępowanie dowiązań symbolicznych plikami wynikowymi\n" " (oryginalne pliki docelowe pozostają bez zmian)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink bez zmian dowiązań symbolicznych i celów (domyślne)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version wyświetlenie numeru wersji\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "Wersja 16-bitowa DOS (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "Wersja 16-bitowa DOS (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "Wersja 32-bitowa DOS (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "Wersja 32-bitowa DOS (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "Wersja MSYS.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Wersja Cygwin.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Wersja 64-bitowa Windows (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Wersja 32-bitowa Windows (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Wersja 32-bitowa Windows (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Wersja 32-bitowa Windows (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Wersja 64-bitowa Windows (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Wersja 32-bitowa Windows (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "Wersja OS/2 (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "Wersja OS/2 (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "Wersja %s.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Z obsługą Unicode UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Bez obsługi Unicode UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Z obsługą nazw plików w Unicode.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Bez obsługi nazw plików w Unicode.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Z obsługą języków narodowych.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "Ścieżka do tymczasowego pliku wyjściowego jest zbyt długa:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Zapis znacznika BOM %s.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Plik wejściowy %s zawiera znacznik BOM %s.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Przyjęto kodowanie UTF-16LE.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Przyjęto kodowanie UTF-16BE.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Nie udało się otworzyć tymczasowego pliku wyjściowego: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "użycie %s jako pliku tymczasowego\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Nie udało się zamknąć pliku wejściowego %s:" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Nie udało się zapisać do tymczasowego pliku wyjściowego %s:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Nie udało się zmienić uprawnień tymczasowego pliku wyjściowego %s:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Nie udało się zmienić właściciela i grupy tymczasowego pliku wyjściowego %s:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "problemy z rozwiązaniem dowiązania symbolicznego '%s'\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " plik wyjściowy pozostaje w '%s'\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "problemy ze zmianą nazwy '%s' na '%s':" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " (czyli cel dowiązania symbolicznego '%s')\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Pominięto plik binarny %s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "strona kodowa %d nie jest obsługiwana.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Pominięto plik UTF-16 %s, rozmiar wchar_t to %d bajt(y).\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Pominięto plik UTF-16 %s, wystąpił błąd konwersji UTF-16 w linii %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Pominięto plik UTF-16 %s, konwersja UTF-16 nie jest obsługiwana w tej wersji programu %s.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Pominięto %s, nie jest zwykłym plikiem.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Pominięto %s, plik wyjściowy %s jest dowiązaniem symbolicznym.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Pominięto dowiązanie symboliczne %s, cel nie jest zwykłym plikiem.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Pominięto %s, cel dowiązania symbolicznego %s nie jest zwykłym plikiem.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "konwersja pliku %s do pliku %s w formacie uniksowym...\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "konwersja pliku %s do pliku %s w formacie Mac...\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "konwersja pliku %s do pliku %s w formacie DOS...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "konwersja pliku %s %s do pliku %s %s w formacie uniksowym...\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "konwersja pliku %s %s do pliku %s %s w formacie Mac...\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "konwersja pliku %s %s do pliku %s %s w formacie DOS...\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "problemy z konwersją pliku %s do pliku %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Pominięto dowiązanie symboliczne %s.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "konwersja pliku %s do formatu uniksowego...\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "konwersja pliku %s do formatu Mac...\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "konwersja pliku %s do formatu DOS...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "konwersja pliku %s %s do formatu uniksowego %s...\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "konwersja pliku %s %s do formatu Mac %s...\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "konwersja pliku %s %s do formatu DOS %s...\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "problemy z konwersją pliku %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "nie można czytać z pliku wejściowego %s:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "błędna flaga '%c' dla opcji -i lub --info\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "aktywna strona kodowa: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "podano błędny tryb konwersji %s\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "opcja '%s' wymaga argumentu\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "podano błędne kodowanie wyświetlania %s\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "nie podano celu pliku %s w trybie nowego pliku\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "nie można czytać z pliku wejściowego: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "nie można zapisać do pliku wyjściowego: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "błąd: Błędna para zamienna. Brak młodszego zamiennika.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "błąd: Błędna para zamienna. Brak starszego zamiennika.\n" dos2unix-7.3.4/po/pt_BR.po0000644000175500010010000005500712721132613014540 0ustar waterlanGeen# Brazilian Portuguese Translation for dos2unix. # Copyright (C) 2016 Erwin Waterlander (msgids) # Copyright (C) 2016 Free Software Foundation, Inc. # This file is distributed under the same license as the dos2unix package. # Enrico Nicoletto , 2014. # Rafael Fontenelle , 2014, 2015, 2016. msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-15 17:44-0200\n" "Last-Translator: Rafael Fontenelle \n" "Language-Team: Brazilian Portuguese \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Virtaal 0.7.1\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Versão 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Versão 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Todos os direitos reservados.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Símbolo binário 0x00%02X localizado na linha %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "erro do programa, modo de conversão %d é inválido\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Convertidas %u de %u quebras de linha.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "usando a página de código %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Símbolo binário 0x%02X localizado na linha %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "erro: O valor da variável de ambiente DOS2UNIX_LOCALEDIR é muito comprido.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Todos os direitos reservados.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "A redistribuição e o uso nas formas de código e binária, com ou sem\n" "alterações, são permitidas desde que sejam atendidas as condições\n" "que se seguem:\n" "1. As redistribuições de código-fonte devem reter os avisos de direitos\n" " autorais acima, a lista de condições e a renúncia a seguir.\n" "2. As redistribuições na forma binária devem reproduzir o aviso de\n" " direitos autorais acima na documentação e/ou outros materiais\n" " fornecidos com a distribuição.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "ESTE SOFTWARE É FORNECIDO PELO AUTOR ``COMO ESTÁ'' E SEM\n" "QUAISQUER GARANTIAS EXPRESSAS OU IMPLÍCITAS, INCLUINDO, MAS NÃO LIMITADO A,\n" "IMPLICAR GARANTIAS DE COMERCIALIZAÇÃO E ADEQUAÇÃO A UM FIM ESPECÍFICO,\n" "ESTAS SÃO RENUNCIADAS. SOB NENHUM CASO O AUTOR DEVE SER CONSIDERADO RESPONSÁVEL POR\n" "QUALQUER DANO DIRETO, INDIRETO, ACIDENTAL, ESPECIAL, EXEMPLAR, OU\n" "CONSEQUENCIAL (INCLUINDO, MAS NÃO LIMITADO A, AQUISIÇÃO\n" "DE BENS SUBSTITUTOS OU SERVIÇOS; PERDA DE USO, DADOS, OU LUCROS; OU\n" "INTERRUPÇÃO DE NEGÓCIOS) CAUSADOS E SOB QUALQUER TEORIA DE RESPONSABILIZAÇÃO,\n" "SEJA CONTRATUAL, RESPONSABILIZAÇÃO ESTRITA, OU AGRAVO (INCLUINDO NEGLIGÊNCIA\n" "OU OUTRAS FORMAS) LEVANTADAS EM QUALQUER FORMA FORA DO USO DESTE SOFTWARE, MESMO\n" "SE RESSALVADO DA POSSIBILIDADE DE TAL DANO.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Uso: %s [opções] [arquivo ...] [-n arquivo_entrada arquivo_saida ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii converte-se apenas as quebras de linha (padrão)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso conversão entre conjunto de caractere do DOS e ISO-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 usa a página de código 1252 do Windows (Europa ocidental)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 usa a página de código 437 do DOS (EUA) (padrão)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 usa a página de código 850 do DOS (Europa ocidental)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 usa a página de código 860 do DOS (Português)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 usa a página de código 863 do DOS (Francês do Canadá)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 usa a página de código 865 do DOS (Nórdico)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 converte-se caracteres de 8 bit para espaço de 7 bit\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom mantém marca de ordem de byte (B.O.M.)\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom mantém marca de ordem de byte (B.O.M.) (padrão)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode modo de conversão\n" " convmode ascii, 7bit, iso, mac, padrão para ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc define codificação das mensagens de texto exibidas\n" " codificação ansi, unicode, utf8, sendo padrão o ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force força a conversão de arquivos binários\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 converte-se de UTF-16 para GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help exibe este texto de ajuda\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=OPÇÕES] exibe informação do arquivo\n" " file ... arquivos para analisar\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate mantém a data do arquivo de saída\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license exibe a licença do software\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline acrescenta nova linha adicional\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom adiciona marca de ordem de byte (B.O.M.) (padrão UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile grava em novo arquivo\n" " infile arquivo original no modo de novo arquivo\n" " outfile arquivo de saída no modo de novo arquivo\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile grava no arquivo antigo (padrão)\n" " file ... arquivos a converter no modo de arquivo antigo\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet modo silencioso, esconde todos os avisos\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom remove marca de ordem de byte (B.O.M.) (default)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom remove marca de ordem de byte (B.O.M.)\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe ignora os arquivos binários (padrão)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 mantém codificação UTF-16\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le supõe que o formato de entrada é UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be supõe que o formato de entrada é UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose operação detalhada\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink segue os links simbólicos e converte os destinos\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink substitui os links simbólicos por arquivos convertidos\n" " (os arquivos originais de destino permanecem inalterados)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink mantém os links simbólicos e os destinos inalterados (padrão)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version exibe o número da versão\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS versão de 16 bit (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS versão de 16 bit (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS versão de 32 bit (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS versão de 32 bit (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "Versão do MSYS.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Versão do Cygwin.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows versão de 64 bit (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows versão de 32 bit (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows versão de 32 bit (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows versão de 32 bit (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows versão de 64 bit (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows versão de 32 bit (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "Versão OS/2 (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "Versão OS/2 (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "Versão %s.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Com suporte a Unicode UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Sem suporte a Unicode UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Com suporte a nomes de arquivos em Unicode UTF-16.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Sem suporte a nomes de arquivos em Unicode UTF-16.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Com suporte ao idioma nativo.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "O caminho do arquivo de saída temporário é muito grande:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Escrevendo %s BOM.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Arquivo de entrada %s possui %s BOM.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Presume codificação UTF-16LE.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Presumo codificação UTF-16BE.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Falha ao abrir o arquivo de saída temporário: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "usando %s como arquivo de temporário\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Falha ao fechar o arquivo de entrada %s:" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Falha ao gravar no arquivo de saída temporário %s:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Falha ao alterar as permissões do arquivo de saída temporário %s:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Falha ao alterar o proprietário e o grupo do arquivo de saída temporário %s:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "ocorreram problemas ao determinar o link simbólico '%s'\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " o arquivo de saída permanece em '%s'\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "ocorreram problemas ao renomear '%s' para '%s':" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " que é o destino do link simbólico '%s'\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Ignorando o arquivo binário %s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "não há suporte a página de código %d.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Ignorando o arquivo UTF-16 %s, o tamanho de wchar_t é de %d bytes.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Ignorando o arquivo UTF-16 %s, ocorreu um erro de conversão para UTF-16 na linha %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Ignorando o arquivo UTF-16 %s, não há suporte a conversão para UTF-16 nesta versão do %s.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Ignorando %s, não é um arquivo comum.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Ignorando %s, o arquivo de saída %s é um link simbólico.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Ignorando o link simbólico %s, o destino não é o de um arquivo comum.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Ignorando %s, o destino do link simbólico %s não é o de um arquivo comum.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "convertendo o arquivo %s para arquivo %s no formato Unix...\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "convertendo o arquivo %s para arquivo %s no formato Mac...\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "convertendo o arquivo %s para arquivo %s no formato DOS...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "convertendo o arquivo %s %s para arquivo %s %s no formato Unix...\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "convertendo o arquivo %s %s para arquivo %s %s no formato Mac...\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "convertendo o arquivo %s %s para arquivo %s %s no formato DOS...\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "ocorreram problemas ao converter o arquivo %s para arquivo %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Ignorando o link simbólico %s.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "convertendo o arquivo %s para formato Unix...\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "convertendo o arquivo %s para formato Mac...\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "convertendo o arquivo %s para formato DOS...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "convertendo o arquivo %s %s para formato do Unix %s...\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "convertendo o arquivo %s %s para formato do Mac %s...\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "convertendo o arquivo %s %s para formato do DOS %s...\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "ocorreram problemas ao converter o arquivo %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "não foi possível gravar no arquivo de entrada %s:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "opção incorreta \"%c\" para opção -i ou --info\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "página de código ativa: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "o modo de conversão %s especificado é inválido\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "a opção '%s' requer um argumento\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "a codificação de exibição %s especificada é inválida\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "o destino do arquivo %s não foi especificado no modo de novo arquivo\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "não foi possível ler do arquivo de saída: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "não foi possível gravar no arquivo de saída: %s\n" # "surrogate pair" é um termo do UTF-16, havendo traduções na Internet surrogate=substituto #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "erro: par de substitutos inválido. Faltando substituto baixo.\n" # "surrogate pair" é um termo do UTF-16, havendo traduções na Internet surrogate=substituto #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "erro: par de substitutos inválido. Faltando substituto alto.\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "Ignorando o arquivo UTF-16 %s, a atual codificação local de caractere não é UTF-8.\n" #~ msgid " -m, --add-bom add UTF-8 Byte Order Mark\n" #~ msgstr " -m, --add-bom adiciona marca de ordem de byte (B.O.M.) UTF-8\n" dos2unix-7.3.4/po/ru.po0000644000175500010010000006323012721132611014153 0ustar waterlanGeen# Russian messages for dos2unix. # Copyright (C) 2014 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # # Andrei Uhlik , 2013. # Yuri Kozlov , 2014, 2015, 2016. msgid "" msgstr "" "Project-Id-Version: dos2unix-7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-14 07:46+0300\n" "Last-Translator: Yuri Kozlov \n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Lokalize 1.5\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Авторское право (C) 2009-%d Erwin Waterlander\n" "Авторское право (C) 1998 Christian Wurll (версия 3.1)\n" "Авторское право (C) 1998 Bernd Johannes Wuebben (версия 3.0)\n" "Авторское право (C) 1994-1995 Benjamin Lin\n" "Все права защищены.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "В строке %2$u обнаружен двоичный символ 0x00%1$02X\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "ошибка в программе, неверный режим преобразования %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Преобразовано %u из %u разрывов строки.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "используется кодировка %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "В строке %2$u обнаружен двоичный символ 0x%1$02X\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "ошибка: Значение переменной окружения DOS2UNIX_LOCALEDIR слишком длинное.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Авторское право (C) 2009-%d Erwin Waterlander\n" "Авторское право (C) 1994-1995 Benjamin Lin\n" "Все права защищены.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Использование: %s [параметры] [файл …] [-n входной_файл выходной_файл …]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii преобразовать только конец строки (по умолчанию)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso преобразовать DOS в ISO-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 использовать кодировку Windows 1252 (Западно-Европейский)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 использовать кодировку DOS 437 (US) (по умолчанию)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 использовать кодировку DOS 850 (Западно-Европейский)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 использовать кодировку DOS 860 (Португальский)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 использовать кодировку DOS 863 (Франко-Канадский)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 использовать кодировку DOS 865 (Скандинавский)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 преобразовать 8-битные символы в 7-битные\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom сохранить метку порядка байтов (BOM)\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom сохранить метку порядка байтов (BOM)(по умолчанию)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode режим преобразования\n" " convmode ascii, 7bit, iso, mac, по умолчанию в ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc задать кодировку отображаемых текстовых сообщений\n" " encoding ansi, unicode, utf8, по умолчанию ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force управление преобразованием двоичных файлов\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 преобразовать UTF-16 в GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help показать справку\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=ФЛАГИ] показать информацию о файле\n" " файл … файлы для анализа\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate сохранить дату выходного файла\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license отобразить лицензию программного обеспечения\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline добавить дополнительный разделитель строк\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom добавить метку порядка байтов (по умолчанию в UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile записать в новый файл\n" " infile исходный файл в режиме нового файла\n" " outfile выходной файл в режиме нового файла\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile записать в старый файл (по умолчанию)\n" " file … файлы для преобразования в режиме старого файла\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet не показывать предупреждения\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom удалить метку порядка байтов (BOM) (по умолчанию)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom удалить метку порядка байтов (BOM)\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe пропустить двоичные файлы (по умолчанию)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 оставить кодировку UTF-16\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le предположить, что входной формат UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be предположить, что входной формат UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose подробный режим\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink следовать символическим ссылкам и преобразовать цели\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink заменить символические ссылки преобразованными файлами\n" " (оригинальные целевые файлы останутся без изменений)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink оставить символические ссылки и цели без изменений (по умолчанию)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version отобразить номер версии\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "Версия для DOS, 16-битная (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "Версия для DOS, 16-битная (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "Версия для DOS, 32-битная (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "Версия для DOS, 32-битная (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "Версия с MSYS.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Версия с Cygwin.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Версия для Windows, 64-битная (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Версия для Windows, 32-битная (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Версия для Windows, 32-битная (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Версия для Windows, 32-битная (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Версия для Windows, 64-битная (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Версия для Windows, 32-битная (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "Версия для OS/2 (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "Версия для OS/2 (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "Версия для %s.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "С поддержкой Юникода UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Без поддержки Юникода UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "С поддержкой имён файлов в Юникоде.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Без поддержки имён файлов в Юникоде.\n" #: common.c:727 msgid "With native language support.\n" msgstr "С поддержкой родного языка.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "Слишком длинный путь для временного выходного файла:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Записывается %s BOM.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Входной файл %s содержит %s BOM.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Предполагается кодировка UTF-16LE.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Предполагается кодировка UTF-16BE.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Не удалось открыть временный выходной файл: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "использование %s в качестве временного файла\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Не удалось закрыть входной файл %s:" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Не удалось записать во временный выходной файл %s:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Не удалось изменить права доступа ко временному выходному файлу %s:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Не удалось изменить владельца и группу временного выходного файла %s:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "конфликт при разрешении символической ссылки «%s»\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " выходной файл остаётся в «%s»\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "проблемы при переименовании «%s» в «%s»:" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " который является целью символической ссылки «%s»\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Пропуск двоичного файла %s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "кодовая страница %d не поддерживается.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Пропуск файла %s с UTF-16, размер wchar_t составляет %d байт.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Пропуск файла %s с UTF-16, возникла ошибка преобразования UTF-16 в строке %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Пропуск файла %s с UTF-16, преобразование UTF-16 не поддерживается в этой версии %s.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Пропуск %s, не является обычным файлом.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Пропуск %s, выходной файл %s является символической ссылкой.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Пропуск символической ссылки %s, цель не является обычным файлом.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Пропуск %s, цель символической ссылки %s не является обычным файлом.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "преобразование файла %s в файл %s в формат Unix…\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "преобразование файла %s в файл %s в формат Mac…\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "преобразование файла %s в файл %s в формат DOS…\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "преобразование %s из файла %s в %s (файл %s) в формат Unix…\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "преобразование %s из файла %s в %s (файл %s) в формат Mac…\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "преобразование %s из файла %s в %s (файл %s) в формат DOS…\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "проблемы при преобразовании файла %s в файл %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Пропуск символической ссылки %s.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "преобразование файла %s в формат Unix…\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "преобразование файла %s в формат Mac…\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "преобразование файла %s в формат DOS…\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "преобразование %s из файла %s в %s формат Unix…\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "преобразование %s из файла %s в %s формат Mac…\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "преобразование %s из файла %s в %s формат DOS…\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "проблемы при преобразовании файла %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "не удалось прочитать из входного файла %s:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "некорректный флаг «%c» для параметра -i или --info\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "активная кодовая страница: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "задан неправильный %s режим преобразования\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "для параметра «%s» требуется аргумент\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "задана неправильная кодировка отображения (%s)\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "цель файла %s не задана в режиме нового файла\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "не удалось прочитать из входного файла: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "не удалось записать в выходной файл: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "ошибка: некорректная суррогатная пара. Отсутствует младший суррогат.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "ошибка: некорректная суррогатная пара. Отсутствует старший суррогат.\n" #~ msgid "has %s BOM.\n" #~ msgstr "содержит %s BOM.\n" #~ msgid "WINVER 0x%X\n" #~ msgstr "WINVER 0x%X\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "Пропуск файла %s с UTF-16, текущая символьная кодировка не UTF-8.\n" #~ msgid " -m, --add-bom add UTF-8 Byte Order Mark\n" #~ msgstr " -m, --add-bom добавить UTF-8 метку порядка байтов (BOM)\n" dos2unix-7.3.4/po/sr.po0000644000175500010010000006475712721132612014171 0ustar waterlanGeen# Serbian translation for dos2unix. # Copyright (C) 2014 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # Мирослав Николић , 2014—2016. msgid "" msgstr "" "Project-Id-Version: dos2unix-7.3.3-beta2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:42+0200\n" "PO-Revision-Date: 2016-03-05 09:17+0200\n" "Last-Translator: Мирослав Николић \n" "Language-Team: Serbian <(nothing)>\n" "Language: sr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Ауторска права © 2009-%d Ервин Вотерландер\n" "Ауторска права © 1998 Кристиан Вирл (издање 3.1)\n" "Ауторска права © 1998 Берн Јохан Вјебен (Version 3.0)\n" "Ауторска права © 1994-1995 Бенџамин Лин\n" "Сва права су задржана.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Бинарни симбол 0x00%02X је пронађен у %u. реду\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "програмска грешка, неисправан режим претварања %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Претворио сам %u од %u прекида реда.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "користим кодну страницу %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Бинарни симбол 0x%02X је пронађен у %u. реду\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "грешка: Вредност променљиве окружења „ДОС2UNIX_LOCALEDIR“ је предуга.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Ауторска права © 2009-%d Ервин Вотерландер\n" "Ауторска права © 1994-1995 Бенџамин Лин\n" "Сва права су задржана.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Прерасподела и употреба у изворном и бинарном облику, са или без измена, су дозвољене ако су задовољени следећи услови:\n" "1. Расподела изворног кода мора да садржи горње обавештење о ауторском праву, овај списак услова и следећи опозив.\n" "2. Расподела у бинарном облику мора да понови обавештење горе наведеног ауторског права у документацији и/или у другом материјалу који долази уз дистрибуцију.\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "ОВАЈ СОФТВЕР АУТОР ДОСТАВЉА „ТАКВИМ КАКАВ ЈЕСТЕ“ И СВЕ ИЗРАЖЕНЕ\n" "ИЛИ ПРИМЕЊЕНЕ ГАРАНЦИЈЕ, УКЉУЧУЈУЋИ, АЛИ НЕ ОГРАНИЧАВАЈУЋИ СЕ НА,\n" "ПРИМЕЊЕНЕ ГАРАНЦИЈЕ ТРЖИШНЕ ВРЕДНОСТИ И ПРИЛАГОЂЕНОСТИ ОДРЕЂЕНОЈ\n" "НАМЕНИ СУ ОДБАЧЕНЕ. НИ У КОМ СЛУЧАЈУ НЕЋЕ АУТОР БИТИ ОДГОВОРАН ЗА\n" "БИЛО КАКВУ НЕПОСРЕДНУ, ПОСРЕДНУ, СЛУЧАЈНУ, ПОСЕБНУ, ПРИМЕРНУ, ИЛИ\n" "ПОСЛЕДИЧНУ ШТЕТУ (УКЉУЧУЈУЋИ, АЛИ НЕ ОГРАНИЧАВАЈУЋИ СЕ НА, ДОБАВЉАЊЕ\n" "ЗАМЕНСКИХ ДОБАРА ИЛИ УСЛУГА; ГУБИТАК УПОТРЕБЕ, ПОДАТАКА, ИЛИ ЗАРАДЕ;\n" "ИЛИ ПРЕКИД ПОСЛОВАЊА) БИЛО КАКО ИЗАЗВАНУ И ПРИ ТЕОРИЈИ ОДГОВОРНОСТИ,\n" "БИЛО У УГОВОРУ, ОБЈЕКТИВНОЈ ОДГОВОРНОСТИ, ИЛИ У КРИВУ (УКЉУЧУЈУЋИ\n" "НЕПАЖЊУ ИЛИ ДРУГО) ДОВОДЕЋИ НА БИЛО КОЈИ НАЧИН ДО ПРЕКИДА УПОТРЕБЕ\n" "ОВОГ СОФТВЕРА, ЧАК И АКО СТЕ ОБАВЕШТЕНИ О МОГУЋНОСТИ ТАКВИХ ШТЕТА.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Употреба: %s [опције] [датотека ...] [-n ул.датотека изл.датотека ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii претвара само прекиде реда (основно)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso претварање између скупа знакова ДОС-а и ИСО-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 користи Виндоуз кодну страницу 1252 (западно-европски)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 користи ДОС кодну страницу 437 (САД) (основно)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 користи ДОС кодну страницу 850 (западно-европски)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 користи ДОС кодну страницу 860 (португалски)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 користи ДОС кодну страницу 863 (канадски француски)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 користи ДОС кодну страницу 865 (норвешки)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 претвара 8-битне знакове у 7-битне размаке\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom задржава назнаку поретка бајта\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom задржава назнаку поретка бајта (основно)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode режим претварања\n" " режим претварања аскри, 7бита, исо, мек, подразумева аскри\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc подешава кодирање приказаних порука текста\n" " кодирање „ansi“, „unicode“, „utf8“, основно је „ansi“\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force присиљава претварање бинарних датотека\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 претвара УТФ-16 у ГБ18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help приказује овај текст помоћи\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=ЗАСТАВЕ] приказује податке о датотеци\n" " file ... датотеке за анализу\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate задржава датум излазне датотеке\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license приказује дозволу софтвера\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline додаје додатни нови ред\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom додаје назнаку поретка бајта (основно УТФ-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile пише у нову датотеку\n" " улазна датотека изворна датотека у режиму нове датотеке\n" " излазна датотека излазна датотека у режиму нове датотеке\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile пише у стару датотеку (основно)\n" " датотека ... датотеке за претварање у режиму старе датотеке\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet тихи режим, потискује сва упозорења\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom уклања назнаку поретка бајта (основно)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom уклања назнаку поретка бајта\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe прескаче бинарне датотеке (основно)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 задржава УТФ-16 кодирање\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le подразумева да је улазни запис „UTF-16LE“\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be подразумева да је улазни запис „UTF-16BE“\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose опширне радње\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink прати симболичке везе и претвара мете\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink замењује симболичке везе претвореним датотекама\n" " (изворне датотеке мете остају непромењене)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink задржава неизмењеним симболичке везе и мете (основно)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version приказује број издања\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "ДОС 16-битно издање (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "ДОС 16-битно издање (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "ДОС 32-битно издање (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "ДОС 32-битно издање (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "МСИС издање.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Цигвин издање.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Виндоуз 64-битно издање (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Виндоуз 32-битно издање (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Виндоуз 32-битно издање (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Виндоуз 32-битно издање (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Виндоуз 64-битно издање (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Виндоуз 32-битно издање (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "ОС/2 издање (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "ОС/2 издање (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "%s издање.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Са подршком Јуникода УТФ-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Без подршке Јуникода УТФ-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Са подршком назива датотеке Јуникода.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Без подршке назива датотеке Јуникода.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Са подршком матерњег језика.\n" #: common.c:861 #, fuzzy msgid "Path for temporary output file is too long:" msgstr "Нисам успео да пишем у привремену излазну датотеку „%s“:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Записујем %s НПБ-а.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "УТФ-16ЛЕ" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "УТФ-16БЕ" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "ГБ18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "УТФ-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Улазна датотека „%s“ има %s НПБ-а.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Подразумевам УТФ-16ЛЕ кодирање.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Подразумевам УТФ-16БЕ кодирање.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Нисам успео да отворим привремену излазну датотеку: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "користим „%s“ као привремену датотеку\n" #: common.c:1499 common.c:2158 #, fuzzy, c-format msgid "Failed to close input file %s:" msgstr "Нисам успео да отворим привремену излазну датотеку: %s\n" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Нисам успео да пишем у привремену излазну датотеку „%s“:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Нисам успео да изменим овлашћења привремене излазне датотеке „%s“:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Нисам успео да изменим власника и групу привремене излазне датотеке „%s“:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "проблеми решавања симболичке везе „%s“\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " излазна датотека остаје у „%s“\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "проблеми преименовања „%s“ у „%s“:" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " који је мета симболичке везе „%s“\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Прескачем бинарну датотеку „%s“\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "Кодна страница „%d“ није подржана.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Прескачем УТФ-16 датотеку „%s“, величина „wchar_t“-а је %d бајта.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Прескачем УТФ-16 датотеку „%s“, дошло је од грешке УТФ-16 претварања у %u. реду.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Прескачем УТФ-16 датотеку „%s“, УТФ-16 претварање није подржано у овом издању „%s“.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Прескачем „%s“, није обична датотека.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Прескачем „%s“, излазна датотека „%s“ је симболичка веза.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Прескачем симболичку везу „%s“, мета није обична датотека.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Прескачем „%s“, мета симболичке везе „%s“ није обична датотека.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "претварам датотеку „%s“ у датотеку „%s“ у запису Јуникса...\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "претварам датотеку „%s“ у датотеку „%s“ у запису Мека...\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "претварам датотеку „%s“ у датотеку „%s“ у запису ДОС-а...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "претварам %s датотеку „%s“ у %s датотеку „%s“ у запису Јуникса...\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "претварам %s датотеку „%s“ у %s датотеку „%s“ у запису Мека...\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "претварам %s датотеку „%s“ у %s датотеку „%s“ у запису Дос-а...\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "проблеми претварања датотеке „%s“ у датотеку „%s“\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Прескачем симболичку везу „%s“.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "претварам датотеку „%s“ у запису Јуникса...\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "претварам датотеку „%s“ у запису Мека...\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "претварам датотеку „%s“ у запису ДОС-а...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "претварам %s датотеку „%s“ у %s запис Јуникса...\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "претварам %s датотеку „%s“ у %s запис Мека...\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "претварам %s датотеку „%s“ у %s запис Дос-а...\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "проблеми претварања датотеке „%s“\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "не могу да читам из улазне датотеке „%s“:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "погрешна заставица „%c“ за опцију „-i“ или „--info“\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "радна кодна страница: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "наведен је неисправан „%s“ режим претварања\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "опција „%s“ захтева аргумент\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "наведено је неисправно кодирање „%s“ приказа\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "мета датотеке „%s“ није наведена у режиму нове датотеке\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "не могу да читам из улазне датотеке: „%s“\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "не могу да пишем у излазну датотеку: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "грешка: Неисправан пар надометка. Недостаје нижи надометак.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "грешка: Неисправан пар надометка. Недостаје виши надометак.\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "Прескачем УТФ-16 датотеку „%s“, кодни рспоред текућег језика није УТФ-8.\n" #~ msgid " -m, --add-bom add UTF-8 Byte Order Mark\n" #~ msgstr " -m, --add-bom додаје УТФ-8 назнаку поретка бајта\n" dos2unix-7.3.4/po/sv.po0000644000175500010010000005260012721132612014155 0ustar waterlanGeen# Swedish translation for dos2unix. # Copyright © 2014-2016 Erwin Waterlander, et al. (msgids) # This file is distributed under the same license as the dos2unix package. # Sebastian Rasmussen , 2014-2016. # msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-14 08:40+0200\n" "Last-Translator: Sebastian Rasmussen \n" "Language-Team: Swedish \n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.8.7.1\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Alla rättigheter reserverade.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Binärsymbol 0x00%02X hittades på rad %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "programfel, ogiltigt konverteringsläge %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Konverterade %u av %u radbrytningar.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "använder teckentabell %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Binärsymbol 0x%02X hittades på rad %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "fel: Värdet på miljövariabeln DOS2UNIX_LOCALEDIR är för långt.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "Alla rättigheter reserverade.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Omdistribution och användning i källkods- och binärform, med eller utan\n" "modifiering, är tillåten givet att följande villkor är uppfyllda:\n" "1. Omdistribution av källkod måste behålla den ovanstående notisen om\n" " upphovsrätt, denna lista av villkor och den efterföljande \n" " ansvarsfriskrivningen.2. Omdistribution i binär form måste återge den ovanstående notisen om\n" " upphovsrätt i dokumentationen och/eller annat material som följer\n" " med distributionen.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "DENNA MJUKVARA TILLHANDAHÅLLS AV UPPHOVSRÄTTSINNEHAVAREN I ”BEFINTLIGT\n" "SKICK” (AS IS) OCH ANSVAR FÖR UTTRYCKLIGA ELLER UNDERFÖRSTÅDDA,\n" "INKLUSIVE, MEN INTE BEGRÄNSAT TILL UNDERFÖRSTÅDDA GARANTIER VID KÖP\n" "OCH LÄMPLIGHET FÖR ETT VISST ÄNDAMÅL AVVISAS. INTE I NÅGOT FALL SKALL\n" "UPPHOVSRÄTTSINNEHAVAREN VARA SKYLDIG UTGE ERSÄTTNING FÖR DIREKT,\n" "INDIREKT, OFÖRUTSEDD, SPECIELL, EXEMPLARISK ELLER FÖLJDRELATERAD SKADA\n" "(INKLUSIVE, MEN INTE BEGRÄNSAT TILL ANSKAFFNING AV ERSÄTTNINGSVAROR\n" "ELLER TJÄNSTER; FÖRLUST AV ANVÄNDNING, DATA ELLER FÖRTJÄNST; ELLER\n" "AVBROTT I VERKSAMHET) OAVSETT HUR DEN ORSAKATS OCH TEORIER OM ANSVAR,\n" "OAVSETT OM SKRIVET I KONTRAKT, STRIKT SKYLDIGHET ELLER FÖRSEELSE\n" "(INKLUSIVE OAKTSAMHET ELLER ANNAT) SOM PÅ NÅGOT SÄTT UPPSTÅTT VID\n" "ANVÄNDNING AV DENNA MJUKVARA, ÄVEN OM UNDERRÄTTAD OM MÖJLIGHETEN FÖR\n" "SÅDAN SKADA.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Användning: %s [flaggor] [fil …] [-n infil utfil …]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii konvertera bara radbrytningar (standard)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso konvertering mellan DOS och ISO-8859-1 teckenuppsättningar\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 använd Windows teckentabell 1252 (Västeuropeisk)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 använd DOS teckentabell 437 (USA) (standard)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 använd DOS teckentabell 850 (Västeuropeisk)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 använd DOS teckentabell 860 (portugisisk)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 använd DOS teckentabell 863 (fransk-kanadensisk)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 använd DOS-teckentabell 865 (nordisk)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 konvertera 8-bitars tecken till 7-bitars blanksteg\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom behåll byteordningsmarkering (Byte Order Mark)\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom behåll byteordningsmarkering (Byte Order Mark) (standard)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode konverteringsläge\n" " konverteringsläge ascii, 7bit, iso, mac, standard är ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc ställ in kodning för visade textmeddelanden\n" " kodning ansi, unicode, utf8, standard är ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force tvinga konvertering av binära filer\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 konvertera UTF-16 till GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help visar denna hjälptext\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=FLAGGOR] visa filinformation\n" " fil … filer att analysera\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate behåll datum för utmatningsfilen\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license visa mjukvarulicensen\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline lägg till ytterligare nyrad\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom lägg till byteordningsmarkering (Byte Order Mark) (standard för UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile skriv till ny fil\n" " infil originalfil i nyfilsläge\n" " utfil utmatningsfil i nyfilsläge\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile skriv till den gamla filen (standard)\n" " fil … filer att konvertera i äldrefilsläge\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet tyst läge, dölj alla varningar\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom ta bort byteordningsmarkering (Byte Order Mark) (standard)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom ta bort byteordningsmarkering (Byte Order Mark)\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe hoppa över binära filer (standard)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 behåll UTF-16 teckenkodning\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le förmoda att inmatningsformatet är UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be förmoda att inmatningsformatet är UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose utförlig drift\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink följ symboliska länkar och konvertera målen\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink ersätt symboliska länkar med konverterade filer\n" " (de ursprungliga målfilerna förblir oförändrade)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink behåll symboliska länkar och mål oförändrade (standard)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version visa versionsnummer\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16-bitarsversion (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16-bitarsversion (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32-bitarsversion (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32-bitarsversion (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "MSYS-version.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Cygwin-version.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64-bitarsversion (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32-bitarsversion (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32-bitarsversion (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32-bitarsversion (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64-bitarsversion (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32-bitarsversion (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2-version (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "OS/2-version (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "%s version.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Med stöd för Unicode UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Utan stöd för Unicode UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Med stöd för Unicode-filnamn.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Utan stöd för Unicode-filnamn.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Med modersmålsstöd.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "Sökväg för temporär utmatningsfil är för lång:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Skriver %s BOM.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Infil %s har %s BOM.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Förmodar att UTF-16LE teckenkodning används.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Förmodar att UTF-16BE teckenkodning används.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Misslyckades att öppna temporär utmatningsfil: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "använder %s som temporär fil\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Misslyckades att stänga inmatningsfil %s:" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Misslyckades att skriva till temporär utmatningsfil %s:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Misslyckades att ändra rättigheterna för temporär utmatningsfil %s:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Misslyckades att ändra ägare och grupp för temporär utmatningsfil %s:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "fel uppstod vid upplösning av symbolisk länk ”%s”\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " utfil förblir i ”%s”\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "fel när '%s' bytte namn till '%s':" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " vilken är målet för den symboliska länken ”%s”\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Hoppar över binärfil %s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "saknar stöd för teckentabell %d.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Hoppar över UTF-16-fil %s, storleken på wchar_t är %d byte.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Hoppar över UTF-16-fil %s, ett UTF-16-konverteringsfel inträffade på rad %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Hoppar över UTF-16 fil %s, UTF-16-konvertering saknar stöd i denna version av %s.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Hoppar över %s, är ingen vanlig fil.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Hoppar över %s, utfil %s är en symbolisk länk.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Hoppar över symbolisk länk %s, målet är inte en vanlig fil.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Hoppar över %s, målet för den symboliska länken %s är inte en vanlig fil.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "konverterar fil %s till fil %s i Unix-format…\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "konverterar fil %s till fil %s i Mac-format…\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "konverterar fil %s till fil %s i DOS-format…\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "konverterar %s-fil %s till %s-fil %s i Unix-format…\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "konverterar %s-fil %s till %s-fil %s i Mac-format…\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "konverterar %s-fil %s till %s-fil %s i DOS-format…\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "fel vid konvertering från fil %s till fil %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Hoppar över symbolisk länk %s.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "konverterar fil %s till Unix-format…\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "konverterar fil %s till Mac-format…\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "konverterar fil %s till DOS-format…\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "konverterar %s-fil %s till %s Unix-format…\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "konverterar %s-fil %s till %s Mac-format…\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "konverterar %s-fil %s till %s DOS-format…\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "fel vid konvertering av fil %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "kan inte läsa från inmatningsfil %s:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "felaktig flagga '%c' för argumentet -i eller --info\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "aktiv teckentabell: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "ogiltigt konverteringsläge %s angivet\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "flaggan ”%s” kräver ett argument\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "ogiltig %s-kodning angiven\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "målet för fil %s specificerades inte i nyfilsläge\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "kan inte läsa från inmatningsfil: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "kan inte skriva till utfil: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "fel: Ogiltigt surrogatpar. Den lägre delen av surrogatparet saknas.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "fel: Ogiltigt surrogatpar. Den högre delen av surrogatparet saknas.\n" dos2unix-7.3.4/po/uk.po0000644000175500010010000006656612721132611014163 0ustar waterlanGeen# Ukrainian translation of dos2unix # Copyright (C) 2014 Erwin Waterlander (msgids) # Copyright (C) 2014 Free Software Foundation, Inc. # This file is distributed under the same license as the dos2unix package. # # Yuri Chornoivan , 2014, 2015, 2016. msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-13 17:31+0300\n" "Last-Translator: Yuri Chornoivan \n" "Language-Team: Ukrainian \n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Lokalize 1.5\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "© Erwin Waterlander, 2009-%d\n" "© Christian Wurll, 1998 (версія 3.1)\n" "© Bernd Johannes Wuebben, 1998 (версія 3.0)\n" "© Benjamin Lin, 1994-1995\n" "Усі права захищено.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Знайдено двійковий символ 0x00%02X у рядку %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "помилка програми, некоректний режим перетворення, %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Перетворено %u з %u символів розриву рядка.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "використовуємо кодову сторінку %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Знайдено двійковий символ 0x%02X у рядку %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "помилка: значення змінної середовища DOS2UNIX_LOCALEDIR є надто довгим.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "© Erwin Waterlander, 2009-%d\n" "© Benjamin Lin, 1994-1995\n" "Усі права застережено.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Дозволяється поширення і використання цієї програми у початкових\n" "кодах або у зібраній формі, з або без модифікації, за дотримання\n" "перелічених нижче умов:\n" "\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" " (У поширюваних копіях початкових кодів слід зберігати зазначене вище\n" " сповіщення про авторські права, цей список умов і наведену нижче відмову\n" " від відповідальності.)\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice, this list of conditions and the following disclaimer in the\n" " documentation and/or other materials provided with the distribution.\n" " (У поширюваних копіях зібраної програми слід вказувати зазначене вище\n" " сповіщення про авторські права, цей список умов і наведену нижче відмову\n" " від відповідальності у документації і/або інших супровідних матеріалах.)\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Користування: %s [параметри] [файл ...] [-n вхідний_файл результат ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii перетворити лише символи розриву рядків (типово)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso виконати перетворення з кодування DOS до кодування ISO-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 використати кодову таблицю 1252 Windows (західноєвропейські мови)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 використовувати кодову сторінку DOS 437 (США) (типово)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 використовувати кодову сторінку DOS 850 (західноєвропейські мови)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 використовувати сторінку DOS 860 (португальська)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 використовувати сторінку DOS 863 (канадська французька)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 використовувати сторінку DOS 865 (скандинавські мови)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 перетворювати 8-бітові символи на 7-бітові\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom зберегти позначку порядку байтів (BOM)\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom зберегти позначку порядку байтів (типово)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode режим перетворення\n" " режим ascii, 7bit, iso, mac, типовим є ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc встановити кодування показаних текстових повідомлень,\n" " кодування ansi, unicode, utf8, типовим є ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force примусове перетворення бінарних файлів\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 перетворити UTF-16 на GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help показати це довідкове повідомлення\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=ПРАПОРЦІ] показати дані щодо файла\n" " файл ... файли, які слід проаналізувати\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate зберігати дату створення файла для результату\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license показати ліцензійну угоду щодо програмного забезпечення\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline вставити додатковий символ розриву рядка\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -b, --add-bom додати позначку порядку байтів (типово UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile записати до нового файла\n" " вхідний_файл початковий файл у режимі створення файлів\n" " результат файл результату у режимі створення файлів\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile записати до старого файла (типово)\n" " файл ... файли, які слід перетворити у режимі без створення файлів\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet режим без повідомлень, не показувати попередження\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom вилучити позначку порядку байтів (типово)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom вилучити позначку порядку байтів (BOM)\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe пропускати двійкові файли (типово)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 зберегти кодування UTF-16\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le припускати, що вхідним форматом є UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be припускати, що вхідним форматом є UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose режим докладних повідомлень\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink переходити за символічними посиланням і перетворювати файли, на які вони вказують\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink замінити символічні посилання перетвореними файлами\n" " (початкові файли, на які вони вказують, змінено не буде)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink не змінювати символічні посилання та файли, на які вони посилаються (типово)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version показати дані щодо номера версії\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS, 16-бітова версія (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS, 16-бітова версія (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS, 32-бітова версія (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS, 32-бітова версія (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "Версія MSYS.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Версія Cygwin.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows, 64-бітова версія (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows, 32-бітова версія (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows, 32-бітова версія (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows, 32-бітова версія (MinGW)\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows, 64-бітова версія (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows, 32-бітова версія (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "Версія для OS/2 (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "Версія для OS/2 (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "Версія %s.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "З підтримкою Unicode UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Без підтримки Unicode UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "З підтримкою назв файлів у Unicode.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Без підтримки Unicode у назвах файлів.\n" #: common.c:727 msgid "With native language support.\n" msgstr "З підтримкою природної мови.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "Шлях до тимчасового файла виведення є надто довгим:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Записуємо позначку порядку байтів %s.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "У вхідному файлі %s позначкою порядку байтів є %s.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Припускаємо кодування UTF-16LE.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Припускаємо кодування UTF-16BE.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Не вдалося відкрити файл для виведення тимчасових даних: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "використовуємо %s як тимчасовий файл\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Не вдалося закрити файл вхідних даних %s:" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Не вдалося записати дані до тимчасового файла виведення %s:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Не вдалося змінити права доступу до тимчасового файла виведення даних %s:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Не вдалося змінити власника і групу тимчасового файла виведення даних %s:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "проблеми з обробкою символічного посилання «%s»\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " файл результатів залишився у «%s»\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "проблеми з перейменуванням «%s» на «%s»:" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " на який посилається символічне посилання «%s»\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Пропускаємо двійковий файл %s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "підтримки кодової сторінки %d не передбачено.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Пропускаємо файл у кодуванні UTF-16, %s, розміром wchar_t є %d байтів.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Пропускаємо файл у кодуванні UTF-16, %s, сталася помилка під час перетворення даних UTF-16 у рядку %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Пропускаємо файл у кодуванні UTF-16, %s, перетворення UTF-16 для цієї версії %s не передбачено.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Пропускаємо %s, не є звичайним файлом.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Пропускаємо %s, файл результату, %s, є символічним посиланням.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Пропускаємо символічне посилання %s, призначення не є звичайним файлом.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Пропускаємо %s, об’єкт, на який посилається символічне посилання %s, не є звичайним файлом.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "перетворюємо файл %s на файл %s у форматі Unix...\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "перетворюємо файл %s на файл %s у форматі Mac...\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "перетворюємо файл %s на файл %s у форматі DOS...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "перетворюємо файл у кодуванні %s %s на файл у кодуванні %s %s у форматі Unix...\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "перетворюємо файл у кодуванні %s %s на файл у кодуванні %s %s у форматі Mac...\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "перетворюємо файл у кодуванні %s %s на файл у кодуванні %s %s у форматі DOS...\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "під час перетворення файла %s на файл %s виникли проблеми\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Пропускаємо символічне посилання %s.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "перетворюємо файл %s до формату Unix...\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "перетворюємо файл %s до формату Mac...\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "перетворюємо файл %s до формату DOS...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "перетворюємо файл у кодуванні %s %s до формату %s Unix...\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "перетворюємо файл у кодуванні %s %s до формату %s Mac...\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "перетворюємо файл у кодуванні %s %s до формату %s DOS...\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "під час перетворення файла %s виникли проблеми\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "не вдалося прочитати дані із файла вхідних даних %s:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "помилковий прапорець «%c» для параметра -i або --info\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "активна кодова сторінка: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "вказано некоректний режим перетворення %s\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "до параметра «%s» слід вказувати аргумент\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "вказано некоректне кодування для показу %s\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "не вказано призначення для файла %s у режимі створення файлів\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "не вдалося прочитати дані із файла вхідних даних: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "не вдалося виконати запис до файла результатів: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "помилка: некоректна пара заміщення. Пропущено нижній компонент.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "помилка: некоректна пара заміщення. Пропущено верхній компонент.\n" #~ msgid "can not read from input file %s: %s\n" #~ msgstr "не вдалося прочитати дані із файла вхідних даних %s: %s\n" #~ msgid "WINVER 0x%X\n" #~ msgstr "WINVER 0x%X\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "Пропускаємо файл у кодуванні UTF-16, %s, поточним кодуванням символів локалі не є UTF-8.\n" #~ msgid " -m, --add-bom add UTF-8 Byte Order Mark\n" #~ msgstr " -m, --add-bom додати позначку порядку байтів UTF-8\n" dos2unix-7.3.4/po/vi.po0000644000175500010010000005436312721132612014153 0ustar waterlanGeen# Vietnamese translations for dos2unix package # Bản dịch tiếng Việt cho gói dos2unix. # This file is distributed under the same license as the dos2unix package. # Trần Ngọc Quân , 2014, 2015, 2016. # msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.4-beta4\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:50+0200\n" "PO-Revision-Date: 2016-05-14 08:17+0700\n" "Last-Translator: Trần Ngọc Quân \n" "Language-Team: Vietnamese \n" "Language: vi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Poedit-Basepath: ../\n" "X-Generator: Gtranslator 2.91.7\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Tác quyền (C) 2009-%d Erwin Waterlander\n" "Tác quyền (C) 1998 Christian Wurll (Phiên bản 3.1)\n" "Tác quyền (C) 1998 Bernd Johannes Wuebben (Phiên bản 3.0)\n" "Tác quyền (C) 1994-1995 Benjamin Lin\n" "Giữ toàn bộ bản quyền.\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "Ký hiệu nhị phân 0x00%02X được tìm thấy tại dòng %u\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "lỗi chương trình, chế độ chuyển đổi %d không hợp lệ\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "Đã chuyển đổi %u trong tổng số %u chỗ ngắt dòng.\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "dùng trang mã %d.\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "Ký hiệu nhị phân 0x%02X được tìm thấy tại dòng %u\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "lỗi: Giá trị của biến môi trường DOS2UNIX_LOCALEDIR quá dài.\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Bản quyền (C) 2009-%d Erwin Waterlander\n" "Bản quyền (C) 1994-1995 Benjamin Lin\n" "Giữ toàn bộ bản quyền.\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Phân phối lại và dùng mã nguồn và dạng nhị phân, có hoặc không\n" "sửa đổi lại, là được phép nếu tuân thủ các điều kiện sau đây:\n" "1. Phân phối lại mã nguồn phải giữ lại thông báo về bản quyền,\n" " cái này liệt kê các điều khản và các lời từ chối.\n" "2. Phân phối lại dạng nhị phân phải tái công bố thông báo về bản\n" " trong tài liệu và/hoặc các dạng khác được cung ứng cùng với\n" " bản phân phối.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "Cách dùng: %s [các-tùy-chọn] [tập-tin …] [-n tập-tin-vào tập-tin-ra …]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii chỉ chuyển đổi các ngắt dòng (mặc định)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso chuyển đổi giữa DOS và ISO-8859-1\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 dùng trang mã Windows 1252 (Tây Âu)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 dùng trang mã DOS 437 (US) (mặc định)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 dùng trang mã DOS 850 (Tây Âu)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 dùng trang mã DOS 860 (Bồ Đào Nha)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 dùng trang mã DOS 863 (Ca Na Đa Pháp)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 dùng trang mã DOS 865 (Bắc Âu)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 chuyển đổi các ký tự 8 bit thành 7 bit\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom giữ nguyên “Byte Order Mark”\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -b, --keep-bom giữ nguyên “Byte Order Mark” (mặc định)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode chế độ chuyển đổi\n" " chế độ chuyển đổi: ascii, 7bit, iso, mac, mặc định là ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc đặt bảng mã để hiển thị các thông báo\n" " bảng mã: ansi, unicode, utf8, mặc định là ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force bắt buộc chuyển đổi các tập tin nhị phân\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 đổi từ UTF-16 sang GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help hiển thị trợ giúp này\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=CỜ] hiển thị thông tin tập tin\n" " tập-tin … các tập tin cần phân tích\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate giữ nguyên ngày tháng tập tin đầu ra\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license hiển thị giấy phép dùng phần mềm\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline bổ xung thêm dòng mới\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom thêm “Byte Order Mark” (mặc định UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile ghi ra tập tin mới\n" " tập-tin-vào tập tin gốc trong chế độ tập-tin-mới\n" " tập-tin-ra tập tin đầu ra trong chế độ tập-tin-mới\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile ghi vào tập tin cũ (mặc định)\n" " tập-tin … các tập tin cần chuyển đổi trong chế độ tập-tin-cũ\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet chế độ im lặng, chặn mọi cảnh báo\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom gỡ bỏ “Byte Order Mark” (mặc định)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom gỡ bỏ “Byte Order Mark”\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe bỏ qua tập tin nhị phân (mặc định)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 giữ bảng mã UTF-16\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le coi rằng định dạng đầu vào là UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be coi rằng định dạng đầu vào là UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose thông báo chi tiết\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink theo liên kết mềm và chuyển đổi đích\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink thay thế liên kết mềm bằng tập tin đã chuyển đổi\n" " (các tập tin đích nguyên gốc thì để nguyên không thay đổi)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink giữ liên kết mềm và đích không thay đổi (mặc định)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version hiển thị số hiệu phiên bản\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "Phiên bản DOS 16 bit (WATCOMC).\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "Phiên bản DOS 16 bit (TURBOC).\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "Phiên bản DOS 32 bit (WATCOMC).\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "Phiên bản DOS 32 bit (DJGPP).\n" #: common.c:689 msgid "MSYS version.\n" msgstr "Phiên bản MSYS.\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Phiên bản Cygwin.\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Phiên bản Windows 64 bit (MinGW-w64).\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Phiên bản Windows 32 bit (WATCOMC).\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Phiên bản Windows 32 bit (MinGW-w64).\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Phiên bản Windows 32 bit (MinGW).\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Phiên bản Windows 64 bit (MSVC %d).\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Phiên bản Windows 32 bit (MSVC %d).\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "Phiên bản OS/2 (WATCOMC).\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "Phiên bản OS/2 (EMX).\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "Phiên bản %s.\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "Có hỗ trợ Unicode UTF-16.\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "Không hỗ trợ Unicode UTF-16.\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "Có hỗ trợ tên tập tin dạng Unicode.\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "Không hỗ trợ tên tập tin dạng Unicode.\n" #: common.c:727 msgid "With native language support.\n" msgstr "Có hỗ trợ bản địa hóa ngôn ngữ.\n" #: common.c:861 msgid "Path for temporary output file is too long:" msgstr "Đường dẫn cho tập tin xuất tạm quá dài:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "Đang ghi %s BOM.\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "Tập tin đầu vào %s có BOM %s.\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "Coi là bảng mã UTF-16LE.\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "Coi là bảng mã UTF-16BE.\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "Gặp lỗi khi mở tập tin đầu ra tạm thời: %s\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "đang dùng %s làm tập tin tạm\n" #: common.c:1499 common.c:2158 #, c-format msgid "Failed to close input file %s:" msgstr "Gặp lỗi khi đóng đầu vào %s:" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "Gặp lỗi khi ghi vào tập tin đầu ra tạm thời %s:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "Gặp lỗi khi thay đổi quyền hạn của tập tin đầu ra tạm %s:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "Gặp lỗi khi đổi chủ sở hữu và nhóm của tập tin đầu ra tạm %s:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "gặp lỗi khi phân giải liên kết mềm “%s”\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " tập tin đầu ra còn trong “%s”\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "gặp lỗi khi đổi tên “%s” thành “%s”:" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " cái là đích của liên kết mềm “%s”\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "Bỏ qua tập tin nhị phân %s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "không hỗ trợ trang mã %d.\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "Bỏ qua tập tin UTF-16 %s, cỡ của wchar_t không phải là %d byte.\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "Bỏ qua tập tin UTF-16 %s, đã xảy ra lỗi chuyển đổi UTF-16 trên dòng %u.\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "Bỏ qua tập tin UTF-16 %s, chuyển đổi UTF-16 không được hỗ trợ ở phiên bản này của %s.\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "Bỏ qua %s, đây không phải là tập tin thường.\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "Bỏ qua %s, tập tin đầu ra %s là một liên kết mềm.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "Bỏ qua liên kết mềm %s, đích của nó không phải là một tập tin thường.\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "Bỏ qua liên kết mềm %s, đích %s của liên kết mềm không phải là một tập tin thường.\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "Đang chuyển đổi tập tin %s thành tập tin “%s” theo định dạng Unix…\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "Đang chuyển đổi tập tin “%s” thành tập tin “%s” theo định dạng Mac…\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "Đang chuyển đổi tập tin “%s” thành tập tin “%s” theo định dạng DOS…\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "Đang chuyển đổi tập tin %s “%s” thành tập tin “%s” theo định dạng Unix %s…\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "Đang chuyển đổi tập tin %s “%s” thành tập tin “%s” theo định dạng Mac %s…\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "Đang chuyển đổi tập tin %s “%s” thành tập tin “%s” theo định dạng DOS %s…\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "Đang chuyển đổi tập tin %s thành tập tin %s\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "Bỏ qua liên kết mềm %s.\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "Đang chuyển đổi tập tin “%s” sang định dạng Unix…\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "Đang chuyển đổi tập tin “%s” sang định dạng Mac…\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "Đang chuyển đổi tập tin “%s” sang định dạng DOS…\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "Đang chuyển đổi tập tin %s “%s” sang định dạng Unix %s…\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "Đang chuyển đổi tập tin %s “%s” sang định dạng Mac %s…\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "Đang chuyển đổi tập tin %s “%s” sang định dạng DOS %s…\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "gặp trục trặc khi chuyển đổi tập tin %s\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "không thể đọc từ tập tin đầu vào %s:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "cờ “%c” cho tùy chọn -i hay --info bị sai\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "trang mã đang hoạt động: %d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "đã đưa ra chế độ chuyển đổi %s không hợp lệ\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "tùy chọn “%s” yêu cầu một đối số\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "đã đưa ra bảng mã hiển thị không hợp lệ %s\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "đích của tập tin %s không được chỉ định trong chế độ tập-tin-mới\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "không thể đọc từ tập tin đầu vào: %s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "không thể ghi vào tập tin đầu ra: %s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "lỗi: Cặp thay thế không hợp lệ. Thiếu cái thay thế dưới.\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "lỗi: Cặp thay thế không hợp lệ. Thiếu cái thay thế trên.\n" #~ msgid "has %s BOM.\n" #~ msgstr "có %s BOM.\n" #~ msgid "WINVER 0x%X\n" #~ msgstr "WINVER 0x%X\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "Bỏ qua tập tin UTF-16 %s, bảng mã ký tự địa phương hiện tại không phải là UTF-8.\n" dos2unix-7.3.4/po/zh_CN.po0000644000175500010010000005157312721132612014536 0ustar waterlanGeen# Chinese (simplified) translations for dos2unix. # This file is distributed under the same license as the dos2unix package. # # Tianze Wang , 2015. msgid "" msgstr "" "Project-Id-Version: dos2unix 7.3.3-beta2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:42+0200\n" "PO-Revision-Date: 2016-01-12 19:12+0800\n" "Last-Translator: Tianze Wang \n" "Language-Team: Chinese (simplified) \n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.8.6\n" "Plural-Forms: nplurals=1; plural=0;\n" #: dos2unix.c:79 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (版本 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (版本 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "保留所有权利。\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "找到二进制符号 0x00%02X 于第 %u 行\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "程序错误,不合法的转换模式 %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "转换了 %2$u 个换行符中的 %1$u 个。\n" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "使用编码页 %d 。\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "在第 %2$u 行找到二进制符号 0x%1$02X\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "错误:环境变量 DOS2UNIX_LOCALEDIR 的值太长。\n" #: unix2dos.c:69 #, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright © 2009-%d Erwin Waterlander\n" "Copyright © 1994-1995 Benjamin Lin\n" "保留所有权利。\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "用法:%s [选项] [文件 ...] [-n 输入文件 输出文件 ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii 只转换换行符(默认)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso 在 DOS 和 ISO-8859-1 字符集之间转换\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 使用Windows 1252 编码页(西欧)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 使用DOS 437 编码页(US)(默认)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 使用DOS 850 编码页(西欧)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 使用DOS 860 编码页(葡萄牙)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 使用DOS 863 编码页(加拿大法語)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 使用DOS 865 编码页(北欧)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 转换8 位字符到7 位空间\n" #: common.c:622 msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -b, --keep-bom 保留UTF-8 BOM头\n" #: common.c:624 msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr "-b, --keep-bom 保留UTF-8 BOM头(默认)\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode 转换模式\n" " convmode ascii、7bit、iso或mac,默认为ascii\n" #: common.c:628 msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -D, --display-enc 设置消息文本的编码\n" " encoding ansi、unicode或utf8,默认为ansi\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force 强制转换二进制文件\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr " -gb, --gb18030 转换UTF-16为GB18030\n" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help 显示本说明文字\n" #: common.c:638 msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -i, --info[=FLAGS] 显示文件信息\n" " 文件 ... 需要分析的文件\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate 保留输出文件时间\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license 显示软件协议\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline 加入额外的换行符\n" #: common.c:643 msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom 添加UTF-8 BOM头(默认为UTF-8)\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile 写入新文件\n" " infile 新文件模式中的原始文件\n" " outfile 新文件模式中的输出文件\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile 写入原文件(默认)\n" " file ... 旧文件模式中要转换的文件\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet 安静模式,不显示所有警告\n" #: common.c:651 msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -r, --remove-bom 移除UTF-8 BOM头(默认)\n" #: common.c:653 msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -r, --remove-bom 移除UTF-8 BOM头\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe 跳过二进制文件(默认)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr " -u, --keep-utf16 保留UTF-16编码\n" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le 假定输入文件格式为UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be 假定输入文件格式为UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr " -v, --verbose 显示更多信息\n" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink 根据符号链接转换其目标文件\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink 取代符号链接为转换后的文件\n" " (原链接目标文件保持不变)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink 保持符号链接及其目标不变(默认)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version 显示版本号\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "16位DOS版本 (WATCOMC)。\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "16位DOS版本(TURBOC)。\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "32位DOS版本(WATCOMC)。\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "32位DOS版本(DJGPP)。\n" #: common.c:689 msgid "MSYS version.\n" msgstr "MSYS版本。\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Cygwin版本。\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "64位Windows版本(MinGW-w64)。\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "32位Windows版本(WATCOMC)。\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "32位Windows版本(MinGW-w64)。\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "32位Windows版本(MinGW)。\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "64位Windows版本(MSVC %d)。\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "32位Windows版本(MSVC %d)。\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2 版本(WATCOMC)。\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "OS/2 版本(EMX)。\n" #: common.c:709 #, c-format msgid "%s version.\n" msgstr "版本 %s。\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "有Unicode UTF-16 支持。\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "无Unicode UTF-16 支持。\n" #: common.c:721 msgid "With Unicode file name support.\n" msgstr "有Unicode文件名支持。\n" #: common.c:723 msgid "Without Unicode file name support.\n" msgstr "无Unicode文件名支持。\n" #: common.c:727 msgid "With native language support.\n" msgstr "含本地语言支持。\n" #: common.c:861 #, fuzzy msgid "Path for temporary output file is too long:" msgstr "写入临时输出文件失败%s:" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "写入 %s BOM。\n" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "UTF-16LE" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "UTF-16BE" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "GB18030" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "UTF-8" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "输入文件 %s 有 %s BOM。\n" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "假定为UTF-16LE编码。\n" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "假定为UTF-16BE编码。\n" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "打开临时输出文件 %s 失败\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "使用 %s 作为临时文件\n" #: common.c:1499 common.c:2158 #, fuzzy, c-format msgid "Failed to close input file %s:" msgstr "打开临时输出文件 %s 失败\n" #: common.c:1512 #, c-format msgid "Failed to write to temporary output file %s:" msgstr "写入临时输出文件失败%s:" #: common.c:1535 #, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "改变临时输出文件 %s 的权限失败:" #: common.c:1552 #, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "改变临时输出文件 %s 的所有者和群组失败:" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "解析符号链接“%s”遇到问题\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " 输出文件“%s”未改变\n" #: common.c:1626 #, c-format msgid "problems renaming '%s' to '%s':" msgstr "重新命名“%s”到“%s”错误:" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " 後者为符号链接'%s' 的目标\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "跳过二进制文件%s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "不支持编码页 %d。\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "跳过 UTF-16 文件 %s,wchar_t 的大小为 %d 位。\n" #: common.c:1703 common.c:1795 common.c:1881 #, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "跳过 UTF-16 文件 %s,UTF-16 转换发生错误于第 %u 行。\n" #: common.c:1707 common.c:1799 common.c:1885 #, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "跳过 UTF-16 文件 %s,本版本 %s 不支持UTF-16。\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "跳过 %s,不是一个普通文件。\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "跳过 %s,输出文件 %s 是一个符号链接。.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "跳过符号链接 %s,目标不是一个普通文件。\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "跳过 %s,符号链接 %s 目标不是一个普通文件。\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "正在转换文件 %s 为Unix格式到 %s...\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "正在转换文件 %s 为Mac格式到 %s...\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "正在转换文件 %s 为DOS格式到 %s...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "正在转换 %1$s 文件 %2$s 为Unix格式的 %3$s 文件 %4$s...\n" #: common.c:1824 #, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "正在转换 %1$s 文件 %2$s 为Mac格式的 %3$s 文件 %4$s...\n" #: common.c:1826 #, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "正在转换 %1$s 文件 %2$s 为DOS格式的 %3$s 文件 %4$s...\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "转换文件 %s 到 %s 错误\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "跳过符号链接 %s。\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "正在转换文件 %s 为Unix格式...\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "正在转换文件 %s 为Mac格式...\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "正在转换文件 %s 为DOS格式...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "正在转换 %s 文件 %s 为Unix格式的 %s 文件...\n" #: common.c:1909 #, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "正在转换 %s 文件 %s 为Mac格式的 %s 文件...\n" #: common.c:1911 #, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "正在转换 %s 文件 %s 为DOS格式的 %s 文件...\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "转换文件 %s 出错\n" #: common.c:2039 common.c:2089 #, c-format msgid "can not read from input file %s:" msgstr "无法读取输入文件 %s:" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "-i/--info选项的标志“%c”错误\n" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "作用中编码页:%d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "指定的转换模式 %s 不合法\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "选项“%s”需要一个参数\n" #: common.c:2467 #, c-format msgid "invalid %s display encoding specified\n" msgstr "指定了无效的显示编码 %s\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "新文件模式中未指明文件 %s 的目的位置\n" #: common.c:2578 #, c-format msgid "can not read from input file: %s\n" msgstr "无法读取输入文件:%s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "无法写入输出文件:%s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "错误:无效的代理对。缺少低位字符。\n" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "错误:无效的代理对。缺少高位字符。\n" #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8.\n" #~ msgstr "跳过 UTF-16 文件 %s,目前语言字元編碼並非UTF-8。\n" #~ msgid "can not read from input file %s: %s\n" #~ msgstr "无法读取输入文件 %s:%s\n" #~ msgid " -m, --add-bom add UTF-8 Byte Order Mark\n" #~ msgstr " -m, --add-bom 加入UTF-8 BOM头\n" dos2unix-7.3.4/po/zh_TW.po0000644000175500010010000005035212721132612014562 0ustar waterlanGeen# Chinese (traditional) translations for dos2unix. # This file is distributed under the same license as the dos2unix package. # # mail6543210 , 2014. msgid "" msgstr "" "Project-Id-Version: dos2unix 6.0.5-b3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-05-12 22:42+0200\n" "PO-Revision-Date: 2014-03-14 00:43+0800\n" "Last-Translator: mail6543210 \n" "Language-Team: Chinese (traditional) \n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.6.4\n" "Plural-Forms: nplurals=1; plural=0;\n" #: dos2unix.c:79 #, fuzzy, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (Version 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (Version 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright (C) 2009-2015 Erwin Waterlander\n" "Copyright (C) 1998 Christian Wurll (版本 3.1)\n" "Copyright (C) 1998 Bernd Johannes Wuebben (版本 3.0)\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "保留所有權利。\n" "\n" #: dos2unix.c:212 dos2unix.c:249 unix2dos.c:149 unix2dos.c:209 #, c-format msgid "Binary symbol 0x00%02X found at line %u\n" msgstr "找到二進位符號0x00%02X 在第%u 行\n" #: dos2unix.c:305 dos2unix.c:488 unix2dos.c:261 unix2dos.c:461 #, c-format msgid "program error, invalid conversion mode %d\n" msgstr "程式錯誤,不合法的轉換模式 %d\n" #: dos2unix.c:313 dos2unix.c:494 unix2dos.c:269 unix2dos.c:467 #, c-format msgid "Converted %u out of %u line breaks.\n" msgstr "" #: dos2unix.c:371 unix2dos.c:327 #, c-format msgid "using code page %d.\n" msgstr "使用 %d 編碼頁。\n" #: dos2unix.c:395 dos2unix.c:432 unix2dos.c:349 unix2dos.c:409 #, c-format msgid "Binary symbol 0x%02X found at line %u\n" msgstr "找到二進位符號0x%02X 在第%u 行\n" #: dos2unix.c:529 unix2dos.c:502 msgid "error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n" msgstr "錯誤:環境變數DOS2UNIX_LOCALEDIR 的值太長。\n" #: unix2dos.c:69 #, fuzzy, c-format msgid "" "Copyright (C) 2009-%d Erwin Waterlander\n" "Copyright (C) 1994-1995 Benjamin Lin\n" "All rights reserved.\n" "\n" msgstr "" "Copyright © 2009-2015 Erwin Waterlander\n" "Copyright © 1994-1995 Benjamin Lin\n" "保留所有權利。\n" "\n" #: common.c:576 msgid "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" msgstr "" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" "are met:\n" "1. Redistributions of source code must retain the above copyright\n" " notice, this list of conditions and the following disclaimer.\n" "2. Redistributions in binary form must reproduce the above copyright\n" " notice in the documentation and/or other materials provided with\n" " the distribution.\n" "\n" #: common.c:586 msgid "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" msgstr "" "THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY\n" "EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n" "IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n" "PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE\n" "FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n" "CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\n" "OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n" "BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n" "WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE\n" "OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN\n" "IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n" #: common.c:611 #, c-format msgid "Usage: %s [options] [file ...] [-n infile outfile ...]\n" msgstr "用法: %s [選項] [file ...] [-n infile outfile ...]\n" #: common.c:612 msgid " -ascii convert only line breaks (default)\n" msgstr " -ascii 只轉換換行字元(預設)\n" #: common.c:613 msgid " -iso conversion between DOS and ISO-8859-1 character set\n" msgstr " -iso 在DOS 和ISO-8859-1 字元集間轉換\n" #: common.c:614 msgid " -1252 use Windows code page 1252 (Western European)\n" msgstr " -1252 使用Windows 1252 編碼頁(西歐)\n" #: common.c:615 msgid " -437 use DOS code page 437 (US) (default)\n" msgstr " -437 使用DOS 437 編碼頁(US) (預設)\n" #: common.c:616 msgid " -850 use DOS code page 850 (Western European)\n" msgstr " -850 使用DOS 850 編碼頁(西歐)\n" #: common.c:617 msgid " -860 use DOS code page 860 (Portuguese)\n" msgstr " -860 使用DOS 860 編碼頁(葡萄牙)\n" #: common.c:618 msgid " -863 use DOS code page 863 (French Canadian)\n" msgstr " -863 使用DOS 863 編碼頁(加拿大法語)\n" #: common.c:619 msgid " -865 use DOS code page 865 (Nordic)\n" msgstr " -865 使用DOS 865 編碼頁(北歐)\n" #: common.c:620 msgid " -7 convert 8 bit characters to 7 bit space\n" msgstr " -7 轉換8 位元字元到7 位元空間\n" #: common.c:622 #, fuzzy msgid " -b, --keep-bom keep Byte Order Mark\n" msgstr " -m, --add-bom 加入UTF-8 BOM\n" #: common.c:624 #, fuzzy msgid " -b, --keep-bom keep Byte Order Mark (default)\n" msgstr " -m, --add-bom 加入UTF-8 BOM\n" #: common.c:625 msgid "" " -c, --convmode conversion mode\n" " convmode ascii, 7bit, iso, mac, default to ascii\n" msgstr "" " -c, --convmode 轉換模式\n" " convmode ascii, 7bit, iso, mac, 預設為ascii\n" #: common.c:628 #, fuzzy msgid "" " -D, --display-enc set encoding of displayed text messages\n" " encoding ansi, unicode, utf8, default to ansi\n" msgstr "" " -c, --convmode 轉換模式\n" " convmode ascii, 7bit, iso, mac, 預設為ascii\n" #: common.c:631 msgid " -f, --force force conversion of binary files\n" msgstr " -f, --force 強制轉換二進位檔案\n" #: common.c:634 msgid " -gb, --gb18030 convert UTF-16 to GB18030\n" msgstr "" #: common.c:637 msgid " -h, --help display this help text\n" msgstr " -h, --help 顯示本說明文字\n" #: common.c:638 #, fuzzy msgid "" " -i, --info[=FLAGS] display file information\n" " file ... files to analyze\n" msgstr "" " -o, --oldfile 寫入原檔案(預設)\n" " file ... 原檔模式中要轉換的檔案\n" #: common.c:640 msgid " -k, --keepdate keep output file date\n" msgstr " -k, --keepdate 保留輸出檔時間\n" #: common.c:641 msgid " -L, --license display software license\n" msgstr " -L, --license 顯示軟體授權\n" #: common.c:642 msgid " -l, --newline add additional newline\n" msgstr " -l, --newline 加入額外的換行\n" #: common.c:643 #, fuzzy msgid " -m, --add-bom add Byte Order Mark (default UTF-8)\n" msgstr " -m, --add-bom 加入UTF-8 BOM\n" #: common.c:644 msgid "" " -n, --newfile write to new file\n" " infile original file in new-file mode\n" " outfile output file in new-file mode\n" msgstr "" " -n, --newfile 寫入新檔\n" " infile 新檔模式中的原始檔案\n" " outfile 新檔模式中的輸出檔案\n" #: common.c:647 msgid "" " -o, --oldfile write to old file (default)\n" " file ... files to convert in old-file mode\n" msgstr "" " -o, --oldfile 寫入原檔案(預設)\n" " file ... 原檔模式中要轉換的檔案\n" #: common.c:649 msgid " -q, --quiet quiet mode, suppress all warnings\n" msgstr " -q, --quiet 安靜模式,抑制所有警告\n" #: common.c:651 #, fuzzy msgid " -r, --remove-bom remove Byte Order Mark (default)\n" msgstr " -m, --add-bom 加入UTF-8 BOM\n" #: common.c:653 #, fuzzy msgid " -r, --remove-bom remove Byte Order Mark\n" msgstr " -m, --add-bom 加入UTF-8 BOM\n" #: common.c:654 msgid " -s, --safe skip binary files (default)\n" msgstr " -s, --safe 略過二進位檔案(預設)\n" #: common.c:656 msgid " -u, --keep-utf16 keep UTF-16 encoding\n" msgstr "" #: common.c:657 msgid " -ul, --assume-utf16le assume that the input format is UTF-16LE\n" msgstr " -ul, --assume-utf16le 假設輸入檔格式為UTF-16LE\n" #: common.c:658 msgid " -ub, --assume-utf16be assume that the input format is UTF-16BE\n" msgstr " -ub, --assume-utf16be 假設輸入檔格式為UTF-16BE\n" #: common.c:660 msgid " -v, --verbose verbose operation\n" msgstr "" #: common.c:662 msgid " -F, --follow-symlink follow symbolic links and convert the targets\n" msgstr " -F, --follow-symlink 依循符號連結轉換其目標檔案\n" #: common.c:665 msgid "" " -R, --replace-symlink replace symbolic links with converted files\n" " (original target files remain unchanged)\n" msgstr "" " -R, --replace-symlink 取代符號連結為轉換後的檔案\n" " (原連結目標檔案保持不變)\n" #: common.c:667 msgid " -S, --skip-symlink keep symbolic links and targets unchanged (default)\n" msgstr " -S, --skip-symlink 保持符號連結及其目標不變(預設)\n" #: common.c:669 msgid " -V, --version display version number\n" msgstr " -V, --version 顯示版本號碼\n" #: common.c:681 msgid "DOS 16 bit version (WATCOMC).\n" msgstr "DOS 16 位元版本(WATCOMC)。\n" #: common.c:683 msgid "DOS 16 bit version (TURBOC).\n" msgstr "DOS 16 位元版本(TURBOC)。\n" #: common.c:685 msgid "DOS 32 bit version (WATCOMC).\n" msgstr "DOS 32 位元版本(WATCOMC)。\n" #: common.c:687 msgid "DOS 32 bit version (DJGPP).\n" msgstr "DOS 32 位元版本(DJGPP)。\n" #: common.c:689 msgid "MSYS version.\n" msgstr "MSYS 版本。\n" #: common.c:691 msgid "Cygwin version.\n" msgstr "Cygwin 版本。\n" #: common.c:693 msgid "Windows 64 bit version (MinGW-w64).\n" msgstr "Windows 64 位元版本(MinGW-w64)。\n" #: common.c:695 msgid "Windows 32 bit version (WATCOMC).\n" msgstr "Windows 32 位元版本(WATCOMC)。\n" #: common.c:697 msgid "Windows 32 bit version (MinGW-w64).\n" msgstr "Windows 32 位元版本(MinGW-w64)。\n" #: common.c:699 msgid "Windows 32 bit version (MinGW).\n" msgstr "Windows 32 位元版本(MinGW)。\n" #: common.c:701 #, c-format msgid "Windows 64 bit version (MSVC %d).\n" msgstr "Windows 64 位元版本(MSVC %d)。\n" #: common.c:703 #, c-format msgid "Windows 32 bit version (MSVC %d).\n" msgstr "Windows 32 位元版本(MSVC %d)。\n" #: common.c:705 msgid "OS/2 version (WATCOMC).\n" msgstr "OS/2 版本(WATCOMC)。\n" #: common.c:707 msgid "OS/2 version (EMX).\n" msgstr "OS/2 版本(EMX)。\n" #: common.c:709 #, fuzzy, c-format msgid "%s version.\n" msgstr "MSYS 版本。\n" #: common.c:715 msgid "With Unicode UTF-16 support.\n" msgstr "有Unicode UTF-16 支援。\n" #: common.c:717 msgid "Without Unicode UTF-16 support.\n" msgstr "無Unicode UTF-16 支援。\n" #: common.c:721 #, fuzzy msgid "With Unicode file name support.\n" msgstr "有Unicode UTF-16 支援。\n" #: common.c:723 #, fuzzy msgid "Without Unicode file name support.\n" msgstr "無Unicode UTF-16 支援。\n" #: common.c:727 msgid "With native language support.\n" msgstr "含本地語言支援。\n" #: common.c:861 #, fuzzy msgid "Path for temporary output file is too long:" msgstr "暫存檔寫入失敗%s:%s\n" #: common.c:1142 common.c:1149 common.c:1156 common.c:1163 common.c:1175 #: common.c:1182 #, c-format msgid "Writing %s BOM.\n" msgstr "" #: common.c:1142 common.c:1195 common.c:1718 common.c:1739 msgid "UTF-16LE" msgstr "" #: common.c:1149 common.c:1198 common.c:1720 common.c:1741 msgid "UTF-16BE" msgstr "" #: common.c:1156 common.c:1175 common.c:1204 common.c:1731 msgid "GB18030" msgstr "" #: common.c:1163 common.c:1182 common.c:1201 common.c:1733 msgid "UTF-8" msgstr "" #: common.c:1227 #, c-format msgid "Input file %s has %s BOM.\n" msgstr "" #: common.c:1263 common.c:1306 msgid "Assuming UTF-16LE encoding.\n" msgstr "" #: common.c:1267 common.c:1310 msgid "Assuming UTF-16BE encoding.\n" msgstr "" #: common.c:1455 #, c-format msgid "Failed to open temporary output file: %s\n" msgstr "暫存檔 %s 開啟失敗\n" #: common.c:1467 #, c-format msgid "using %s as temporary file\n" msgstr "使用 %s 作為暫存檔\n" #: common.c:1499 common.c:2158 #, fuzzy, c-format msgid "Failed to close input file %s:" msgstr "暫存檔 %s 開啟失敗\n" #: common.c:1512 #, fuzzy, c-format msgid "Failed to write to temporary output file %s:" msgstr "暫存檔寫入失敗%s:%s\n" #: common.c:1535 #, fuzzy, c-format msgid "Failed to change the permissions of temporary output file %s:" msgstr "輸出暫存檔 %s 權限變更失敗:%s\n" #: common.c:1552 #, fuzzy, c-format msgid "Failed to change the owner and group of temporary output file %s:" msgstr "輸出暫存檔 %s 擁有者及群組變更失敗:%s\n" #: common.c:1599 #, c-format msgid "problems resolving symbolic link '%s'\n" msgstr "解析符號連結'%s' 發生問題\n" #: common.c:1600 common.c:1632 #, c-format msgid " output file remains in '%s'\n" msgstr " 輸出檔案'%s' 未改變\n" #: common.c:1626 #, fuzzy, c-format msgid "problems renaming '%s' to '%s':" msgstr "重新命名「%s」到「%s」錯誤:%s\n" #: common.c:1630 #, c-format msgid " which is the target of symbolic link '%s'\n" msgstr " 後者為符號連結'%s' 的目標\n" #: common.c:1693 common.c:1785 common.c:1871 #, c-format msgid "Skipping binary file %s\n" msgstr "略過二進位檔案%s\n" #: common.c:1696 common.c:1788 common.c:1874 #, c-format msgid "code page %d is not supported.\n" msgstr "未支援%d 編碼頁。\n" #: common.c:1700 common.c:1792 common.c:1878 common.c:1938 #, c-format msgid "Skipping UTF-16 file %s, the size of wchar_t is %d bytes.\n" msgstr "略過 UTF-16 檔案 %s,wchar_t 的大小是 %d 位元組。\n" #: common.c:1703 common.c:1795 common.c:1881 #, fuzzy, c-format msgid "Skipping UTF-16 file %s, an UTF-16 conversion error occurred on line %u.\n" msgstr "略過 UTF-16 檔案 %s,UTF-16 轉換發生錯誤。\n" #: common.c:1707 common.c:1799 common.c:1885 #, fuzzy, c-format msgid "Skipping UTF-16 file %s, UTF-16 conversion is not supported in this version of %s.\n" msgstr "略過 UTF-16 檔案 %s,UTF-16 轉換發生錯誤。\n" #: common.c:1773 common.c:1862 common.c:1927 #, c-format msgid "Skipping %s, not a regular file.\n" msgstr "略過 %s,不是一個普通檔案。\n" #: common.c:1776 #, c-format msgid "Skipping %s, output file %s is a symbolic link.\n" msgstr "略過 %s,輸出檔 %s 是一個符號連結。.\n" #: common.c:1779 common.c:1868 common.c:1932 #, c-format msgid "Skipping symbolic link %s, target is not a regular file.\n" msgstr "略過符號連結 %s,目標不是一個普通檔案。\n" #: common.c:1782 #, c-format msgid "Skipping %s, target of symbolic link %s is not a regular file.\n" msgstr "略過 %s,符號連結 %s 目標不是一個普通檔案。\n" #: common.c:1805 #, c-format msgid "converting file %s to file %s in Unix format...\n" msgstr "正在轉換 %s 為Unix 格式到 %s...\n" #: common.c:1808 #, c-format msgid "converting file %s to file %s in Mac format...\n" msgstr "正在轉換 %s 為Mac 格式到 %s...\n" #: common.c:1810 #, c-format msgid "converting file %s to file %s in DOS format...\n" msgstr "正在轉換 %s 為DOS 格式到 %s...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output file. #. 4th %s is name of output file. #. E.g.: converting UTF-16LE file in.txt to UTF-8 file out.txt in Unix format... #: common.c:1821 #, fuzzy, c-format msgid "converting %s file %s to %s file %s in Unix format...\n" msgstr "正在轉換 %s 為Unix 格式到 %s...\n" #: common.c:1824 #, fuzzy, c-format msgid "converting %s file %s to %s file %s in Mac format...\n" msgstr "正在轉換 %s 為Mac 格式到 %s...\n" #: common.c:1826 #, fuzzy, c-format msgid "converting %s file %s to %s file %s in DOS format...\n" msgstr "正在轉換 %s 為DOS 格式到 %s...\n" #: common.c:1832 #, c-format msgid "problems converting file %s to file %s\n" msgstr "轉換檔案 %s 到 %s 錯誤\n" #: common.c:1865 #, c-format msgid "Skipping symbolic link %s.\n" msgstr "略過符號連結 %s。\n" #: common.c:1891 #, c-format msgid "converting file %s to Unix format...\n" msgstr "正在轉換 %s 為Unix 格式...\n" #: common.c:1894 #, c-format msgid "converting file %s to Mac format...\n" msgstr "正在轉換 %s 為Mac 格式...\n" #: common.c:1896 #, c-format msgid "converting file %s to DOS format...\n" msgstr "正在轉換 %s 為DOS 格式...\n" #. TRANSLATORS: #. 1st %s is encoding of input file. #. 2nd %s is name of input file. #. 3rd %s is encoding of output (input file is overwritten). #. E.g.: converting UTF-16LE file foo.txt to UTF-8 Unix format... #: common.c:1906 #, fuzzy, c-format msgid "converting %s file %s to %s Unix format...\n" msgstr "正在轉換 %s 為Unix 格式...\n" #: common.c:1909 #, fuzzy, c-format msgid "converting %s file %s to %s Mac format...\n" msgstr "正在轉換 %s 為Mac 格式...\n" #: common.c:1911 #, fuzzy, c-format msgid "converting %s file %s to %s DOS format...\n" msgstr "正在轉換 %s 為DOS 格式...\n" #: common.c:1917 #, c-format msgid "problems converting file %s\n" msgstr "轉換檔案 %s 錯誤\n" #: common.c:2039 common.c:2089 #, fuzzy, c-format msgid "can not read from input file %s:" msgstr "無法寫入輸出檔:%s\n" #: common.c:2257 #, c-format msgid "wrong flag '%c' for option -i or --info\n" msgstr "" #: common.c:2382 common.c:2425 #, c-format msgid "active code page: %d\n" msgstr "作用中編碼頁:%d\n" #: common.c:2437 #, c-format msgid "invalid %s conversion mode specified\n" msgstr "指定的轉換模式 %s 不合法\n" #: common.c:2445 common.c:2475 #, c-format msgid "option '%s' requires an argument\n" msgstr "選項'%s' 需要一個引數\n" #: common.c:2467 #, fuzzy, c-format msgid "invalid %s display encoding specified\n" msgstr "指定的轉換模式 %s 不合法\n" #: common.c:2487 common.c:2500 common.c:2566 #, c-format msgid "target of file %s not specified in new-file mode\n" msgstr "新檔模式中未指明檔案 %s 的目的位置\n" #: common.c:2578 #, fuzzy, c-format msgid "can not read from input file: %s\n" msgstr "無法寫入輸出檔:%s\n" #: common.c:2588 common.c:2600 #, c-format msgid "can not write to output file: %s\n" msgstr "無法寫入輸出檔:%s\n" #: common.c:2675 msgid "error: Invalid surrogate pair. Missing low surrogate.\n" msgstr "" #: common.c:2691 msgid "error: Invalid surrogate pair. Missing high surrogate.\n" msgstr "" #, fuzzy #~ msgid "Skipping UTF-16 file %s, the current locale character encoding is not UTF-8 or GB18030.\n" #~ msgstr "略過 UTF-16 檔案 %s,目前語言字元編碼並非UTF-8。\n" #~ msgid " -m, --add-bom add UTF-8 Byte Order Mark\n" #~ msgstr " -m, --add-bom 加入UTF-8 BOM\n" dos2unix-7.3.4/po-man/0000755000175500010010000000000012721132567013744 5ustar waterlanGeendos2unix-7.3.4/po-man/de.po0000644000175500010010000020677512721132543014707 0ustar waterlanGeen# German translation of the dos2unix man page. # Copyright (C) 2014 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # # Mario Blättermann , 2014-2016. msgid "" msgstr "" "Project-Id-Version: dos2unix-man-7.3.3-beta9\n" "POT-Creation-Date: 2016-02-11 20:33+0100\n" "PO-Revision-Date: 2016-02-09 09:37+0100\n" "Last-Translator: Mario Blättermann \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.8.6\n" #. type: =head1 #: dos2unix.pod:52 msgid "NAME" msgstr "BEZEICHNUNG" #. type: textblock #: dos2unix.pod:54 msgid "dos2unix - DOS/Mac to Unix and vice versa text file format converter" msgstr "dos2unix - Formatumwandlung für Textdateien von DOS/Mac nach Unix und umgekehrt" #. type: =head1 #: dos2unix.pod:56 msgid "SYNOPSIS" msgstr "ÜBERSICHT" #. type: verbatim #: dos2unix.pod:58 #, no-wrap msgid "" " dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]\n" " unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]\n" "\n" msgstr "" " dos2unix [Optionen] [DATEI …] [-n EINGABEDATEI AUSGABEDATEI …]\n" " unix2dos [Optionen] [DATEI …] [-n EINGABEDATEI AUSGABEDATEI …]\n" "\n" #. type: =head1 #: dos2unix.pod:61 msgid "DESCRIPTION" msgstr "BESCHREIBUNG" #. type: textblock #: dos2unix.pod:63 msgid "The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa." msgstr "Das Paket Dos2unix enthält die Werkzeuge C und C zum Umwandeln einfacher Textdateien aus dem DOS- oder Mac-Format in das Unix-Format und umgekehrt." #. type: textblock #: dos2unix.pod:66 msgid "In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks." msgstr "In Textdateien unter DOS/Windows sind Zeilenumbrüche, auch als neue Zeile (NL) bekannt, eine Kombination aus zwei Zeichen: einem Wagenrücklauf (Carriage Return, CR) gefolgt von einem Zeilenvorschub (Line Feed, LF). In Unix-Textdateien bestehen Zeilenumbrüche nur aus einem Zeichen, dem Zeilenvorschub (LF). In Mac-Textdateien aus der Zeit vor MacOSX bestand ein Zeilenumbruch aus einem einzelnen CR-Zeichen. Heute verwendet Mac OS Zeilenumbrüche im Unix-Stil (LF)." #. type: textblock #: dos2unix.pod:72 msgid "Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files." msgstr "Neben Zeilenumbrüchen kann Dos2unix auch die Zeichenkodierung von Dateien umwandeln. Einige DOS-Codepages können in Unix Latin-1 umgewandelt werden, und Windows-Unicode-Dateien (UTF-16) können in Unix-Unicode-Dateien (UTF-8) umgewandelt werden." #. type: textblock #: dos2unix.pod:76 msgid "Binary files are automatically skipped, unless conversion is forced." msgstr "Binärdateien werden automatisch übersprungen, sofern die Umwandlung nicht erzwungen wird." #. type: textblock #: dos2unix.pod:78 msgid "Non-regular files, such as directories and FIFOs, are automatically skipped." msgstr "Nicht-reguläre Dateien, wie Verzeichnisse und FIFOS (Weiterleitungen) werden automatisch übersprungen." #. type: textblock #: dos2unix.pod:80 msgid "Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows." msgstr "Symbolische Links und deren Ziele werden per Vorgabe unverändert belassen. Symbolische Links können optional ersetzt werden, oder die Ausgabe wird in das Ziel des symbolischen Links geschrieben. Unter Windows wird das Schreiben in das Ziel eines symbolischen Links nicht unterstützt." #. type: textblock #: dos2unix.pod:84 msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion." msgstr "Dos2unix wurde nach dem Vorbild der dos2unix-Version unter SunOS/Solaris entwickelt, doch es gibt einen wesentlichen Unterschied zum Original: Diese Version ersetzt per Vorgabe Dateien bei der Umwandlung (Alte-Datei-Modus), während unter SunOS/Solaris nur die paarweise Umwandlung (Neue-Datei-Modus) unterstützt wird. Siehe dazu die Optionen C<-o> und C<-n>. Ein weiterer Unterschied ist, dass die SunOS/Solaris-Version in der Voreinstellung die Umwandlung im I-Modus vornimmt, während diese Version den I-Modus verwendet." #. type: =head1 #: dos2unix.pod:92 msgid "OPTIONS" msgstr "OPTIONEN" #. type: =item #: dos2unix.pod:96 msgid "B<-->" msgstr "B<-->" #. type: textblock #: dos2unix.pod:98 msgid "Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named \"-foo\", you can use this command:" msgstr "nimmt alle folgenden Optionen als Dateinamen an. Verwenden Sie diese Option, wenn Sie Dateien umwandeln wollen, deren Namen mit einem Minuszeichen beginnen. Um beispielsweise eine Datei namens »-bla« umzuwandeln, können Sie folgenden Befehl verwenden:" #. type: verbatim #: dos2unix.pod:102 #, no-wrap msgid "" " dos2unix -- -foo\n" "\n" msgstr "" " dos2unix -- -bla\n" "\n" #. type: textblock #: dos2unix.pod:104 msgid "Or in new file mode:" msgstr "oder im Neue-Datei-Modus:" #. type: verbatim #: dos2unix.pod:106 #, no-wrap msgid "" " dos2unix -n -- -foo out.txt\n" "\n" msgstr "" " dos2unix -n -- -bla ausgabe.txt\n" "\n" #. type: =item #: dos2unix.pod:108 msgid "B<-ascii>" msgstr "B<-ascii>" #. type: textblock #: dos2unix.pod:110 msgid "Convert only line breaks. This is the default conversion mode." msgstr "wandelt nur Zeilenumbrüche um. Dies ist der vorgegebene Umwandlungsmodus." #. type: =item #: dos2unix.pod:112 msgid "B<-iso>" msgstr "B<-iso>" #. type: textblock #: dos2unix.pod:114 msgid "Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES." msgstr "wandelt aus dem DOS- in den ISO-8859-1-Zeichensatz um. Weitere Informationen hierzu finden Sie im Abschnitt UMWANDLUNGSMODI." #. type: =item #: dos2unix.pod:117 msgid "B<-1252>" msgstr "B<-1252>" #. type: textblock #: dos2unix.pod:119 msgid "Use Windows code page 1252 (Western European)." msgstr "verwendet die Windows-Codepage 1252 (Westeuropäisch)." #. type: =item #: dos2unix.pod:121 msgid "B<-437>" msgstr "B<-437>" #. type: textblock #: dos2unix.pod:123 msgid "Use DOS code page 437 (US). This is the default code page used for ISO conversion." msgstr "verwendet die DOS-Codepage 437 (US). Dies ist die vorgegebene Codepage für die ISO-Umwandlung." #. type: =item #: dos2unix.pod:125 msgid "B<-850>" msgstr "B<-850>" #. type: textblock #: dos2unix.pod:127 msgid "Use DOS code page 850 (Western European)." msgstr "verwendet die DOS-Codepage 850 (Westeuropäisch)." #. type: =item #: dos2unix.pod:129 msgid "B<-860>" msgstr "B<-860>" #. type: textblock #: dos2unix.pod:131 msgid "Use DOS code page 860 (Portuguese)." msgstr "verwendet die DOS-Codepage 860 (Portugiesisch)." #. type: =item #: dos2unix.pod:133 msgid "B<-863>" msgstr "B<-863>" #. type: textblock #: dos2unix.pod:135 msgid "Use DOS code page 863 (French Canadian)." msgstr "verwendet die DOS-Codepage 863 (Kanadisches Französisch)." #. type: =item #: dos2unix.pod:137 msgid "B<-865>" msgstr "B<-865>" #. type: textblock #: dos2unix.pod:139 msgid "Use DOS code page 865 (Nordic)." msgstr "verwendet die DOS-Codepage 865 (Skandinavisch)." #. type: =item #: dos2unix.pod:141 msgid "B<-7>" msgstr "B<-7>" #. type: textblock #: dos2unix.pod:143 msgid "Convert 8 bit characters to 7 bit space." msgstr "wandelt 8bit-Zeichen in ein 7bit-Bitmuster um." #. type: =item #: dos2unix.pod:145 msgid "B<-b, --keep-bom>" msgstr "B<-b, --keep-bom>" #. type: textblock #: dos2unix.pod:147 msgid "Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option C<-r>." msgstr "erhält die Markierung der Bytereihenfolge (BOM). Wenn die Eingabedatei eine BOM enthält, wird ebenfalls eine BOM in die Ausgabedatei geschrieben. Dies ist das Standardverhalten beim Umwandeln von DOS-Zeilenumbrüchen. Siehe auch die Option C<-r>." #. type: =item #: dos2unix.pod:151 msgid "B<-c, --convmode CONVMODE>" msgstr "B<-c, --convmode UMWANDLUNGSMODUS>" #. type: textblock #: dos2unix.pod:153 msgid "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default." msgstr "legt den Umwandlungsmodus fest. UMWANDLUNGSMODUS kann I, I<7bit>, I oder I sein, wobei I die Vorgabe ist." #. type: =item #: dos2unix.pod:157 msgid "B<-D, --display-enc ENCODING>" msgstr "B<-D, --display-enc KODIERUNG>" #. type: textblock #: dos2unix.pod:159 msgid "Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default." msgstr "legt die Kodierung des angezeigten Texts fest. KODIERUNG kann I, I, I, I oder sein, wobei I die Vorgabe ist." #. type: textblock #: dos2unix.pod:163 msgid "This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed." msgstr "Diese Option ist nur in dos2unix für Windows mit Unterstützung für Unicode-Dateinamen verfügbar. Sie bleibt wirkungslos, wenn die tatsächlichen Dateinamen gelesen und geschrieben werden, lediglich bei der Darstellung wird sie berücksichtigt." #. type: textblock #: dos2unix.pod:167 msgid "There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages." msgstr "Es gibt verschiedene Möglichkeiten, Text in einer Windows-Konsole basierend auf dessen Kodierung darzustellen. Alle haben verschiedene Vor- und Nachteile." #. type: =item #: dos2unix.pod:173 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:175 msgid "Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page." msgstr "Die Standardmethode von dos2unix ist die Verwendung von ANSI-kodiertem Text, der Vorteil ist deren Abwärtskompatibilität. Dies funktioniert mit Raster- und TrueType-Schriften. In manchen Gebieten müssen Sie mit dem Befehl C die aktive DOS-OEM-Codepage in die -System-ANSI-Codepage des Systems ändern, da dos2unix Letztere verwendet." #. type: textblock #: dos2unix.pod:181 msgid "The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK." msgstr "Der Nachteil von ANSI ist, dass internationale Dateinamen nicht korrekt dargestellt werden, wenn darin Zeichen enthalten sind, die nicht in der im System voreingestellten Codepage enthalten sind. Stattdessen wird entweder ein Fragezeichen oder ein falsches Zeichen angezeigt. Sofern Sie nicht mit fremden Dateinamen arbeiten, ist diese Methode in Ordnung." #. type: =item #: dos2unix.pod:186 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:188 msgid "The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it." msgstr "Der Vorteil von Unicode (dem Windows-Namen für UTF-16) ist die üblicherweise korrekte Textdarstellung. Eine Änderung der aktiven Codepage ist nicht erforderlich. Sie müssen die Schriftart der Konsole auf eine TrueType-Schrift einstellen, damit internationale Zeichen richtig angezeigt werden können. Sollte ein Zeichen in einer TrueType-Schrift nicht enthalten sein, wird ein kleines Quadrat angezeigt, das gelegentlich noch ein Fragezeichen enthält." #. type: textblock #: dos2unix.pod:194 msgid "When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font." msgstr "Wenn Sie die ConEmu-Konsole nutzen, wird der gesamte Text korrekt dargestellt, da ConEmu automatisch eine passende Schrift wählt." #. type: textblock #: dos2unix.pod:197 msgid "The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program." msgstr "Nachteilig für Unicode ist, dass es nicht zu ASCII kompatibel ist. Die Ausgabe ist schwer zu verarbeiten, wenn sie in ein anderes Programm oder eine Datei weitergeleitet wird." #. type: textblock #: dos2unix.pod:200 msgid "When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "Wenn die Methode C verwendet wird, dann wird dem Unicode-Text eine BOM (Markierung der Bytereihenfolge) vorangestellt. Eine BOM ist ist für korrekte um- oder Weiterleitung in der PowerShell notwendig." #. type: =item #: dos2unix.pod:205 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:207 msgid "The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding." msgstr "Der Vorteil von UTF-8 ist die ASCII-Kompatibilität. Sie müssen die Schriftart der Konsole auf eine TrueType-Schrift setzen. Dadurch wird der Text ähnlich wie in der C-Kodierung dargestellt." #. type: textblock #: dos2unix.pod:211 msgid "The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed." msgstr "Der Nachteil ist die falsche Darstellung aller Nicht-ASCII-Zeichen, wenn Sie die Standard-Rasterschrift verwenden. Nicht nur Unicode-Dateinamen, sondern auch übersetzte Meldungen werden unlesbar. Auf einem Windows-System, das für eine ostasiatische Region eingerichtet wurde, wird die Konsole bei der Anzeige von Meldungen deutlich flackern." #. type: textblock #: dos2unix.pod:217 msgid "In a ConEmu console the utf8 encoding method works well." msgstr "In einer ConEmu-Konsole funktioniert die UTF-8-Kodierung gut." #. type: textblock #: dos2unix.pod:219 msgid "When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "Wenn die Methode C verwendet wird, dann wird dem UTF-8-Text eine BOM (Markierung der Bytereihenfolge) vorangestellt. Eine BOM ist ist für korrekte um- oder Weiterleitung in der PowerShell notwendig." #. type: textblock #: dos2unix.pod:226 msgid "The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C." msgstr "Die Standardkodierung kann durch Setzen der Umgebungsvariable DOS2UNIX_DISPLAY_ENC auf C, C, C oder C geändert werden." #. type: =item #: dos2unix.pod:229 msgid "B<-f, --force>" msgstr "B<-f, --force>" #. type: textblock #: dos2unix.pod:231 msgid "Force conversion of binary files." msgstr "erzwingt die Umwandlung von Binärdateien." #. type: =item #: dos2unix.pod:233 msgid "B<-gb, --gb18030>" msgstr "B<-gb, --gb18030>" #. type: textblock #: dos2unix.pod:235 msgid "On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030." msgstr "wandelt unter Windows UTF-16-Dateien standardmäßig in UTF-8 um, ungeachtet der Einstellung der Locale. Verwenden Sie diese Option zum umwandeln von Utf-16-Dateien in GB18030. Diese Option ist nur unter Windows verfügbar. Siehe auch Abschnitt GB18030." #. type: =item #: dos2unix.pod:239 msgid "B<-h, --help>" msgstr "B<-h, --help>" #. type: textblock #: dos2unix.pod:241 msgid "Display help and exit." msgstr "zeigt eine Hilfe an und beendet das Programm." #. type: =item #: dos2unix.pod:243 msgid "B<-i[FLAGS], --info[=FLAGS] FILE ...>" msgstr "B<-i[SCHALTER], --info[=SCHALTER] DATEI>" #. type: textblock #: dos2unix.pod:245 msgid "Display file information. No conversion is done." msgstr "zeigt Dateiinformationen an. Es wird keine Umwandlung vorgenommen." #. type: textblock #: dos2unix.pod:247 msgid "The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name." msgstr "Die Ausgabe der Informationen geschieht in der folgenden Reihenfolge: Anzahl der DOS-Zeilenumbrüche, Anzahl der Unix-Zeilenumbrüche, Anzahl der Mac-Zeilenumbrüche, Markierung der Bytereihenfolge, Text- oder Binärformat, Dateiname." #. type: textblock #: dos2unix.pod:251 msgid "Example output:" msgstr "Beispielausgabe:" #. type: verbatim #: dos2unix.pod:253 #, no-wrap msgid "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" msgstr "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" #. type: textblock #: dos2unix.pod:262 msgid "Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>." msgstr "Beachten sie, dass manchmal eine Binärdatei fälschlicherweise als Textdatei erkannt wird. Siehe auch Option C<-s>." #. type: textblock #: dos2unix.pod:264 msgid "Optionally extra flags can be set to change the output. One or more flags can be added." msgstr "Optionale zusätzliche Schalter können gesetzt werden, um die Ausgabe anzupassen. Einer oder mehrere Schalter können hinzugefügt werden." #. type: =item #: dos2unix.pod:269 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:271 msgid "Print number of DOS line breaks." msgstr "gibt die Anzahl der DOS-Zeilenumbrüche aus." #. type: =item #: dos2unix.pod:273 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:275 msgid "Print number of Unix line breaks." msgstr "gibt die Anzahl der Unix-Zeilenumbrüche aus." #. type: =item #: dos2unix.pod:277 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:279 msgid "Print number of Mac line breaks." msgstr "gibt die Anzahl der Mac-Zeilenumbrüche aus." #. type: =item #: dos2unix.pod:281 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:283 msgid "Print the byte order mark." msgstr "gibt die Markierung der Bytereihenfolge aus." #. type: =item #: dos2unix.pod:285 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:287 msgid "Print if file is text or binary." msgstr "zeigt an, ob es sich um eine Text- oder eine Binärdatei handelt." #. type: =item #: dos2unix.pod:289 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:291 msgid "Print only the files that would be converted." msgstr "gibt nur die Dateien aus, die umgewandelt werden würden." #. type: textblock #: dos2unix.pod:293 msgid "With the C flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks." msgstr "Mit dem Schalter C gibt dos2unix nur die Dateien aus, die DOS-Zeilenumbrüche enthalten, unix2dos nur die Dateien mit Unix-Zeilenumbrüchen." #. type: =item #: dos2unix.pod:296 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:298 msgid "Print a header." msgstr "gibt eine Kopfzeile aus." #. type: =item #: dos2unix.pod:300 msgid "B

" msgstr "B

" #. type: textblock #: dos2unix.pod:302 msgid "Show file names without path." msgstr "zeigt Dateinamen ohne Pfade an." #. type: textblock #: dos2unix.pod:306 msgid "Examples:" msgstr "Beispiele:" #. type: textblock #: dos2unix.pod:308 msgid "Show information for all *.txt files:" msgstr "Informationen zu allen *.txt-Dateien anzeigen:" #. type: verbatim #: dos2unix.pod:310 #, no-wrap msgid "" " dos2unix -i *.txt\n" "\n" msgstr "" " dos2unix -i *.txt\n" "\n" #. type: textblock #: dos2unix.pod:312 msgid "Show only the number of DOS line breaks and Unix line breaks:" msgstr "Nur die Anzahl der DOS-Zeilenumbrüche und Unix-Zeilenumbrüche anzeigen:" #. type: verbatim #: dos2unix.pod:314 #, no-wrap msgid "" " dos2unix -idu *.txt\n" "\n" msgstr "" " dos2unix -idu *.txt\n" "\n" #. type: textblock #: dos2unix.pod:316 msgid "Show only the byte order mark:" msgstr "Nur die Markierung der Bytereihenfolge anzeigen:" #. type: verbatim #: dos2unix.pod:318 #, no-wrap msgid "" " dos2unix --info=b *.txt\n" "\n" msgstr "" " dos2unix --info=b *.txt\n" "\n" #. type: textblock #: dos2unix.pod:320 msgid "List the files that have DOS line breaks:" msgstr "Die Dateien auflisten, die DOS-Zeilenumbrüche enthalten:" #. type: verbatim #: dos2unix.pod:322 #, no-wrap msgid "" " dos2unix -ic *.txt\n" "\n" msgstr "" " dos2unix -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:324 msgid "List the files that have Unix line breaks:" msgstr "Die Dateien auflisten, die Unix-Zeilenumbrüche enthalten:" #. type: verbatim #: dos2unix.pod:326 #, no-wrap msgid "" " unix2dos -ic *.txt\n" "\n" msgstr "" " unix2dos -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:328 msgid "Convert only files that have DOS line breaks and leave the other files untouched:" msgstr "Nur Dateien umwandeln, die DOS-Zeilenumbrüche enthalten und die anderen Dateien unverändert belassen:" #. type: verbatim #: dos2unix.pod:330 #, no-wrap msgid "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" msgstr "" " find . -name '*.txt' |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:332 msgid "Find text files that have DOS line breaks:" msgstr "Nach Textdateien suchen, die DOS-Zeilenumbrüche enthalten:" #. type: verbatim #: dos2unix.pod:334 #, no-wrap msgid "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" msgstr "" " find . -name '*.txt' |xargs dos2unix\n" "\n" #. type: =item #: dos2unix.pod:336 msgid "B<-k, --keepdate>" msgstr "B<-k, --keepdate>" #. type: textblock #: dos2unix.pod:338 msgid "Keep the date stamp of output file same as input file." msgstr "übernimmt den Zeitstempel der Eingabedatei in die Ausgabedatei." #. type: =item #: dos2unix.pod:340 msgid "B<-L, --license>" msgstr "B<-L, --license>" #. type: textblock #: dos2unix.pod:342 msgid "Display program's license." msgstr "zeigt die Lizenz des Programms an." #. type: =item #: dos2unix.pod:344 msgid "B<-l, --newline>" msgstr "B<-l, --newline>" #. type: textblock #: dos2unix.pod:346 msgid "Add additional newline." msgstr "fügt eine zusätzliche neue Zeile hinzu." #. type: textblock #: dos2unix.pod:348 msgid "B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks." msgstr "B: Nur DOS-Zeilenumbrüche werden in Unix-Zeilenumbrüche umgewandelt. Im Mac-Modus werden nur Mac-Zeilenumbrüche in Unix-Zeilenumbrüche umgewandelt." #. type: textblock #: dos2unix.pod:352 msgid "B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks." msgstr "B: Nur Unix-Zeilenumbrüche werden in DOS-Zeilenumbrüche umgewandelt. Im Mac-Modus werden nur Unix-Zeilenumbrüche in Mac-Zeilenumbrüche umgewandelt." #. type: =item #: dos2unix.pod:355 msgid "B<-m, --add-bom>" msgstr "B<-m, --add-bom>" #. type: textblock #: dos2unix.pod:357 msgid "Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written." msgstr "schreibt eine Markierung der Bytereihenfolge (BOM) in die Ausgabedatei. In der Voreinstellung wird eine UTF-8-BOM geschrieben." #. type: textblock #: dos2unix.pod:360 msgid "When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM will be written." msgstr "Wenn die Eingabedatei in UTF-16 kodiert ist und die Option C<-u> verwendet wird, wird eine UTF-16-BOM geschrieben." #. type: textblock #: dos2unix.pod:363 msgid "Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE." msgstr "Verwenden Sie diese Option niemals, wenn die Kodierung der Ausgabedatei nicht UTF-8, UTF-16 oder GB 18030 ist. Weitere Informationen finden Sie im Abschnitt UNICODE." #. type: =item #: dos2unix.pod:367 msgid "B<-n, --newfile INFILE OUTFILE ...>" msgstr "B<-n, --newfile EINGABEDATEI AUSGABEDATEI …>" #. type: textblock #: dos2unix.pod:369 msgid "New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files." msgstr "Neue-Datei-Modus. Die EINGABEDATEI wird umgewandelt und in die AUSGABEDATEI geschrieben. Die Dateinamen müssen paarweise angegeben werden. Platzhalter sollten I verwendet werden, sonst werden Sie Ihre Dateien I." #. type: textblock #: dos2unix.pod:373 msgid "The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion." msgstr "Der Benutzer, der die Umwandlung im Neue-Datei-Modus startet, wird Besitzer der umgewandelten Datei. Die Lese- und Schreibrechte werden aus den Zugriffsrechten der Originaldatei minus der umask(1) der Person ermittelt, die die Umwandlung ausgeführt hat." #. type: =item #: dos2unix.pod:378 msgid "B<-o, --oldfile FILE ...>" msgstr "B<-o, --oldfile DATEI …>" #. type: textblock #: dos2unix.pod:380 msgid "Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used." msgstr "Alte-Datei-Modus. Die DATEI wird umgewandelt und durch die Ausgabedatei überschrieben. Per Vorgabe werden Umwandlungen in diesem Modus ausgeführt. Platzhalter sind verwendbar." #. type: textblock #: dos2unix.pod:383 msgid "In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix." msgstr "Im Alte-Datei-Modus (Ersetzungsmodus) erhalten die umgewandelten Dateien den gleichen Eigentümer, die gleiche Gruppe und die gleichen Lese- und Schreibberechtigungen wie die Originaldatei, auch wenn die Datei von einem anderen Benutzer umgewandelt wird, der Schreibrechte für die Datei hat (zum Beispiel der Systemadministrator). Die Umwandlung wird abgebrochen, wenn es nicht möglich ist, die originalen Werte beizubehalten. Die Änderung des Eigentümers könnte zum Beispiel bewirken, dass der ursprüngliche Eigentümer die Datei nicht mehr lesen kann. Die Änderung der Gruppe könnte ein Sicherheitsrisiko sein, da die Datei vielleicht für Benutzer lesbar wird, für die sie nicht bestimmt ist. Die Beibehaltung von Eigentümer, Gruppe und Schreib- und Leserechten wird nur unter Unix unterstützt." #. type: =item #: dos2unix.pod:392 msgid "B<-q, --quiet>" msgstr "B<-q, --quiet>" #. type: textblock #: dos2unix.pod:394 msgid "Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used." msgstr "Stiller Modus, in dem alle Warnungen und sonstige Meldungen unterdrückt werden. Der Rückgabewert ist 0, außer wenn fehlerhafte Befehlszeilenoptionen angegeben werden." #. type: =item #: dos2unix.pod:397 msgid "B<-r, --remove-bom>" msgstr "B<-r, --remove-bom>" #. type: textblock #: dos2unix.pod:399 msgid "Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option C<-b>." msgstr "entfernt die Markierung der Bytereihenfolge (BOM). Es wird keine BOM in die Ausgabedatei geschrieben. Dies ist das Standardverhalten beim Umwandeln von Unix-Zeilenumbrüchen. Siehe auch die Option C<-b>." #. type: =item #: dos2unix.pod:403 msgid "B<-s, --safe>" msgstr "B<-s, --safe>" #. type: textblock #: dos2unix.pod:405 msgid "Skip binary files (default)." msgstr "überspringt Binärdateien (Vorgabe)." #. type: textblock #: dos2unix.pod:407 msgid "The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file." msgstr "Binärdateien werden übersprungen, damit unerwünschtes Fehlverhalten vermieden wird. Denken Sie daran, dass die Erkennung nicht 100% sicher funktioniert. Die übergebenen Dateien werden auf Binärsymbole überprüft, die typischerweise in Textdateien nicht vorkommen. Es ist jedoch möglich, dass eine Binärdatei ausschließlich gewöhnliche Textzeichen enthält. Eine solche Binärdatei wird dann fälschlicherweise als Textdatei angesehen." #. type: =item #: dos2unix.pod:413 msgid "B<-u, --keep-utf16>" msgstr "B<-u, --keep-utf16>" #. type: textblock #: dos2unix.pod:415 msgid "Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the C<-ascii> option." msgstr "erhält die originale UTF-16-Kodierung der Eingabedatei. Die Ausgabedatei wird in der gleichen UTF-16-Kodierung geschrieben (Little-Endian- oder Big-Endian-Bytereihenfolge) wie die Eingabedatei. Dies verhindert die Umwandlung in UTF-8. Eine UTF-16-BOM wird dementsprechend geschrieben. Diese Option kann durch Angabe der Option C<-ascii> deaktiviert werden." #. type: =item #: dos2unix.pod:420 msgid "B<-ul, --assume-utf16le>" msgstr "B<-ul, --assume-utf16le>" #. type: textblock #: dos2unix.pod:422 msgid "Assume that the input file format is UTF-16LE." msgstr "nimmt an, dass die Eingabedatei das Format UTF-16LE hat." #. type: textblock #: dos2unix.pod:424 msgid "When there is a Byte Order Mark in the input file the BOM has priority over this option." msgstr "Wenn die Eingabedatei eine Markierung der Bytereihenfolge enthält (BOM), dann hat die BOM Vorrang vor dieser Option." #. type: textblock #: dos2unix.pod:427 msgid "When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file." msgstr "Durch eine falsche Annahme (die Eingabedatei war nicht in UTF-16LE kodiert) mit erfolgreicher Umwandlung erhalten Sie eine UTF-8-Ausgabedatei mit fehlerhaftem Text. Sie können die fehlgeschlagene Umwandlung mit iconv(1) rückgängig machen, indem Sie die Rückumwandlung von UTF-8 nach UTF-16LE vornehmen. Dadurch gewinnen Sie die Originaldatei zurück." #. type: textblock #: dos2unix.pod:432 msgid "The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off." msgstr "Die Annahme von UTF-16LE wirkt wie ein I. Beim Wechsel zum vorgegebenen I-Modus wird die UTF16LE-Annahme deaktiviert." #. type: =item #: dos2unix.pod:435 msgid "B<-ub, --assume-utf16be>" msgstr "B<-ub, --assume-utf16be>" #. type: textblock #: dos2unix.pod:437 msgid "Assume that the input file format is UTF-16BE." msgstr "nimmt an, dass die Eingabedatei das Format UTF-16BE hat." #. type: textblock #: dos2unix.pod:439 msgid "This option works the same as option C<-ul>." msgstr "Diese Option ist gleichbedeutend mit C<-ul>." #. type: =item #: dos2unix.pod:441 msgid "B<-v, --verbose>" msgstr "B<-v, --verbose>" #. type: textblock #: dos2unix.pod:443 msgid "Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks." msgstr "zeigt ausführliche Meldungen an. Zusätzliche Informationen werden zu den Markierungen der Bytereihenfolge (BOM) und zur Anzahl der umgewandelten Zeilenumbrüche angezeigt." #. type: =item #: dos2unix.pod:446 msgid "B<-F, --follow-symlink>" msgstr "B<-F, --follow-symlink>" #. type: textblock #: dos2unix.pod:448 msgid "Follow symbolic links and convert the targets." msgstr "folgt symbolischen Links und wandelt die Zieldateien um." #. type: =item #: dos2unix.pod:450 msgid "B<-R, --replace-symlink>" msgstr "B<-R, --replace-symlink>" #. type: textblock #: dos2unix.pod:452 msgid "Replace symbolic links with converted files (original target files remain unchanged)." msgstr "ersetzt symbolische Links durch die umgewandelten Dateien (die originalen Zieldateien bleiben unverändert)." #. type: =item #: dos2unix.pod:455 msgid "B<-S, --skip-symlink>" msgstr "B<-S, --skip-symlink>" #. type: textblock #: dos2unix.pod:457 msgid "Keep symbolic links and targets unchanged (default)." msgstr "erhält symbolische Links als solche und lässt die Ziele unverändert (Vorgabe)." #. type: =item #: dos2unix.pod:459 msgid "B<-V, --version>" msgstr "B<-V, --version>" #. type: textblock #: dos2unix.pod:461 msgid "Display version information and exit." msgstr "zeigt Versionsinformationen an und beendet das Programm." #. type: =head1 #: dos2unix.pod:465 msgid "MAC MODE" msgstr "MAC-MODUS" #. type: textblock #: dos2unix.pod:467 msgid "In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted." msgstr "Im Normalmodus werden Zeilenumbrüche von DOS nach Unix und umgekehrt umgewandelt. Mac-Zeilenumbrüche werden nicht verändert." #. type: textblock #: dos2unix.pod:470 msgid "In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed." msgstr "Im Mac-Modus werden Zeilenumbrüche von Mac nach Unix und umgekehrt umgewandelt. DOS-Zeilenumbrüche werden nicht verändert." #. type: textblock #: dos2unix.pod:473 msgid "To run in Mac mode use the command-line option C<-c mac> or use the commands C or C." msgstr "Um das Programm im Mac-Modus auszuführen, verwenden Sie die Befehlszeilenoption C<-c mac> oder die Befehle C oder C." #. type: =head1 #: dos2unix.pod:476 msgid "CONVERSION MODES" msgstr "UMWANDLUNGSMODI" #. type: =item #: dos2unix.pod:480 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:482 msgid "In mode C only line breaks are converted. This is the default conversion mode." msgstr "Im C-Modus werden nur Zeilenumbrüche umgewandelt. Dies ist der vorgegebene Umwandlungsmodus." #. type: textblock #: dos2unix.pod:485 msgid "Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files." msgstr "Obwohl der Name dieses Modus auf ASCII hinweist, welches ein 7-bit-Standard ist, bezieht sich der eigentliche Modus auf 8 Bit. Verwenden Sie diesen Modus immer dann, wenn Sie Unicode-Dateien in UTF-8-Kodierung umwandeln." #. type: =item #: dos2unix.pod:489 msgid "B<7bit>" msgstr "B<7bit>" #. type: textblock #: dos2unix.pod:491 msgid "In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space." msgstr "In diesem Modus werden alle Nicht-ASCII-Zeichen aus 8 Bit in das 7-Bit-Bitmuster umgewandelt." #. type: =item #: dos2unix.pod:494 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:496 msgid "Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart." msgstr "Die Zeichen werden aus dem DOS-Zeichensatz (der Codepage) in den ISO-Zeichensatz ISO-8859-1 (Latin-1) in Unix umgewandelt. DOS-Zeichen ohne Äquivalent in ISO-8859-1, für die die Umwandlung nicht möglich ist, werden durch einen Punkt ersetzt. Gleiches gilt für ISO-8859-1-Zeichen ohne DOS-Gegenstück." #. type: textblock #: dos2unix.pod:501 msgid "When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings." msgstr "Wenn nur die Option C<-iso> angegeben ist, versucht dos2unix die aktive Codepage selbst zu ermitteln. Sollte dies nicht möglich sein, wird die Standard-Codepage CP437 verwendet, welche hauptsächlich in den USA eingesetzt wird. Um eine bestimmte Codepage zu erzwingen, verwenden Sie die Optionen C<-437> (US), C<-850> (Westeuropäisch), C<-860> (Portugiesisch), C<-863> (Kanadisches Französisch) oder C<-865> (Skandinavisch). Die Windows-Codepage CP1252 (Westeuropäisch) wird durch die Option C<-1252> unterstützt." #. type: textblock #: dos2unix.pod:510 msgid "Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files." msgstr "Wenden Sie niemals die ISO-Umwandlung auf Unicode-Textdateien an. In UTF-8 kodierte Dateien werden dadurch beschädigt." #. type: textblock #: dos2unix.pod:512 msgid "Some examples:" msgstr "Einige Beispiele:" #. type: textblock #: dos2unix.pod:514 msgid "Convert from DOS default code page to Unix Latin-1:" msgstr "Umwandlung aus der vorgegebenen DOS-Codepage nach Unix Latin-1:" #. type: verbatim #: dos2unix.pod:516 #, no-wrap msgid "" " dos2unix -iso -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -iso -n in.txt ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:518 msgid "Convert from DOS CP850 to Unix Latin-1:" msgstr "Umwandlung von DOS CP850 nach Unix Latin-1:" #. type: verbatim #: dos2unix.pod:520 #, no-wrap msgid "" " dos2unix -850 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -850 -n eingabe.txt ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:522 msgid "Convert from Windows CP1252 to Unix Latin-1:" msgstr "Umwandlung von Windows CP1252 nach Unix Latin-1:" #. type: verbatim #: dos2unix.pod:524 #, no-wrap msgid "" " dos2unix -1252 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -1252 -n eingabe.txt ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:526 msgid "Convert from Windows CP1252 to Unix UTF-8 (Unicode):" msgstr "Umwandlung von Windows CP1252 nach Unix UTF-8 (Unicode):" #. type: verbatim #: dos2unix.pod:528 #, no-wrap msgid "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" msgstr "" " iconv -f CP1252 -t UTF-8 eingabe.txt | dos2unix > ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:530 msgid "Convert from Unix Latin-1 to DOS default code page:" msgstr "Umwandlung von Unix Latin-1 in die vorgegebene DOS-Codepage:" #. type: verbatim #: dos2unix.pod:532 #, no-wrap msgid "" " unix2dos -iso -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -iso -n eingabe.txt ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:534 msgid "Convert from Unix Latin-1 to DOS CP850:" msgstr "Umwandlung von Unix Latin-1 nach DOS CP850:" #. type: verbatim #: dos2unix.pod:536 #, no-wrap msgid "" " unix2dos -850 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -850 -n eingabe.txt ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:538 msgid "Convert from Unix Latin-1 to Windows CP1252:" msgstr "Umwandlung von Unix Latin-1 nach Windows CP1252:" #. type: verbatim #: dos2unix.pod:540 #, no-wrap msgid "" " unix2dos -1252 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -1252 -n eingabe.txt ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:542 msgid "Convert from Unix UTF-8 (Unicode) to Windows CP1252:" msgstr "Umwandlung von Unix UTF-8 (Unicode) nach Windows CP1252:" #. type: verbatim #: dos2unix.pod:544 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" msgstr "" " unix2dos < eingabe.txt | iconv -f UTF-8 -t CP1252 > ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:546 msgid "See also L and L." msgstr "Siehe auch L und L." #. type: =head1 #: dos2unix.pod:551 msgid "UNICODE" msgstr "UNICODE" #. type: =head2 #: dos2unix.pod:553 msgid "Encodings" msgstr "Zeichenkodierungen" #. type: textblock #: dos2unix.pod:555 msgid "There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format." msgstr "Es gibt verschiedene Unicode-Zeichenkodierungen. Unter Unix und Linux sind Unicode-Dateien typischerweise in UTF-8 kodiert. Unter Windows können Textdateien in UTF-8, UTF-16 oder UTF-16 in Big-Endian-Bytereihenfolge kodiert sein, liegen aber meist im Format UTF-16 vor." #. type: =head2 #: dos2unix.pod:560 msgid "Conversion" msgstr "Umwandlung" #. type: textblock #: dos2unix.pod:562 msgid "Unicode text files can have DOS, Unix or Mac line breaks, like regular text files." msgstr "Unicode-Textdateien können DOS-, Unix- oder Mac-Zeilenumbrüche enthalten, so wie reguläre Textdateien." #. type: textblock #: dos2unix.pod:565 msgid "All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII." msgstr "Alle Versionen von dos2unix und unix2dos können UTF-8-kodierte Dateien umwandeln, weil UTF-8 im Hinblick auf Abwärtskompatiblität mit ASCII entwickelt wurde." #. type: textblock #: dos2unix.pod:568 msgid "Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C." msgstr "Dos2unix und unix2dos mit Unterstützung für UTF-16 können in UTF-16 kodierte Dateien in Little-Endian- und Big-Endian-Bytereihenfolge lesen. Um festzustellen, ob dos2unix mit UTF-16-Unterstützung kompiliert wurde, geben Sie C ein." #. type: textblock #: dos2unix.pod:572 msgid "On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped." msgstr "Unter Unix/Linux werden UTF-16 kodierte Dateien standardmäßig in die Zeichenkodierung entsprechend der Locale umgewandelt. Mit dem Befehl locale(1) können Sie herausfinden, wie die Zeichenkodierung der Locale eingestellt ist. Wenn eine Umwandlung nicht möglich ist, verursacht dies einen Umwandlungsfehler, wodurch die Datei übersprungen wird." #. type: textblock #: dos2unix.pod:577 msgid "On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux." msgstr "Unter Windows werden UTF-16-Dateien standardmäßig in UTF-8 umgewandelt. In UTF-8 formatierte Textdateien werden von Windows und Unix/Linux gleichermaßen unterstützt." #. type: textblock #: dos2unix.pod:580 msgid "UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." msgstr "Die Kodierungen UTF-16 und UTF-8 sind vollständig kompatibel, daher wird bei der Umwandlung keinerlei Text verlorengehen. Sollte bei der Umwandlung von UTF-16 in UTF-8 ein Problem auftreten, beispielsweise wenn die UTF-16-kodierte Eingabedatei einen Fehler enthält, dann wird diese Datei übersprungen." #. type: textblock #: dos2unix.pod:584 msgid "When option C<-u> is used, the output file will be written in the same UTF-16 encoding as the input file. Option C<-u> prevents conversion to UTF-8." msgstr "Wenn die Option C<-u> verwendet wird, wird die Ausgabedatei in der gleichen UTF-16-Kodierung wie die Eingabedatei geschrieben. Die Option C<-u> verhindert die Umwandlung in UTF-8." #. type: textblock #: dos2unix.pod:587 msgid "Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16." msgstr "Dos2unix und unix2dos bieten keine Option zur Umwandlung von UTF-8-Dateien in UTF-16." #. type: textblock #: dos2unix.pod:589 msgid "ISO and 7-bit mode conversion do not work on UTF-16 files." msgstr "Umwandlungen im ISO- und 7bit-Modus funktionieren mit UTF-16-Dateien nicht." #. type: =head2 #: dos2unix.pod:591 msgid "Byte Order Mark" msgstr "Markierung der Bytereihenfolge" #. type: textblock #: dos2unix.pod:593 msgid "On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L." msgstr "Unicode-Textdateien unter Windows haben typischerweise eine Markierung der Bytereihenfolge (BOM), da viele Windows-Programme (zum Beispiel Notepad) solche BOMs standardmäßig hinzufügen. Weitere Informationen hierzu finden Sie auf L." #. type: textblock #: dos2unix.pod:597 msgid "On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding." msgstr "Unter Unix haben Textdateien üblicherweise keine BOM. Es wird stattdessen angenommen, dass Textdateien in der Zeichenkodierung entsprechend der Spracheinstellung vorliegen." #. type: textblock #: dos2unix.pod:600 msgid "Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file." msgstr "Dos2unix kann nur dann erkennen, ob eine Datei UTF-16-kodiert ist, wenn die Datei eine BOM enthält. Ist dies nicht der Fall, nimmt dos2unix an, dass es sich um eine Binärdatei handelt." #. type: textblock #: dos2unix.pod:604 msgid "Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM." msgstr "Verwenden Sie die Optionen C<-ul> oder C<-ub>, um eine UTF-16-Datei ohne BOM umzuwandeln." #. type: textblock #: dos2unix.pod:606 msgid "Dos2unix writes by default no BOM in the output file. With option C<-b> Dos2unix writes a BOM when the input file has a BOM." msgstr "Dos2unix schreibt in der Voreinstellung keine BOM in die Ausgabedatei. Mit der Option C<-b> schreibt Dos2unix eine BOM, wenn die Eingabedatei ebenfalls eine BOM hat." #. type: textblock #: dos2unix.pod:609 msgid "Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option C<-r> to remove the BOM." msgstr "Unix2dos schreibt in der Voreinstellung eine BOM in die Ausgabedatei, wenn die Eingabedatei ebenfalls eine solche Markierung hat. Verwenden Sie die Option C<-r>, um die BOM zu entfernen." #. type: textblock #: dos2unix.pod:612 msgid "Dos2unix and unix2dos write always a BOM when option C<-m> is used." msgstr "Dos2unix und unix2dos schreiben immer eine BOM, wenn die Option C<-m> angegeben ist." #. type: =head2 #: dos2unix.pod:614 msgid "Unicode file names on Windows" msgstr "Unicode-Dateinamen unter Windows" #. type: textblock #: dos2unix.pod:616 msgid "Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C." msgstr "Dos2unix verfügt über optionale Unterstützung für das Lesen und Schreiben von Unicode-Dateinamen in der Windows-Eingabeaufforderung. Dadurch kann dos2unix Dateien öffnen, deren Namen Zeichen enthalten, die nicht zur Standard-ANSI-Codepage des Systems gehören. Geben Sie C ein, um zu sehen, ob dos2unix für Windows mit Unterstützung für Unicode-Dateinamen erstellt wurde." #. type: textblock #: dos2unix.pod:622 msgid "There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name." msgstr "Die Anzeige von Unicode-Dateinamen in einer Windows-Konsole ist gelegentlich nicht fehlerfrei, siehe die Option C<-D>, C<--display-enc>. Die Dateinamen können falsch dargestellt werden, allerdings werden die Dateien mit deren korrekten Namen gespeichert." #. type: =head2 #: dos2unix.pod:626 msgid "Unicode examples" msgstr "Unicode-Beispiele" #. type: textblock #: dos2unix.pod:628 msgid "Convert from Windows UTF-16 (with BOM) to Unix UTF-8:" msgstr "Umwandlung von Windows UTF-16 (mit BOM) nach Unix UTF-8:" #. type: verbatim #: dos2unix.pod:630 #, no-wrap msgid "" " dos2unix -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -n eingabe.txt ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:632 msgid "Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:" msgstr "Umwandlung von Windows UTF-16LE (ohne BOM) nach Unix UTF-8:" #. type: verbatim #: dos2unix.pod:634 #, no-wrap msgid "" " dos2unix -ul -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -ul -n eingabe.txt ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:636 msgid "Convert from Unix UTF-8 to Windows UTF-8 with BOM:" msgstr "Umwandlung von Unix UTF-8 nach Windows UTF-8 mit BOM:" #. type: verbatim #: dos2unix.pod:638 #, no-wrap msgid "" " unix2dos -m -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -m -n eingabe.txt ausgabe.txt\n" "\n" #. type: textblock #: dos2unix.pod:640 msgid "Convert from Unix UTF-8 to Windows UTF-16:" msgstr "Umwandlung von Unix UTF-8 nach Windows UTF-16:" #. type: verbatim #: dos2unix.pod:642 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" msgstr "" " unix2dos < eingabe.txt | iconv -f UTF-8 -t UTF-16 > ausgabe.txt\n" "\n" #. type: =head1 #: dos2unix.pod:644 msgid "GB18030" msgstr "GB18030" #. type: textblock #: dos2unix.pod:646 msgid "GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also L." msgstr "GB18030 ist ein Standard der chinesischen Regierung. Eine Teilmenge des in GB18030 definierten Standards ist offiziell für alle in China verkauften Softwareprodukte vorgeschrieben. Siehe auch L." #. type: textblock #: dos2unix.pod:650 msgid "GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK." msgstr "GB18030 ist vollständig zu Unicode kompatibel und kann als Unicode-Umwandlungsformat betrahctet werden. Wie auch UTF-8 ist GB18030 kompatibel zu ASCII. Ebenfalls kompatibel ist es zur Codepage 936 von Windows, auch als GBK bekannt." #. type: textblock #: dos2unix.pod:654 msgid "On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command C to get the list of supported locales." msgstr "Unter Unix/Linux werden UTF-16-Dateien in GB18030 umgewandelt, wenn die Einstellung der Locale auf GB18030 gesetzt ist. Beachten Sie, dass dies nur funktioniert, wenn die Locale vom System unterstützt wird. Mit dem Befehl C erhalten Sie eine Liste der unterstützten Locales." #. type: textblock #: dos2unix.pod:658 msgid "On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030." msgstr "Unter Windows benötigen Sie die Option C<-gb>, um UTF-16-Dateien in GB18030 umwandeln zu können." #. type: textblock #: dos2unix.pod:660 msgid "GB18030 encoded files can have a Byte Order Mark, like Unicode files." msgstr "In GB 18030 kodierte Dateien haben wie Unicode-Dateien eine Markierung der Bytereihenfolge (BOM)." #. type: =head1 #: dos2unix.pod:662 msgid "EXAMPLES" msgstr "BEISPIELE" #. type: textblock #: dos2unix.pod:664 msgid "Read input from 'stdin' and write output to 'stdout':" msgstr "Aus der Standardeingabe lesen und in die Standardausgabe schreiben:" #. type: verbatim #: dos2unix.pod:666 #, fuzzy, no-wrap #| msgid "" #| " dos2unix -ic *.txt | xargs dos2unix\n" #| "\n" msgid "" " dos2unix < a.txt\n" " cat a.txt | dos2unix\n" "\n" msgstr "" " find . -name '*.txt' |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:669 msgid "Convert and replace a.txt. Convert and replace b.txt:" msgstr "a.txt umwandeln und ersetzen, b.txt umwandeln und ersetzen:" #. type: verbatim #: dos2unix.pod:671 #, no-wrap msgid "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" msgstr "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" #. type: textblock #: dos2unix.pod:674 msgid "Convert and replace a.txt in ascii conversion mode:" msgstr "a.txt im ascii-Modus umwandeln und ersetzen:" #. type: verbatim #: dos2unix.pod:676 #, no-wrap msgid "" " dos2unix a.txt\n" "\n" msgstr "" " dos2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:678 msgid "Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode:" msgstr "a.txt im ascii-Modus umwandeln und ersetzen, b.txt im 7bit-Modus umwandeln und ersetzen:" #. type: verbatim #: dos2unix.pod:681 #, no-wrap msgid "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" msgstr "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" #. type: textblock #: dos2unix.pod:685 msgid "Convert a.txt from Mac to Unix format:" msgstr "a.txt aus dem Mac- in das Unix-Format umwandeln:" #. type: verbatim #: dos2unix.pod:687 #, no-wrap msgid "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" msgstr "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:690 msgid "Convert a.txt from Unix to Mac format:" msgstr "a.txt aus dem Unix- in das Mac-Format umwandeln:" #. type: verbatim #: dos2unix.pod:692 #, no-wrap msgid "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" msgstr "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" #. type: textblock #: dos2unix.pod:695 msgid "Convert and replace a.txt while keeping original date stamp:" msgstr "a.txt unter Beibehaltung des ursprünglichen Zeitstempels umwandeln:" #. type: verbatim #: dos2unix.pod:697 #, no-wrap msgid "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" msgstr "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" #. type: textblock #: dos2unix.pod:700 msgid "Convert a.txt and write to e.txt:" msgstr "a.txt umwandeln und das Ergebnis nach e.txt schreiben:" #. type: verbatim #: dos2unix.pod:702 #, no-wrap msgid "" " dos2unix -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:704 msgid "Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:" msgstr "a.txt umwandeln und das Ergebnis nach e.txt schreiben, wobei e.txt den gleichen Zeitstempel erhält wie a.txt:" #. type: verbatim #: dos2unix.pod:706 #, no-wrap msgid "" " dos2unix -k -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -k -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:708 msgid "Convert and replace a.txt, convert b.txt and write to e.txt:" msgstr "a.txt umwandeln und ersetzen, b.txt umwandeln und das Ergebnis nach e.txt schreiben:" #. type: verbatim #: dos2unix.pod:710 #, no-wrap msgid "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" msgstr "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:713 msgid "Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt:" msgstr "c.txt umwandeln und das Ergebnis nach e.txt schreiben, a.txt umwandeln und ersetzen, b.txt umwandeln und ersetzen, d.txt umwandeln und das Ergebnis nach f.txt schreiben:" #. type: verbatim #: dos2unix.pod:716 #, no-wrap msgid "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" msgstr "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" #. type: =head1 #: dos2unix.pod:718 msgid "RECURSIVE CONVERSION" msgstr "REKURSIVE UMWANDLUNG" #. type: textblock #: dos2unix.pod:720 msgid "Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type:" msgstr "Verwenden Sie dos2unix zusammen mit den Befehlen find(1) und xargs(1), um Textdateien in einem Verzeichnisbaum rekursiv umzuwandeln. Um beispielsweise alle *.txt-Dateien im aktuellen Verzeichnis und dessen Unterverzeichnissen umzuwandeln, geben Sie Folgendes ein:" #. type: verbatim #: dos2unix.pod:724 #, no-wrap msgid "" " find . -name '*.txt' |xargs dos2unix\n" "\n" msgstr "" " find . -name '*.txt' |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:726 msgid "In a Windows Command Prompt the following command can be used:" msgstr "In einer Eingabeaufforderung kann der folgende Befehl verwendet werden:" #. type: verbatim #: dos2unix.pod:728 #, no-wrap msgid "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" msgstr "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" #. type: textblock #: dos2unix.pod:730 msgid "PowerShell users can use the following command in Windows PowerShell:" msgstr "In der Windows PowerShell können Sie folgenden Befehl verwenden:" #. type: verbatim #: dos2unix.pod:732 #, no-wrap msgid "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" msgstr "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" #. type: =head1 #: dos2unix.pod:735 msgid "LOCALIZATION" msgstr "LOKALISIERUNG" #. type: =item #: dos2unix.pod:739 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:741 msgid "The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:" msgstr "Die primäre Sprache wird durch die Umgebungsvariable LANG festgelegt. Diese Variable besteht aus mehreren Teilen: Der erste Teil besteht aus zwei Kleinbuchstaben, die den Sprachcode angeben. Der zweite Teil ist optional und bezeichnet den Ländercode in Großbuchstaben, vom davor stehenden Sprachcode durch einen Unterstrich getrennt. Der dritte Teil ist ebenfalls optional und gibt die Zeichenkodierung an, vom Ländercode durch einen Punkt getrennt. Einige Beispiele für Standard-POSIX-Shells:" #. type: verbatim #: dos2unix.pod:748 #, no-wrap msgid "" " export LANG=nl Dutch\n" " export LANG=nl_NL Dutch, The Netherlands\n" " export LANG=nl_BE Dutch, Belgium\n" " export LANG=es_ES Spanish, Spain\n" " export LANG=es_MX Spanish, Mexico\n" " export LANG=en_US.iso88591 English, USA, Latin-1 encoding\n" " export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding\n" "\n" msgstr "" " export LANG=de Deutsch\n" " export LANG=de_DE Deutsch, Deutschland\n" " export LANG=de_AT Deutsch, Österreich\n" " export LANG=es_ES Spanisch, Spanien\n" " export LANG=es_MX Spanisch, Mexiko\n" " export LANG=en_US.iso88591 Englisch, USA, Latin-1-Zeichenkodierung\n" " export LANG=en_GB.UTF-8 Englisch, GB, UTF-8-Zeichenkodierung\n" "\n" #. type: textblock #: dos2unix.pod:756 msgid "For a complete list of language and country codes see the gettext manual: L" msgstr "Eine vollständige Liste der Sprachen und Ländercodes finden Sie im Gettext-Handbuch: L" #. type: textblock #: dos2unix.pod:759 msgid "On Unix systems you can use the command locale(1) to get locale specific information." msgstr "Auf Unix-Systemen erhalten Sie mit dem Befehl locale(1) spezifische Informationen zu den Spracheinstellungen." #. type: =item #: dos2unix.pod:762 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:764 msgid "With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than \"C\", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L" msgstr "Mit der Umgebungsvariable LANGUAGE können Sie eine Prioritätenliste für Sprachen übergeben, die Sie durch Doppelpunkte voneinander trennen. Dos2unix gibt LANGUAGE vor LANG den Vorzug, zum Beispiel bei Deutsch vor Niederländisch: C. Sie müssen zunächst die Lokalisierung aktivieren, indem Sie die Variable LANG (oder LC_ALL) auf einen anderen Wert als »C« setzen, bevor Sie die Liste der Sprachprioritäten mit der Variable LANGUAGE nutzen können. Weitere Informationen finden Sie im Gettext-Handbuch: L" #. type: textblock #: dos2unix.pod:772 msgid "If you select a language which is not available you will get the standard English messages." msgstr "Falls Sie eine Sprache auswählen, die nicht verfügbar ist, erhalten Sie die Standardmeldungen in englischer Sprache." #. type: =item #: dos2unix.pod:776 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:778 msgid "With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used." msgstr "Durch die Umgebungsvariable DOS2UNIX_LOCALEDIR wird LOCALEDIR während der Kompilierung übergangen. LOCALEDIR wird verwendet, um Sprachdateien zu finden. Der GNU-Standardwert ist C. Die Option B<--version> zeigt das verwendete LOCALEDIR an." #. type: textblock #: dos2unix.pod:783 msgid "Example (POSIX shell):" msgstr "Beispiel (POSIX-Shell):" #. type: verbatim #: dos2unix.pod:785 #, no-wrap msgid "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" msgstr "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" #. type: =head1 #: dos2unix.pod:790 msgid "RETURN VALUE" msgstr "RÜCKGABEWERT" #. type: textblock #: dos2unix.pod:792 msgid "On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned." msgstr "Bei Erfolg wird 0 zurückgegeben. Bei aufgetretenen Systemfehlern wird der letzte Systemfehler zurückgegeben. Für alle anderen Fehler wird 1 zurückgegeben." #. type: textblock #: dos2unix.pod:795 msgid "The return value is always zero in quiet mode, except when wrong command-line options are used." msgstr "Der Rückgabewert ist im stillen Modus stets 0, außer wenn fehlerhafte Befehlszeilenoptionen verwendet werden." #. type: =head1 #: dos2unix.pod:798 msgid "STANDARDS" msgstr "STANDARDS" #. type: textblock #: dos2unix.pod:800 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:802 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:804 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:806 msgid "L" msgstr "L" #. type: =head1 #: dos2unix.pod:808 msgid "AUTHORS" msgstr "AUTOREN" #. type: textblock #: dos2unix.pod:810 msgid "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer)" msgstr "Benjamin Lin - , Bernd Johannes Wuebben (Mac2unix-Modus) - , Christian Wurll (Extra Zeilenumbruch) - , Erwin Waterlander - (Betreuer)" #. type: textblock #: dos2unix.pod:815 msgid "Project page: L" msgstr "Projektseite: L" #. type: textblock #: dos2unix.pod:817 msgid "SourceForge page: L" msgstr "SourceForge-Seite: L" #. type: =head1 #: dos2unix.pod:819 msgid "SEE ALSO" msgstr "SIEHE AUCH" #. type: textblock #: dos2unix.pod:821 msgid "file(1) find(1) iconv(1) locale(1) xargs(1)" msgstr "file(1) find(1) iconv(1) locale(1) xargs(1)" #~ msgid "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgstr "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" dos2unix-7.3.4/po-man/dos2unix-man.pot0000644000175500010010000012073512721132567017024 0ustar waterlanGeen# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2016-05-24 22:11+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: =head1 #: dos2unix.pod:52 msgid "NAME" msgstr "" #. type: textblock #: dos2unix.pod:54 msgid "dos2unix - DOS/Mac to Unix and vice versa text file format converter" msgstr "" #. type: =head1 #: dos2unix.pod:56 msgid "SYNOPSIS" msgstr "" #. type: verbatim #: dos2unix.pod:58 #, no-wrap msgid "" " dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]\n" " unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]\n" "\n" msgstr "" #. type: =head1 #: dos2unix.pod:61 msgid "DESCRIPTION" msgstr "" #. type: textblock #: dos2unix.pod:63 msgid "" "The Dos2unix package includes utilities C and C to " "convert plain text files in DOS or Mac format to Unix format and vice versa." msgstr "" #. type: textblock #: dos2unix.pod:66 msgid "" "In DOS/Windows text files a line break, also known as newline, is a " "combination of two characters: a Carriage Return (CR) followed by a Line " "Feed (LF). In Unix text files a line break is a single character: the Line " "Feed (LF). In Mac text files, prior to Mac OS X, a line break was single " "Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line " "breaks." msgstr "" #. type: textblock #: dos2unix.pod:72 msgid "" "Besides line breaks Dos2unix can also convert the encoding of files. A few " "DOS code pages can be converted to Unix Latin-1. And Windows Unicode " "(UTF-16) files can be converted to Unix Unicode (UTF-8) files." msgstr "" #. type: textblock #: dos2unix.pod:76 msgid "Binary files are automatically skipped, unless conversion is forced." msgstr "" #. type: textblock #: dos2unix.pod:78 msgid "Non-regular files, such as directories and FIFOs, are automatically skipped." msgstr "" #. type: textblock #: dos2unix.pod:80 msgid "" "Symbolic links and their targets are by default kept untouched. Symbolic " "links can optionally be replaced, or the output can be written to the " "symbolic link target. Writing to a symbolic link target is not supported on " "Windows." msgstr "" #. type: textblock #: dos2unix.pod:84 msgid "" "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one " "important difference with the original SunOS/Solaris version. This version " "does by default in-place conversion (old file mode), while the original " "SunOS/Solaris version only supports paired conversion (new file mode). See " "also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris " "version uses by default I mode conversion while this version uses by " "default I mode conversion." msgstr "" #. type: =head1 #: dos2unix.pod:92 msgid "OPTIONS" msgstr "" #. type: =item #: dos2unix.pod:96 msgid "B<-->" msgstr "" #. type: textblock #: dos2unix.pod:98 msgid "" "Treat all following options as file names. Use this option if you want to " "convert files whose names start with a dash. For instance to convert a file " "named \"-foo\", you can use this command:" msgstr "" #. type: verbatim #: dos2unix.pod:102 #, no-wrap msgid "" " dos2unix -- -foo\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:104 msgid "Or in new file mode:" msgstr "" #. type: verbatim #: dos2unix.pod:106 #, no-wrap msgid "" " dos2unix -n -- -foo out.txt\n" "\n" msgstr "" #. type: =item #: dos2unix.pod:108 msgid "B<-ascii>" msgstr "" #. type: textblock #: dos2unix.pod:110 msgid "Convert only line breaks. This is the default conversion mode." msgstr "" #. type: =item #: dos2unix.pod:112 msgid "B<-iso>" msgstr "" #. type: textblock #: dos2unix.pod:114 msgid "" "Conversion between DOS and ISO-8859-1 character set. See also section " "CONVERSION MODES." msgstr "" #. type: =item #: dos2unix.pod:117 msgid "B<-1252>" msgstr "" #. type: textblock #: dos2unix.pod:119 msgid "Use Windows code page 1252 (Western European)." msgstr "" #. type: =item #: dos2unix.pod:121 msgid "B<-437>" msgstr "" #. type: textblock #: dos2unix.pod:123 msgid "" "Use DOS code page 437 (US). This is the default code page used for ISO " "conversion." msgstr "" #. type: =item #: dos2unix.pod:125 msgid "B<-850>" msgstr "" #. type: textblock #: dos2unix.pod:127 msgid "Use DOS code page 850 (Western European)." msgstr "" #. type: =item #: dos2unix.pod:129 msgid "B<-860>" msgstr "" #. type: textblock #: dos2unix.pod:131 msgid "Use DOS code page 860 (Portuguese)." msgstr "" #. type: =item #: dos2unix.pod:133 msgid "B<-863>" msgstr "" #. type: textblock #: dos2unix.pod:135 msgid "Use DOS code page 863 (French Canadian)." msgstr "" #. type: =item #: dos2unix.pod:137 msgid "B<-865>" msgstr "" #. type: textblock #: dos2unix.pod:139 msgid "Use DOS code page 865 (Nordic)." msgstr "" #. type: =item #: dos2unix.pod:141 msgid "B<-7>" msgstr "" #. type: textblock #: dos2unix.pod:143 msgid "Convert 8 bit characters to 7 bit space." msgstr "" #. type: =item #: dos2unix.pod:145 msgid "B<-b, --keep-bom>" msgstr "" #. type: textblock #: dos2unix.pod:147 msgid "" "Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in " "the output file. This is the default behavior when converting to DOS line " "breaks. See also option C<-r>." msgstr "" #. type: =item #: dos2unix.pod:151 msgid "B<-c, --convmode CONVMODE>" msgstr "" #. type: textblock #: dos2unix.pod:153 msgid "" "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, " "I with ascii being the default." msgstr "" #. type: =item #: dos2unix.pod:157 msgid "B<-D, --display-enc ENCODING>" msgstr "" #. type: textblock #: dos2unix.pod:159 msgid "" "Set encoding of displayed text. Where ENCODING is one of: I, " "I, I, I, I with ansi being the default." msgstr "" #. type: textblock #: dos2unix.pod:163 msgid "" "This option is only available in dos2unix for Windows with Unicode file name " "support. This option has no effect on the actual file names read and " "written, only on how they are displayed." msgstr "" #. type: textblock #: dos2unix.pod:167 msgid "" "There are several methods for displaying text in a Windows console based on " "the encoding of the text. They all have their own advantages and " "disadvantages." msgstr "" #. type: =item #: dos2unix.pod:173 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:175 msgid "" "Dos2unix's default method is to use ANSI encoded text. The advantage is that " "it is backwards compatible. It works with raster and TrueType fonts. In some " "regions you may need to change the active DOS OEM code page to the Windows " "system ANSI code page using the C command, because dos2unix uses the " "Windows system code page." msgstr "" #. type: textblock #: dos2unix.pod:181 msgid "" "The disadvantage of ansi is that international file names with characters " "not inside the system default code page are not displayed properly. You will " "see a question mark, or a wrong symbol instead. When you don't work with " "foreign file names this method is OK." msgstr "" #. type: =item #: dos2unix.pod:186 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:188 msgid "" "The advantage of unicode (the Windows name for UTF-16) encoding is that text " "is usually properly displayed. There is no need to change the active code " "page. You may need to set the console's font to a TrueType font to have " "international characters displayed properly. When a character is not " "included in the TrueType font you usually see a small square, sometimes with " "a question mark in it." msgstr "" #. type: textblock #: dos2unix.pod:194 msgid "" "When you use the ConEmu console all text is displayed properly, because " "ConEmu automatically selects a good font." msgstr "" #. type: textblock #: dos2unix.pod:197 msgid "" "The disadvantage of unicode is that it is not compatible with ASCII. The " "output is not easy to handle when you redirect it to another program." msgstr "" #. type: textblock #: dos2unix.pod:200 msgid "" "When method C is used the Unicode text will be preceded with a " "BOM (Byte Order Mark). A BOM is required for correct redirection or piping " "in PowerShell." msgstr "" #. type: =item #: dos2unix.pod:205 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:207 msgid "" "The advantage of utf8 is that it is compatible with ASCII. You need to set " "the console's font to a TrueType font. With a TrueType font the text is " "displayed similar as with the C encoding." msgstr "" #. type: textblock #: dos2unix.pod:211 msgid "" "The disadvantage is that when you use the default raster font all non-ASCII " "characters are displayed wrong. Not only unicode file names, but also " "translated messages become unreadable. On Windows configured for an " "East-Asian region you may see a lot of flickering of the console when the " "messages are displayed." msgstr "" #. type: textblock #: dos2unix.pod:217 msgid "In a ConEmu console the utf8 encoding method works well." msgstr "" #. type: textblock #: dos2unix.pod:219 msgid "" "When method C is used the UTF-8 text will be preceded with a BOM " "(Byte Order Mark). A BOM is required for correct redirection or piping in " "PowerShell." msgstr "" #. type: textblock #: dos2unix.pod:226 msgid "" "The default encoding can be changed with environment variable " "DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or " "C." msgstr "" #. type: =item #: dos2unix.pod:229 msgid "B<-f, --force>" msgstr "" #. type: textblock #: dos2unix.pod:231 msgid "Force conversion of binary files." msgstr "" #. type: =item #: dos2unix.pod:233 msgid "B<-gb, --gb18030>" msgstr "" #. type: textblock #: dos2unix.pod:235 msgid "" "On Windows UTF-16 files are by default converted to UTF-8, regardless of the " "locale setting. Use this option to convert UTF-16 files to GB18030. This " "option is only available on Windows. See also section GB18030." msgstr "" #. type: =item #: dos2unix.pod:239 msgid "B<-h, --help>" msgstr "" #. type: textblock #: dos2unix.pod:241 msgid "Display help and exit." msgstr "" #. type: =item #: dos2unix.pod:243 msgid "B<-i[FLAGS], --info[=FLAGS] FILE ...>" msgstr "" #. type: textblock #: dos2unix.pod:245 msgid "Display file information. No conversion is done." msgstr "" #. type: textblock #: dos2unix.pod:247 msgid "" "The following information is printed, in this order: number of DOS line " "breaks, number of Unix line breaks, number of Mac line breaks, byte order " "mark, text or binary, file name." msgstr "" #. type: textblock #: dos2unix.pod:251 msgid "Example output:" msgstr "" #. type: verbatim #: dos2unix.pod:253 #, no-wrap msgid "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:262 msgid "" "Note that sometimes a binary file can be mistaken for a text file. See also " "option C<-s>." msgstr "" #. type: textblock #: dos2unix.pod:264 msgid "" "Optionally extra flags can be set to change the output. One or more flags " "can be added." msgstr "" #. type: =item #: dos2unix.pod:269 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:271 msgid "Print number of DOS line breaks." msgstr "" #. type: =item #: dos2unix.pod:273 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:275 msgid "Print number of Unix line breaks." msgstr "" #. type: =item #: dos2unix.pod:277 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:279 msgid "Print number of Mac line breaks." msgstr "" #. type: =item #: dos2unix.pod:281 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:283 msgid "Print the byte order mark." msgstr "" #. type: =item #: dos2unix.pod:285 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:287 msgid "Print if file is text or binary." msgstr "" #. type: =item #: dos2unix.pod:289 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:291 msgid "Print only the files that would be converted." msgstr "" #. type: textblock #: dos2unix.pod:293 msgid "" "With the C flag dos2unix will print only the files that contain DOS line " "breaks, unix2dos will print only file names that have Unix line breaks." msgstr "" #. type: =item #: dos2unix.pod:296 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:298 msgid "Print a header." msgstr "" #. type: =item #: dos2unix.pod:300 msgid "B

" msgstr "" #. type: textblock #: dos2unix.pod:302 msgid "Show file names without path." msgstr "" #. type: textblock #: dos2unix.pod:306 msgid "Examples:" msgstr "" #. type: textblock #: dos2unix.pod:308 msgid "Show information for all *.txt files:" msgstr "" #. type: verbatim #: dos2unix.pod:310 #, no-wrap msgid "" " dos2unix -i *.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:312 msgid "Show only the number of DOS line breaks and Unix line breaks:" msgstr "" #. type: verbatim #: dos2unix.pod:314 #, no-wrap msgid "" " dos2unix -idu *.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:316 msgid "Show only the byte order mark:" msgstr "" #. type: verbatim #: dos2unix.pod:318 #, no-wrap msgid "" " dos2unix --info=b *.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:320 msgid "List the files that have DOS line breaks:" msgstr "" #. type: verbatim #: dos2unix.pod:322 #, no-wrap msgid "" " dos2unix -ic *.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:324 msgid "List the files that have Unix line breaks:" msgstr "" #. type: verbatim #: dos2unix.pod:326 #, no-wrap msgid "" " unix2dos -ic *.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:328 msgid "" "Convert only files that have DOS line breaks and leave the other files " "untouched:" msgstr "" #. type: verbatim #: dos2unix.pod:330 #, no-wrap msgid "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:332 msgid "Find text files that have DOS line breaks:" msgstr "" #. type: verbatim #: dos2unix.pod:334 #, no-wrap msgid "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" msgstr "" #. type: =item #: dos2unix.pod:336 msgid "B<-k, --keepdate>" msgstr "" #. type: textblock #: dos2unix.pod:338 msgid "Keep the date stamp of output file same as input file." msgstr "" #. type: =item #: dos2unix.pod:340 msgid "B<-L, --license>" msgstr "" #. type: textblock #: dos2unix.pod:342 msgid "Display program's license." msgstr "" #. type: =item #: dos2unix.pod:344 msgid "B<-l, --newline>" msgstr "" #. type: textblock #: dos2unix.pod:346 msgid "Add additional newline." msgstr "" #. type: textblock #: dos2unix.pod:348 msgid "" "B: Only DOS line breaks are changed to two Unix line breaks. In " "Mac mode only Mac line breaks are changed to two Unix line breaks." msgstr "" #. type: textblock #: dos2unix.pod:352 msgid "" "B: Only Unix line breaks are changed to two DOS line breaks. In " "Mac mode Unix line breaks are changed to two Mac line breaks." msgstr "" #. type: =item #: dos2unix.pod:355 msgid "B<-m, --add-bom>" msgstr "" #. type: textblock #: dos2unix.pod:357 msgid "" "Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is " "written." msgstr "" #. type: textblock #: dos2unix.pod:360 msgid "" "When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM " "will be written." msgstr "" #. type: textblock #: dos2unix.pod:363 msgid "" "Never use this option when the output encoding is other than UTF-8, UTF-16, " "or GB18030. See also section UNICODE." msgstr "" #. type: =item #: dos2unix.pod:367 msgid "B<-n, --newfile INFILE OUTFILE ...>" msgstr "" #. type: textblock #: dos2unix.pod:369 msgid "" "New file mode. Convert file INFILE and write output to file OUTFILE. File " "names must be given in pairs and wildcard names should I be used or you " "I lose your files." msgstr "" #. type: textblock #: dos2unix.pod:373 msgid "" "The person who starts the conversion in new file (paired) mode will be the " "owner of the converted file. The read/write permissions of the new file will " "be the permissions of the original file minus the umask(1) of the person who " "runs the conversion." msgstr "" #. type: =item #: dos2unix.pod:378 msgid "B<-o, --oldfile FILE ...>" msgstr "" #. type: textblock #: dos2unix.pod:380 msgid "" "Old file mode. Convert file FILE and overwrite output to it. The program " "defaults to run in this mode. Wildcard names may be used." msgstr "" #. type: textblock #: dos2unix.pod:383 msgid "" "In old file (in-place) mode the converted file gets the same owner, group, " "and read/write permissions as the original file. Also when the file is " "converted by another user who has write permissions on the file (e.g. user " "root). The conversion will be aborted when it is not possible to preserve " "the original values. Change of owner could mean that the original owner is " "not able to read the file any more. Change of group could be a security " "risk, the file could be made readable for persons for whom it is not " "intended. Preservation of owner, group, and read/write permissions is only " "supported on Unix." msgstr "" #. type: =item #: dos2unix.pod:392 msgid "B<-q, --quiet>" msgstr "" #. type: textblock #: dos2unix.pod:394 msgid "" "Quiet mode. Suppress all warnings and messages. The return value is zero. " "Except when wrong command-line options are used." msgstr "" #. type: =item #: dos2unix.pod:397 msgid "B<-r, --remove-bom>" msgstr "" #. type: textblock #: dos2unix.pod:399 msgid "" "Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This " "is the default behavior when converting to Unix line breaks. See also " "option C<-b>." msgstr "" #. type: =item #: dos2unix.pod:403 msgid "B<-s, --safe>" msgstr "" #. type: textblock #: dos2unix.pod:405 msgid "Skip binary files (default)." msgstr "" #. type: textblock #: dos2unix.pod:407 msgid "" "The skipping of binary files is done to avoid accidental mistakes. Be aware " "that the detection of binary files is not 100% foolproof. Input files are " "scanned for binary symbols which are typically not found in text files. It " "is possible that a binary file contains only normal text characters. Such a " "binary file will mistakenly be seen as a text file." msgstr "" #. type: =item #: dos2unix.pod:413 msgid "B<-u, --keep-utf16>" msgstr "" #. type: textblock #: dos2unix.pod:415 msgid "" "Keep the original UTF-16 encoding of the input file. The output file will be " "written in the same UTF-16 encoding, little or big endian, as the input " "file. This prevents transformation to UTF-8. An UTF-16 BOM will be written " "accordingly. This option can be disabled with the C<-ascii> option." msgstr "" #. type: =item #: dos2unix.pod:420 msgid "B<-ul, --assume-utf16le>" msgstr "" #. type: textblock #: dos2unix.pod:422 msgid "Assume that the input file format is UTF-16LE." msgstr "" #. type: textblock #: dos2unix.pod:424 msgid "" "When there is a Byte Order Mark in the input file the BOM has priority over " "this option." msgstr "" #. type: textblock #: dos2unix.pod:427 msgid "" "When you made a wrong assumption (the input file was not in UTF-16LE format) " "and the conversion succeeded, you will get an UTF-8 output file with wrong " "text. You can undo the wrong conversion with iconv(1) by converting the " "UTF-8 output file back to UTF-16LE. This will bring back the original file." msgstr "" #. type: textblock #: dos2unix.pod:432 msgid "" "The assumption of UTF-16LE works as a I. By switching to " "the default I mode the UTF-16LE assumption is turned off." msgstr "" #. type: =item #: dos2unix.pod:435 msgid "B<-ub, --assume-utf16be>" msgstr "" #. type: textblock #: dos2unix.pod:437 msgid "Assume that the input file format is UTF-16BE." msgstr "" #. type: textblock #: dos2unix.pod:439 msgid "This option works the same as option C<-ul>." msgstr "" #. type: =item #: dos2unix.pod:441 msgid "B<-v, --verbose>" msgstr "" #. type: textblock #: dos2unix.pod:443 msgid "" "Display verbose messages. Extra information is displayed about Byte Order " "Marks and the amount of converted line breaks." msgstr "" #. type: =item #: dos2unix.pod:446 msgid "B<-F, --follow-symlink>" msgstr "" #. type: textblock #: dos2unix.pod:448 msgid "Follow symbolic links and convert the targets." msgstr "" #. type: =item #: dos2unix.pod:450 msgid "B<-R, --replace-symlink>" msgstr "" #. type: textblock #: dos2unix.pod:452 msgid "" "Replace symbolic links with converted files (original target files remain " "unchanged)." msgstr "" #. type: =item #: dos2unix.pod:455 msgid "B<-S, --skip-symlink>" msgstr "" #. type: textblock #: dos2unix.pod:457 msgid "Keep symbolic links and targets unchanged (default)." msgstr "" #. type: =item #: dos2unix.pod:459 msgid "B<-V, --version>" msgstr "" #. type: textblock #: dos2unix.pod:461 msgid "Display version information and exit." msgstr "" #. type: =head1 #: dos2unix.pod:465 msgid "MAC MODE" msgstr "" #. type: textblock #: dos2unix.pod:467 msgid "" "In normal mode line breaks are converted from DOS to Unix and vice versa. " "Mac line breaks are not converted." msgstr "" #. type: textblock #: dos2unix.pod:470 msgid "" "In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS " "line breaks are not changed." msgstr "" #. type: textblock #: dos2unix.pod:473 msgid "" "To run in Mac mode use the command-line option C<-c mac> or use the commands " "C or C." msgstr "" #. type: =head1 #: dos2unix.pod:476 msgid "CONVERSION MODES" msgstr "" #. type: =item #: dos2unix.pod:480 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:482 msgid "" "In mode C only line breaks are converted. This is the default " "conversion mode." msgstr "" #. type: textblock #: dos2unix.pod:485 msgid "" "Although the name of this mode is ASCII, which is a 7 bit standard, the " "actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 " "files." msgstr "" #. type: =item #: dos2unix.pod:489 msgid "B<7bit>" msgstr "" #. type: textblock #: dos2unix.pod:491 msgid "" "In this mode all 8 bit non-ASCII characters (with values from 128 to 255) " "are converted to a 7 bit space." msgstr "" #. type: =item #: dos2unix.pod:494 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:496 msgid "" "Characters are converted between a DOS character set (code page) and ISO " "character set ISO-8859-1 (Latin-1) on Unix. DOS characters without " "ISO-8859-1 equivalent, for which conversion is not possible, are converted " "to a dot. The same counts for ISO-8859-1 characters without DOS counterpart." msgstr "" #. type: textblock #: dos2unix.pod:501 msgid "" "When only option C<-iso> is used dos2unix will try to determine the active " "code page. When this is not possible dos2unix will use default code page " "CP437, which is mainly used in the USA. To force a specific code page use " "options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), " "C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 " "(Western European) is also supported with option C<-1252>. For other code " "pages use dos2unix in combination with iconv(1). Iconv can convert between " "a long list of character encodings." msgstr "" #. type: textblock #: dos2unix.pod:510 msgid "" "Never use ISO conversion on Unicode text files. It will corrupt UTF-8 " "encoded files." msgstr "" #. type: textblock #: dos2unix.pod:512 msgid "Some examples:" msgstr "" #. type: textblock #: dos2unix.pod:514 msgid "Convert from DOS default code page to Unix Latin-1:" msgstr "" #. type: verbatim #: dos2unix.pod:516 #, no-wrap msgid "" " dos2unix -iso -n in.txt out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:518 msgid "Convert from DOS CP850 to Unix Latin-1:" msgstr "" #. type: verbatim #: dos2unix.pod:520 #, no-wrap msgid "" " dos2unix -850 -n in.txt out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:522 msgid "Convert from Windows CP1252 to Unix Latin-1:" msgstr "" #. type: verbatim #: dos2unix.pod:524 #, no-wrap msgid "" " dos2unix -1252 -n in.txt out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:526 msgid "Convert from Windows CP1252 to Unix UTF-8 (Unicode):" msgstr "" #. type: verbatim #: dos2unix.pod:528 #, no-wrap msgid "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:530 msgid "Convert from Unix Latin-1 to DOS default code page:" msgstr "" #. type: verbatim #: dos2unix.pod:532 #, no-wrap msgid "" " unix2dos -iso -n in.txt out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:534 msgid "Convert from Unix Latin-1 to DOS CP850:" msgstr "" #. type: verbatim #: dos2unix.pod:536 #, no-wrap msgid "" " unix2dos -850 -n in.txt out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:538 msgid "Convert from Unix Latin-1 to Windows CP1252:" msgstr "" #. type: verbatim #: dos2unix.pod:540 #, no-wrap msgid "" " unix2dos -1252 -n in.txt out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:542 msgid "Convert from Unix UTF-8 (Unicode) to Windows CP1252:" msgstr "" #. type: verbatim #: dos2unix.pod:544 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:546 msgid "" "See also L and " "L." msgstr "" #. type: =head1 #: dos2unix.pod:551 msgid "UNICODE" msgstr "" #. type: =head2 #: dos2unix.pod:553 msgid "Encodings" msgstr "" #. type: textblock #: dos2unix.pod:555 msgid "" "There exist different Unicode encodings. On Unix and Linux Unicode files are " "typically encoded in UTF-8 encoding. On Windows Unicode text files can be " "encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in " "UTF-16 format." msgstr "" #. type: =head2 #: dos2unix.pod:560 msgid "Conversion" msgstr "" #. type: textblock #: dos2unix.pod:562 msgid "" "Unicode text files can have DOS, Unix or Mac line breaks, like regular text " "files." msgstr "" #. type: textblock #: dos2unix.pod:565 msgid "" "All versions of dos2unix and unix2dos can convert UTF-8 encoded files, " "because UTF-8 was designed for backward compatibility with ASCII." msgstr "" #. type: textblock #: dos2unix.pod:568 msgid "" "Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big " "endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 " "support type C." msgstr "" #. type: textblock #: dos2unix.pod:572 msgid "" "On Unix/Linux UTF-16 encoded files are converted to the locale character " "encoding. Use the locale(1) command to find out what the locale character " "encoding is. When conversion is not possible a conversion error will occur " "and the file will be skipped." msgstr "" #. type: textblock #: dos2unix.pod:577 msgid "" "On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted " "text files are well supported on both Windows and Unix/Linux." msgstr "" #. type: textblock #: dos2unix.pod:580 msgid "" "UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost " "in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for " "instance when the UTF-16 input file contains an error, the file will be " "skipped." msgstr "" #. type: textblock #: dos2unix.pod:584 msgid "" "When option C<-u> is used, the output file will be written in the same " "UTF-16 encoding as the input file. Option C<-u> prevents conversion to " "UTF-8." msgstr "" #. type: textblock #: dos2unix.pod:587 msgid "Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16." msgstr "" #. type: textblock #: dos2unix.pod:589 msgid "ISO and 7-bit mode conversion do not work on UTF-16 files." msgstr "" #. type: =head2 #: dos2unix.pod:591 msgid "Byte Order Mark" msgstr "" #. type: textblock #: dos2unix.pod:593 msgid "" "On Windows Unicode text files typically have a Byte Order Mark (BOM), " "because many Windows programs (including Notepad) add BOMs by default. See " "also L." msgstr "" #. type: textblock #: dos2unix.pod:597 msgid "" "On Unix Unicode files typically don't have a BOM. It is assumed that text " "files are encoded in the locale character encoding." msgstr "" #. type: textblock #: dos2unix.pod:600 msgid "" "Dos2unix can only detect if a file is in UTF-16 format if the file has a " "BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as " "a binary file." msgstr "" #. type: textblock #: dos2unix.pod:604 msgid "Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM." msgstr "" #. type: textblock #: dos2unix.pod:606 msgid "" "Dos2unix writes by default no BOM in the output file. With option C<-b> " "Dos2unix writes a BOM when the input file has a BOM." msgstr "" #. type: textblock #: dos2unix.pod:609 msgid "" "Unix2dos writes by default a BOM in the output file when the input file has " "a BOM. Use option C<-r> to remove the BOM." msgstr "" #. type: textblock #: dos2unix.pod:612 msgid "Dos2unix and unix2dos write always a BOM when option C<-m> is used." msgstr "" #. type: =head2 #: dos2unix.pod:614 msgid "Unicode file names on Windows" msgstr "" #. type: textblock #: dos2unix.pod:616 msgid "" "Dos2unix has optional support for reading and writing Unicode file names in " "the Windows Command Prompt. That means that dos2unix can open files that " "have characters in the name that are not part of the default system ANSI " "code page. To see if dos2unix for Windows was built with Unicode file name " "support type C." msgstr "" #. type: textblock #: dos2unix.pod:622 msgid "" "There are some issues with displaying Unicode file names in a Windows " "console. See option C<-D>, C<--display-enc>. The file names may be " "displayed wrongly in the console, but the files will be written with the " "correct name." msgstr "" #. type: =head2 #: dos2unix.pod:626 msgid "Unicode examples" msgstr "" #. type: textblock #: dos2unix.pod:628 msgid "Convert from Windows UTF-16 (with BOM) to Unix UTF-8:" msgstr "" #. type: verbatim #: dos2unix.pod:630 #, no-wrap msgid "" " dos2unix -n in.txt out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:632 msgid "Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:" msgstr "" #. type: verbatim #: dos2unix.pod:634 #, no-wrap msgid "" " dos2unix -ul -n in.txt out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:636 msgid "Convert from Unix UTF-8 to Windows UTF-8 with BOM:" msgstr "" #. type: verbatim #: dos2unix.pod:638 #, no-wrap msgid "" " unix2dos -m -n in.txt out.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:640 msgid "Convert from Unix UTF-8 to Windows UTF-16:" msgstr "" #. type: verbatim #: dos2unix.pod:642 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" msgstr "" #. type: =head1 #: dos2unix.pod:644 msgid "GB18030" msgstr "" #. type: textblock #: dos2unix.pod:646 msgid "" "GB18030 is a Chinese government standard. A mandatory subset of the GB18030 " "standard is officially required for all software products sold in China. See " "also L." msgstr "" #. type: textblock #: dos2unix.pod:650 msgid "" "GB18030 is fully compatible with Unicode, and can be considered an unicode " "transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 " "is also compatible with Windows code page 936, also known as GBK." msgstr "" #. type: textblock #: dos2unix.pod:654 msgid "" "On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding " "is set to GB18030. Note that this will only work if the locale is supported " "by the system. Use command C to get the list of supported " "locales." msgstr "" #. type: textblock #: dos2unix.pod:658 msgid "On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030." msgstr "" #. type: textblock #: dos2unix.pod:660 msgid "GB18030 encoded files can have a Byte Order Mark, like Unicode files." msgstr "" #. type: =head1 #: dos2unix.pod:662 msgid "EXAMPLES" msgstr "" #. type: textblock #: dos2unix.pod:664 msgid "Read input from 'stdin' and write output to 'stdout':" msgstr "" #. type: verbatim #: dos2unix.pod:666 #, no-wrap msgid "" " dos2unix < a.txt\n" " cat a.txt | dos2unix\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:669 msgid "Convert and replace a.txt. Convert and replace b.txt:" msgstr "" #. type: verbatim #: dos2unix.pod:671 #, no-wrap msgid "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:674 msgid "Convert and replace a.txt in ascii conversion mode:" msgstr "" #. type: verbatim #: dos2unix.pod:676 #, no-wrap msgid "" " dos2unix a.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:678 msgid "" "Convert and replace a.txt in ascii conversion mode, convert and replace " "b.txt in 7bit conversion mode:" msgstr "" #. type: verbatim #: dos2unix.pod:681 #, no-wrap msgid "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:685 msgid "Convert a.txt from Mac to Unix format:" msgstr "" #. type: verbatim #: dos2unix.pod:687 #, no-wrap msgid "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:690 msgid "Convert a.txt from Unix to Mac format:" msgstr "" #. type: verbatim #: dos2unix.pod:692 #, no-wrap msgid "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:695 msgid "Convert and replace a.txt while keeping original date stamp:" msgstr "" #. type: verbatim #: dos2unix.pod:697 #, no-wrap msgid "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:700 msgid "Convert a.txt and write to e.txt:" msgstr "" #. type: verbatim #: dos2unix.pod:702 #, no-wrap msgid "" " dos2unix -n a.txt e.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:704 msgid "Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:" msgstr "" #. type: verbatim #: dos2unix.pod:706 #, no-wrap msgid "" " dos2unix -k -n a.txt e.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:708 msgid "Convert and replace a.txt, convert b.txt and write to e.txt:" msgstr "" #. type: verbatim #: dos2unix.pod:710 #, no-wrap msgid "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:713 msgid "" "Convert c.txt and write to e.txt, convert and replace a.txt, convert and " "replace b.txt, convert d.txt and write to f.txt:" msgstr "" #. type: verbatim #: dos2unix.pod:716 #, no-wrap msgid "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" msgstr "" #. type: =head1 #: dos2unix.pod:718 msgid "RECURSIVE CONVERSION" msgstr "" #. type: textblock #: dos2unix.pod:720 msgid "" "Use dos2unix in combination with the find(1) and xargs(1) commands to " "recursively convert text files in a directory tree structure. For instance " "to convert all .txt files in the directory tree under the current directory " "type:" msgstr "" #. type: verbatim #: dos2unix.pod:724 #, no-wrap msgid "" " find . -name '*.txt' |xargs dos2unix\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:726 msgid "In a Windows Command Prompt the following command can be used:" msgstr "" #. type: verbatim #: dos2unix.pod:728 #, no-wrap msgid "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:730 msgid "PowerShell users can use the following command in Windows PowerShell:" msgstr "" #. type: verbatim #: dos2unix.pod:732 #, no-wrap msgid "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object " "{dos2unix $_.Fullname}\n" "\n" msgstr "" #. type: =head1 #: dos2unix.pod:735 msgid "LOCALIZATION" msgstr "" #. type: =item #: dos2unix.pod:739 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:741 msgid "" "The primary language is selected with the environment variable LANG. The " "LANG variable consists out of several parts. The first part is in small " "letters the language code. The second is optional and is the country code in " "capital letters, preceded with an underscore. There is also an optional " "third part: character encoding, preceded with a dot. A few examples for " "POSIX standard type shells:" msgstr "" #. type: verbatim #: dos2unix.pod:748 #, no-wrap msgid "" " export LANG=nl Dutch\n" " export LANG=nl_NL Dutch, The Netherlands\n" " export LANG=nl_BE Dutch, Belgium\n" " export LANG=es_ES Spanish, Spain\n" " export LANG=es_MX Spanish, Mexico\n" " export LANG=en_US.iso88591 English, USA, Latin-1 encoding\n" " export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding\n" "\n" msgstr "" #. type: textblock #: dos2unix.pod:756 msgid "" "For a complete list of language and country codes see the gettext manual: " "L" msgstr "" #. type: textblock #: dos2unix.pod:759 msgid "" "On Unix systems you can use the command locale(1) to get locale specific " "information." msgstr "" #. type: =item #: dos2unix.pod:762 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:764 msgid "" "With the LANGUAGE environment variable you can specify a priority list of " "languages, separated by colons. Dos2unix gives preference to LANGUAGE over " "LANG. For instance, first Dutch and then German: C. You " "have to first enable localization, by setting LANG (or LC_ALL) to a value " "other than \"C\", before you can use a language priority list through the " "LANGUAGE variable. See also the gettext manual: " "L" msgstr "" #. type: textblock #: dos2unix.pod:772 msgid "" "If you select a language which is not available you will get the standard " "English messages." msgstr "" #. type: =item #: dos2unix.pod:776 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:778 msgid "" "With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during " "compilation can be overruled. LOCALEDIR is used to find the language " "files. The GNU default value is C. Option " "B<--version> will display the LOCALEDIR that is used." msgstr "" #. type: textblock #: dos2unix.pod:783 msgid "Example (POSIX shell):" msgstr "" #. type: verbatim #: dos2unix.pod:785 #, no-wrap msgid "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" msgstr "" #. type: =head1 #: dos2unix.pod:790 msgid "RETURN VALUE" msgstr "" #. type: textblock #: dos2unix.pod:792 msgid "" "On success, zero is returned. When a system error occurs the last system " "error will be returned. For other errors 1 is returned." msgstr "" #. type: textblock #: dos2unix.pod:795 msgid "" "The return value is always zero in quiet mode, except when wrong " "command-line options are used." msgstr "" #. type: =head1 #: dos2unix.pod:798 msgid "STANDARDS" msgstr "" #. type: textblock #: dos2unix.pod:800 msgid "L" msgstr "" #. type: textblock #: dos2unix.pod:802 msgid "L" msgstr "" #. type: textblock #: dos2unix.pod:804 msgid "L" msgstr "" #. type: textblock #: dos2unix.pod:806 msgid "L" msgstr "" #. type: =head1 #: dos2unix.pod:808 msgid "AUTHORS" msgstr "" #. type: textblock #: dos2unix.pod:810 msgid "" "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix " "mode) - , Christian Wurll (add extra newline) - " ", Erwin Waterlander - (maintainer)" msgstr "" #. type: textblock #: dos2unix.pod:815 msgid "Project page: L" msgstr "" #. type: textblock #: dos2unix.pod:817 msgid "SourceForge page: L" msgstr "" #. type: =head1 #: dos2unix.pod:819 msgid "SEE ALSO" msgstr "" #. type: textblock #: dos2unix.pod:821 msgid "file(1) find(1) iconv(1) locale(1) xargs(1)" msgstr "" dos2unix-7.3.4/po-man/es.po0000644000175500010010000020251212721132543014707 0ustar waterlanGeen# Spanish translation of the dos2unix man page. # Copyright (C) 2014 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # Julio A. Freyre-Gonzalez , 2011, 2012. # Enrique Lazcorreta Puigmartí , 2014, 2015. # msgid "" msgstr "" "Project-Id-Version: dos2unix-man-7.2.1-beta1\n" "POT-Creation-Date: 2016-02-11 20:33+0100\n" "PO-Revision-Date: 2015-03-19 09:38+0100\n" "Last-Translator: Enrique Lazcorreta Puigmartí \n" "Language-Team: Spanish \n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.7.5\n" #. type: =head1 #: dos2unix.pod:52 msgid "NAME" msgstr "NOMBRE" #. type: textblock #: dos2unix.pod:54 msgid "dos2unix - DOS/Mac to Unix and vice versa text file format converter" msgstr "dos2unix - Convertidor de archivos de texto de formato DOS/Mac a Unix y viceversa" #. type: =head1 #: dos2unix.pod:56 msgid "SYNOPSIS" msgstr "SINOPSIS" #. type: verbatim #: dos2unix.pod:58 #, no-wrap msgid "" " dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]\n" " unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]\n" "\n" msgstr "" " dos2unix [parámetros] [ARCHIVO ...] [-n ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...]\n" " unix2dos [parámetros] [ARCHIVO ...] [-n ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...]\n" "\n" #. type: =head1 #: dos2unix.pod:61 msgid "DESCRIPTION" msgstr "DESCRIPCIÓN" #. type: textblock #: dos2unix.pod:63 msgid "The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa." msgstr "El paquete Dos2unix incluye las herramientas C y C para convertir archivos de texto plano en formato DOS o Mac a formato Unix y viceversa." #. type: textblock #: dos2unix.pod:66 msgid "In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks." msgstr "En archivos de texto DOS/Windows, un salto de línea, también conocido como nueva línea, es una combinación de dos caracteres: un retorno de carro (CR) seguido por un salto de línea (LF). En archivos de texto Unix, un salto de línea es solamente un carácter: el salto de línea (LF). En archivos de texto Mac, antes de Mac OS X, un salto de línea era sólo un carácter retorno de carro (CR). Actualmente, Mac OS usa el estilo Unix de saltos de línea (LF)." #. type: textblock #: dos2unix.pod:72 msgid "Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files." msgstr "Además de saltos de línea, Dos2unix puede también convertir la codificación de archivos. Unas cuantas páginas de códigos DOS pueden ser convertidas a Unix Latin-1. Y archivos Unicode de Windows (UTF-16) pueden ser convertidos a archivos Unicode de Unix (UTF-8)." #. type: textblock #: dos2unix.pod:76 msgid "Binary files are automatically skipped, unless conversion is forced." msgstr "Los archivos binarios son ignorados automáticamente, a menos que se fuerce su conversión." #. type: textblock #: dos2unix.pod:78 msgid "Non-regular files, such as directories and FIFOs, are automatically skipped." msgstr "Los archivos no regulares, tales como directorios y FIFO, son ignorados automáticamente." #. type: textblock #: dos2unix.pod:80 msgid "Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows." msgstr "Los enlaces simbólicos y sus destinos no son modificados por defecto. Los enlaces simbólicos pueden opcionalmente ser reemplazados, o la salida puede ser escrita al destino simbólico del enlace. En Windows no está soportada la escritura a enlaces simbólicos." #. type: textblock #: dos2unix.pod:84 #, fuzzy #| msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>." msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion." msgstr "Dos2unix fue modelado después de dos2unix bajo SunOS/Solaris. Hay una importante diferencia respecto a la versión original SunOS/Solaris. Esta versión hace, por defecto, la conversión en el mismo archivo (modo de archivo antiguo), mientras que la versión original de SunOS/Solaris sólo es compatible con la conversión en archivo emparejado (modo de archivo nuevo). Véanse las opciones C<-o> y C<-n>." #. type: =head1 #: dos2unix.pod:92 msgid "OPTIONS" msgstr "PARÁMETROS" #. type: =item #: dos2unix.pod:96 msgid "B<-->" msgstr "B<-->" #. type: textblock #: dos2unix.pod:98 msgid "Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named \"-foo\", you can use this command:" msgstr "Todos los parámetros siguientes son tratados como nombres de archivo. Use este parámetro si desea convertir archivos cuyos nombres inician con un guión. Por ejemplo para convertir un archivoo llamado \"-foo\", use este comando:" #. type: verbatim #: dos2unix.pod:102 #, no-wrap msgid "" " dos2unix -- -foo\n" "\n" msgstr "" " dos2unix -- -foo\n" "\n" #. type: textblock #: dos2unix.pod:104 msgid "Or in new file mode:" msgstr "O en modo de archivo nuevo:" #. type: verbatim #: dos2unix.pod:106 #, no-wrap msgid "" " dos2unix -n -- -foo out.txt\n" "\n" msgstr "" " dos2unix -n -- -foo out.txt\n" "\n" #. type: =item #: dos2unix.pod:108 msgid "B<-ascii>" msgstr "B<-ascii>" #. type: textblock #: dos2unix.pod:110 msgid "Convert only line breaks. This is the default conversion mode." msgstr "Sólo convierte los salto de línea. Éste es el modo de conversión por defecto." #. type: =item #: dos2unix.pod:112 msgid "B<-iso>" msgstr "B<-iso>" #. type: textblock #: dos2unix.pod:114 msgid "Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES." msgstr "Conversión entre el conjunto de caracteres DOS e ISO-8859-1. Véase también la sección MODOS DE CONVERSIÓN." #. type: =item #: dos2unix.pod:117 msgid "B<-1252>" msgstr "B<-1252>" #. type: textblock #: dos2unix.pod:119 msgid "Use Windows code page 1252 (Western European)." msgstr "Usa la página de códigos Windows 1252 (Europa Occidental)." #. type: =item #: dos2unix.pod:121 msgid "B<-437>" msgstr "B<-437>" #. type: textblock #: dos2unix.pod:123 msgid "Use DOS code page 437 (US). This is the default code page used for ISO conversion." msgstr "Usa la página de códigos DOS 437 (EE. UU.). Está es la página de códigos usada por defecto para conversión ISO." #. type: =item #: dos2unix.pod:125 msgid "B<-850>" msgstr "B<-850>" #. type: textblock #: dos2unix.pod:127 msgid "Use DOS code page 850 (Western European)." msgstr "Usa la página de códigos DOS 850 (Europa Occidental)." #. type: =item #: dos2unix.pod:129 msgid "B<-860>" msgstr "B<-860>" #. type: textblock #: dos2unix.pod:131 msgid "Use DOS code page 860 (Portuguese)." msgstr "Usa la página de códigos DOS 860 (Portugués)." #. type: =item #: dos2unix.pod:133 msgid "B<-863>" msgstr "B<-863>" #. type: textblock #: dos2unix.pod:135 msgid "Use DOS code page 863 (French Canadian)." msgstr "Usa la página de códigos DOS 863 (Francocanadiense)." #. type: =item #: dos2unix.pod:137 msgid "B<-865>" msgstr "B<-865>" #. type: textblock #: dos2unix.pod:139 msgid "Use DOS code page 865 (Nordic)." msgstr "Usa la página de códigos DOS 865 (Nórdico)." #. type: =item #: dos2unix.pod:141 msgid "B<-7>" msgstr "B<-7>" #. type: textblock #: dos2unix.pod:143 msgid "Convert 8 bit characters to 7 bit space." msgstr "Convierte caracteres de 8 bits al espacio de 7 bits." #. type: =item #: dos2unix.pod:145 msgid "B<-b, --keep-bom>" msgstr "B<-b, --keep-bom>" #. type: textblock #: dos2unix.pod:147 msgid "Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option C<-r>." msgstr "Mantiene la Marca de Orden de Byte (BOM). Cuando el archivo de entrada tiene BOM, escribe BOM en el archivo de salida. Este es el comportamiento por defecto en la conversión a saltos de línea DOS. Vea también la opción C<-r>." #. type: =item #: dos2unix.pod:151 msgid "B<-c, --convmode CONVMODE>" msgstr "B<-c, --convmode CONVMODE>" #. type: textblock #: dos2unix.pod:153 msgid "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default." msgstr "Establece el modo de conversión, Donde CONVMODE puede ser: I, I<7bit>, I, I siendo ascii el valor por defecto." #. type: =item #: dos2unix.pod:157 msgid "B<-D, --display-enc ENCODING>" msgstr "" #. type: textblock #: dos2unix.pod:159 #, fuzzy #| msgid "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default." msgid "Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default." msgstr "Establece el modo de conversión, Donde CONVMODE puede ser: I, I<7bit>, I, I siendo ascii el valor por defecto." #. type: textblock #: dos2unix.pod:163 msgid "This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed." msgstr "" #. type: textblock #: dos2unix.pod:167 msgid "There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages." msgstr "" #. type: =item #: dos2unix.pod:173 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:175 msgid "Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page." msgstr "" #. type: textblock #: dos2unix.pod:181 msgid "The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK." msgstr "" #. type: =item #: dos2unix.pod:186 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:188 msgid "The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it." msgstr "" #. type: textblock #: dos2unix.pod:194 msgid "When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font." msgstr "" #. type: textblock #: dos2unix.pod:197 msgid "The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program." msgstr "" #. type: textblock #: dos2unix.pod:200 msgid "When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "" #. type: =item #: dos2unix.pod:205 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:207 msgid "The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding." msgstr "" #. type: textblock #: dos2unix.pod:211 msgid "The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed." msgstr "" #. type: textblock #: dos2unix.pod:217 msgid "In a ConEmu console the utf8 encoding method works well." msgstr "" #. type: textblock #: dos2unix.pod:219 msgid "When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "" #. type: textblock #: dos2unix.pod:226 msgid "The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C." msgstr "" #. type: =item #: dos2unix.pod:229 msgid "B<-f, --force>" msgstr "B<-f, --force>" #. type: textblock #: dos2unix.pod:231 msgid "Force conversion of binary files." msgstr "Fuerza la conversión de archivos binarios." #. type: =item #: dos2unix.pod:233 msgid "B<-gb, --gb18030>" msgstr "B<-gb, --gb18030>" #. type: textblock #: dos2unix.pod:235 msgid "On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030." msgstr "En Windows los archivos UTF-16 se convierten por defecto a UTF-8, sin tener en cuenta la configuración local. Use esta opción para convertir archivos UTF-16 a GB18030. Esta opción sólo está disponible en Windows.l Véase también la sección GB18030." #. type: =item #: dos2unix.pod:239 msgid "B<-h, --help>" msgstr "B<-h, --help>" #. type: textblock #: dos2unix.pod:241 msgid "Display help and exit." msgstr "Despiega la ayuda y termina el programa." #. type: =item #: dos2unix.pod:243 msgid "B<-i[FLAGS], --info[=FLAGS] FILE ...>" msgstr "B<-i[MARCAS], --info[= MARCAS] ARCHIVO ...>" #. type: textblock #: dos2unix.pod:245 msgid "Display file information. No conversion is done." msgstr "Muestra la información del archivo. No se realiza ninguna conversión." #. type: textblock #: dos2unix.pod:247 msgid "The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name." msgstr "Se muestra la siguiente información, en este orden: número de saltos de línea DOS, número de saltos de línea Unix, número de saltos de línea Mac, Marca de Orden de Byte, de texto o binario, nombre del archivo." #. type: textblock #: dos2unix.pod:251 msgid "Example output:" msgstr "Ejemplo de salida:" #. type: verbatim #: dos2unix.pod:253 #, no-wrap msgid "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" msgstr "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" #. type: textblock #: dos2unix.pod:262 msgid "Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>." msgstr "" #. type: textblock #: dos2unix.pod:264 msgid "Optionally extra flags can be set to change the output. One or more flags can be added." msgstr "Se pueden utilizar marcas extras opcionales para modificar la salida. Se pueden añadir una o más marcas." #. type: =item #: dos2unix.pod:269 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:271 msgid "Print number of DOS line breaks." msgstr "Muestra el número de saltos de línea DOS." #. type: =item #: dos2unix.pod:273 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:275 msgid "Print number of Unix line breaks." msgstr "Muestra el número de saltos de línea Unix." #. type: =item #: dos2unix.pod:277 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:279 msgid "Print number of Mac line breaks." msgstr "Muestra el número de saltos de línea Mac." #. type: =item #: dos2unix.pod:281 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:283 msgid "Print the byte order mark." msgstr "Muestra la Marca de Orden de Byte." #. type: =item #: dos2unix.pod:285 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:287 msgid "Print if file is text or binary." msgstr "Muestra si el archivo es de texto o binario." #. type: =item #: dos2unix.pod:289 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:291 msgid "Print only the files that would be converted." msgstr "Muestra sólo los archivos que pueden ser convertidos." #. type: textblock #: dos2unix.pod:293 msgid "With the C flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks." msgstr "Con la marca C dos2unix sólo mostrará los archivos que contengan saltos de línea DOS, unix2dos sólo mostrará los nombres de archivo que tengan saltos de línea Unix." #. type: =item #: dos2unix.pod:296 msgid "B" msgstr "" #. type: textblock #: dos2unix.pod:298 msgid "Print a header." msgstr "" #. type: =item #: dos2unix.pod:300 msgid "B

" msgstr "" #. type: textblock #: dos2unix.pod:302 msgid "Show file names without path." msgstr "" #. type: textblock #: dos2unix.pod:306 msgid "Examples:" msgstr "Ejemplos:" #. type: textblock #: dos2unix.pod:308 msgid "Show information for all *.txt files:" msgstr "Muestra información para todos los archivos *.txt:" #. type: verbatim #: dos2unix.pod:310 #, no-wrap msgid "" " dos2unix -i *.txt\n" "\n" msgstr "" " dos2unix -i *.txt\n" "\n" #. type: textblock #: dos2unix.pod:312 msgid "Show only the number of DOS line breaks and Unix line breaks:" msgstr "Muestra sólo el número de saltos de línea de DOS y de Unix:" #. type: verbatim #: dos2unix.pod:314 #, no-wrap msgid "" " dos2unix -idu *.txt\n" "\n" msgstr "" " dos2unix -idu *.txt\n" "\n" #. type: textblock #: dos2unix.pod:316 msgid "Show only the byte order mark:" msgstr "Muestra sólo la Marca de Orden de Byte." #. type: verbatim #: dos2unix.pod:318 #, no-wrap msgid "" " dos2unix --info=b *.txt\n" "\n" msgstr "" " dos2unix --info=b *.txt\n" "\n" #. type: textblock #: dos2unix.pod:320 msgid "List the files that have DOS line breaks:" msgstr "Muestra los archivos que tienen saltos de línea DOS:" #. type: verbatim #: dos2unix.pod:322 #, no-wrap msgid "" " dos2unix -ic *.txt\n" "\n" msgstr "" " dos2unix -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:324 msgid "List the files that have Unix line breaks:" msgstr "Muestra los archivos que tienen saltos de línea Unix:" #. type: verbatim #: dos2unix.pod:326 #, no-wrap msgid "" " unix2dos -ic *.txt\n" "\n" msgstr "" " unix2dos -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:328 msgid "Convert only files that have DOS line breaks and leave the other files untouched:" msgstr "" #. type: verbatim #: dos2unix.pod:330 #, fuzzy, no-wrap #| msgid "" #| " find . -name *.txt |xargs dos2unix\n" #| "\n" msgid "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" msgstr "" " find . -name *.txt |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:332 #, fuzzy #| msgid "List the files that have DOS line breaks:" msgid "Find text files that have DOS line breaks:" msgstr "Muestra los archivos que tienen saltos de línea DOS:" #. type: verbatim #: dos2unix.pod:334 #, fuzzy, no-wrap #| msgid "" #| " find . -name *.txt |xargs dos2unix\n" #| "\n" msgid "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" msgstr "" " find . -name *.txt |xargs dos2unix\n" "\n" #. type: =item #: dos2unix.pod:336 msgid "B<-k, --keepdate>" msgstr "B<-k, --keepdate>" #. type: textblock #: dos2unix.pod:338 msgid "Keep the date stamp of output file same as input file." msgstr "Mantiene la fecha del archivo de salida igual a la del archivo de entrada." #. type: =item #: dos2unix.pod:340 msgid "B<-L, --license>" msgstr "B<-L, --license>" #. type: textblock #: dos2unix.pod:342 msgid "Display program's license." msgstr "Muestra la licencia del programa." #. type: =item #: dos2unix.pod:344 msgid "B<-l, --newline>" msgstr "B<-l, --newline>" #. type: textblock #: dos2unix.pod:346 msgid "Add additional newline." msgstr "Añade salto de línea adicional." #. type: textblock #: dos2unix.pod:348 msgid "B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks." msgstr "B: Sólo los saltos de línea DOS son cambiados por dos saltos de línea Unix. En modo Mac sólo los saltos de línea Mac son cambiados por dos saltos de línea Unix." #. type: textblock #: dos2unix.pod:352 msgid "B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks." msgstr "B: Sólo los saltos de línea Unix son cambiados por dos saltos de línea DOS. En modo Mac los saltos de línea Unix son cambiados por dos saltos de línea Mac." #. type: =item #: dos2unix.pod:355 msgid "B<-m, --add-bom>" msgstr "B<-m, --add-bom>" #. type: textblock #: dos2unix.pod:357 msgid "Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written." msgstr "Escribe una Marca de Orden de Bytes (BOM) en el archivo de salida. Por defecto se escribe una BOM UTF-8." #. type: textblock #: dos2unix.pod:360 msgid "When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM will be written." msgstr "Cuando el archivo de entrada es UTF-16 y se usa la opción C<-u>, se escribirá un BOM UTF-16." #. type: textblock #: dos2unix.pod:363 msgid "Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE." msgstr "No utilice esta opción cuando la codificación de salida sea distinta de UTF-8, UTF-16 o GB18030. Véase también la sección UNICODE." #. type: =item #: dos2unix.pod:367 msgid "B<-n, --newfile INFILE OUTFILE ...>" msgstr "B<-n, --newfile ARCHIVO_DE_ENTRADA ARCHIVO_DE_SALIDA ...>" #. type: textblock #: dos2unix.pod:369 msgid "New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files." msgstr "Modo de archivo nuevo. Convierte el archivo ARCHIVO_DE_ENTRADA y escribe la salida al archivo ARCHIVO_DE_SALIDA. Los nombres de archivo deben ser dados en pares y los comodines I deben ser usados o I sus archivos." #. type: textblock #: dos2unix.pod:373 msgid "The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion." msgstr "La persona que inicia la conversión en el modo de archivo nuevo (emparejado) será el propietario del archivo convertido. Los permisos de lectura/escritura del archivo nuevo serán los permisos del archivo original menos la umask(1) de la persona que ejecute la conversión." #. type: =item #: dos2unix.pod:378 msgid "B<-o, --oldfile FILE ...>" msgstr "B<-o, --oldfile ARCHIVO ...>" #. type: textblock #: dos2unix.pod:380 msgid "Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used." msgstr "Modo de archivo antiguo. Convierte el archivo ARCHIVO y lo sobrescribe con la salida. El programa por defecto se ejecuta en este modo. Se pueden emplear comodines." #. type: textblock #: dos2unix.pod:383 msgid "In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix." msgstr "En modo de archivo antiguo (in situ), el archivo convertido tiene el mismo propietario, grupo y permisos de lectura/escritura que el archivo original. Lo mismo aplica cuando el archivo es convertido por otro usuario que tiene permiso de lectura en el archivo (p.e. usuario root). La conversión será abortada cuando no sea posible preservar los valores originales. Cambiar el propietario implicaría que el propietario original ya no podrá leer el archivo. Cambiar el grupo podría ser un riesgo de seguridad, ya que el archivo podría ser accesible a personas inadecuadas. La preservación del propietario, grupo, y permisos de lectura/escritura sólo está soportada bajo Unix." #. type: =item #: dos2unix.pod:392 msgid "B<-q, --quiet>" msgstr "B<-q, --quiet>" #. type: textblock #: dos2unix.pod:394 msgid "Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used." msgstr "Modo silencioso. Suprime todas las advertencias y mensajes. El valor retornado es cero. Excepto cuando se emplean parámetros incorrectos." #. type: =item #: dos2unix.pod:397 msgid "B<-r, --remove-bom>" msgstr "B<-r, --remove-bom>" #. type: textblock #: dos2unix.pod:399 msgid "Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option C<-b>." msgstr "Elimina la Marca de Orden de Byte (BOM). No escribe el BOM en el archivo de salida. Este es el comportamiento por defecto al convertir a saltos de línea Unix. Vea también la opción C<-b>." #. type: =item #: dos2unix.pod:403 msgid "B<-s, --safe>" msgstr "B<-s, --safe>" #. type: textblock #: dos2unix.pod:405 msgid "Skip binary files (default)." msgstr "Ignora los archivos binarios (por defecto)." #. type: textblock #: dos2unix.pod:407 msgid "The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file." msgstr "" #. type: =item #: dos2unix.pod:413 msgid "B<-u, --keep-utf16>" msgstr "B<-u, --keep-utf16>" #. type: textblock #: dos2unix.pod:415 msgid "Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the C<-ascii> option." msgstr "Mantiene la codificación original UTF-16 en el archivo de entrada. El archivo de salida se escribirá con la misma codificación UTF-16, little o big endian, como el archivo de entrada. Esto impide la transformación a UTF-8. En consecuencia se escribirá un BOM UTF-16. Esta opción se puede desactivar con la opción C<-ascii>." #. type: =item #: dos2unix.pod:420 msgid "B<-ul, --assume-utf16le>" msgstr "B<-ul, --assume-utf16le>" #. type: textblock #: dos2unix.pod:422 msgid "Assume that the input file format is UTF-16LE." msgstr "Se asume que el formato de archivo de entrada es UTF-16LE." #. type: textblock #: dos2unix.pod:424 msgid "When there is a Byte Order Mark in the input file the BOM has priority over this option." msgstr "Cuando existe una Marca de Orden de Bytes (BOM) en el archivo de entrada, la BOM tiene prioridad sobre esta opción." #. type: textblock #: dos2unix.pod:427 msgid "When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file." msgstr "Cuando se hace una suposición incorrecta (el archivo de entrada no estaba en formato UTF-16LE) y la conversión tiene éxito, obtendrá un archivo UTF-8 de salida con el texto erróneo. La conversión errónea puede deshacerse con iconv(1) convirtiendo el archivo UTF-8 de salida de vuelta a UTF-16LE. Esto restaurará el archivo original." #. type: textblock #: dos2unix.pod:432 msgid "The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off." msgstr "El supuesto de UTF-16LE funciona como un I. Al cambiar al modo por defecto I el supuesto UTF-16LE es deshabilitado." #. type: =item #: dos2unix.pod:435 msgid "B<-ub, --assume-utf16be>" msgstr "B<-ub, --assume-utf16be>" #. type: textblock #: dos2unix.pod:437 msgid "Assume that the input file format is UTF-16BE." msgstr "Se asume que el formato del archivo de entrada es UTF-16BE." #. type: textblock #: dos2unix.pod:439 msgid "This option works the same as option C<-ul>." msgstr "Esta opción funciona igual que la opción C<-ul>." #. type: =item #: dos2unix.pod:441 msgid "B<-v, --verbose>" msgstr "B<-v, --verbose>" #. type: textblock #: dos2unix.pod:443 msgid "Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks." msgstr "Mostrar mensajes detallados. Se muestra información extra acerca de Marcas de Orden de Bytes (BOM) y el número de saltos de línea convertidos." #. type: =item #: dos2unix.pod:446 msgid "B<-F, --follow-symlink>" msgstr "B<-F, --follow-symlink>" #. type: textblock #: dos2unix.pod:448 msgid "Follow symbolic links and convert the targets." msgstr "Sigue los enlaces simbólicos y convierte los destinos." #. type: =item #: dos2unix.pod:450 msgid "B<-R, --replace-symlink>" msgstr "B<-R, --replace-symlink>" #. type: textblock #: dos2unix.pod:452 msgid "Replace symbolic links with converted files (original target files remain unchanged)." msgstr "Reemplaza los enlaces simbólicos con los archivos convertidos (los archivos destino originales no se alteran)." #. type: =item #: dos2unix.pod:455 msgid "B<-S, --skip-symlink>" msgstr "B<-S, --skip-symlink>" #. type: textblock #: dos2unix.pod:457 msgid "Keep symbolic links and targets unchanged (default)." msgstr "No altera los enlaces simbólicos ni sus destinos (por defecto)." #. type: =item #: dos2unix.pod:459 msgid "B<-V, --version>" msgstr "B<-V, --version>" #. type: textblock #: dos2unix.pod:461 msgid "Display version information and exit." msgstr "Despiega la información de la versión y termina el programa." #. type: =head1 #: dos2unix.pod:465 msgid "MAC MODE" msgstr "MODO MAC" #. type: textblock #: dos2unix.pod:467 msgid "In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted." msgstr "En modo normal los saltos de línea son convertidos de DOS a Unix y viceversa. Los saltos de línea Mac no son convertidos." #. type: textblock #: dos2unix.pod:470 msgid "In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed." msgstr "En modo Mac los saltos de línea son convertidos de Mac a Unix y viceversa. Los saltos de línea DOS no son modificados." #. type: textblock #: dos2unix.pod:473 msgid "To run in Mac mode use the command-line option C<-c mac> or use the commands C or C." msgstr "Para ejecutar en modo Mac use el modificador C<-c mac> o use los comandos C o C." #. type: =head1 #: dos2unix.pod:476 msgid "CONVERSION MODES" msgstr "MODOS DE CONVERSIÓN" #. type: =item #: dos2unix.pod:480 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:482 msgid "In mode C only line breaks are converted. This is the default conversion mode." msgstr "En modo C sólo los saltos de línea son convertidos. Éste es el modo de conversión por defecto." #. type: textblock #: dos2unix.pod:485 msgid "Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files." msgstr "Aunque el nombre de este modo es ASCII, que es un estándar de 7 bits, éste emplea 8 bits. Siempre use este modo cuando convierta archivos Unicode UTF-8." #. type: =item #: dos2unix.pod:489 msgid "B<7bit>" msgstr "B<7bit>" #. type: textblock #: dos2unix.pod:491 msgid "In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space." msgstr "En este modo todos los caracteres no ASCII de 8 bits (con valores de 128 a 255) son convertidos al espacio de 7 bits." #. type: =item #: dos2unix.pod:494 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:496 msgid "Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart." msgstr "Los caracteres son convertidos entre un conjunto de caracteres DOS (página de códigos) y el conjunto de caracteres ISO-8859-1 (Latín-1) de Unix. Los caracteres DOS sin equivalente ISO-8859-1, para los cuales la conversión es imposible, son convertidos en un punto. Lo mismo se aplica para caracteres ISO-8859-1 sin contraparte DOS." #. type: textblock #: dos2unix.pod:501 msgid "When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings." msgstr "Cuando sólo se emplea el parámetro C<-iso>, dos2unix intentará determinar la página de códigos activa. Cuando esto no sea posible, dos2unix utilizará la página de códigos 437 por defecto, la cual es empleada principalmente en EE. UU. Para forzar una página de códigos específica emplee los parámetros C<-437> (EE. UU.), C<-850> (Europa Occidental), C<-860> (Portugués), C<-863> (Francocanadiense), o C<-865> (Nórdico). La página de códigos Windows 1252 (Europa Occidental) también está soportada con el parámetro C<-1252>. Para acceder a otras páginas de códigos use dos2unix en combinación con iconv(1). Iconv puede convertir entre una larga lista de codificaciones de caracteres." #. type: textblock #: dos2unix.pod:510 msgid "Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files." msgstr "No use la conversión ISO en archivos de texto Unicode. Esto corrompería los archivos codificados como UTF-8." #. type: textblock #: dos2unix.pod:512 msgid "Some examples:" msgstr "Algunos ejemplos:" #. type: textblock #: dos2unix.pod:514 msgid "Convert from DOS default code page to Unix Latin-1:" msgstr "Convierte de la página de códigos por defecto de DOS a Latín-1 de Unix:" #. type: verbatim #: dos2unix.pod:516 #, no-wrap msgid "" " dos2unix -iso -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -iso -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:518 msgid "Convert from DOS CP850 to Unix Latin-1:" msgstr "Convierte de DOS CP850 a Unix Latín-1:" #. type: verbatim #: dos2unix.pod:520 #, no-wrap msgid "" " dos2unix -850 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -850 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:522 msgid "Convert from Windows CP1252 to Unix Latin-1:" msgstr "Convierte de Windows CP1252 a Unix Latin-1:" #. type: verbatim #: dos2unix.pod:524 #, no-wrap msgid "" " dos2unix -1252 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -1252 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:526 msgid "Convert from Windows CP1252 to Unix UTF-8 (Unicode):" msgstr "Convierte de Windows CP1252 a Unix UTF-8 (Unicode)." #. type: verbatim #: dos2unix.pod:528 #, no-wrap msgid "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" msgstr "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" #. type: textblock #: dos2unix.pod:530 msgid "Convert from Unix Latin-1 to DOS default code page:" msgstr "Convierte de Unix Latin-1 a la página de códigos por defecto de DOS:" #. type: verbatim #: dos2unix.pod:532 #, no-wrap msgid "" " unix2dos -iso -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -iso -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:534 msgid "Convert from Unix Latin-1 to DOS CP850:" msgstr "Convierte de Unix Latin-1 a DOS CP850:" #. type: verbatim #: dos2unix.pod:536 #, no-wrap msgid "" " unix2dos -850 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -850 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:538 msgid "Convert from Unix Latin-1 to Windows CP1252:" msgstr "Convierte de Unix Latin-1 a Windows CP1252." #. type: verbatim #: dos2unix.pod:540 #, no-wrap msgid "" " unix2dos -1252 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -1252 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:542 msgid "Convert from Unix UTF-8 (Unicode) to Windows CP1252:" msgstr "Convierte de Unix UTF-8 (Unicode) a Windows CP1252:" #. type: verbatim #: dos2unix.pod:544 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" #. type: textblock #: dos2unix.pod:546 msgid "See also L and L." msgstr "Véase también L y L." #. type: =head1 #: dos2unix.pod:551 msgid "UNICODE" msgstr "UNICODE" #. type: =head2 #: dos2unix.pod:553 msgid "Encodings" msgstr "Codificaciones" #. type: textblock #: dos2unix.pod:555 msgid "There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format." msgstr "Existen diferentes codificaciones Unicode. En Unix y Linux los archivos Unicode son codificados comúnmente en UTF-8. En Windows los archivos de texto Unicode pueden estar codificados en UTF-8, UTF-16, o UTF-16 big endian, pero en general son codificados en formato UTF-16." #. type: =head2 #: dos2unix.pod:560 msgid "Conversion" msgstr "Conversion" #. type: textblock #: dos2unix.pod:562 msgid "Unicode text files can have DOS, Unix or Mac line breaks, like regular text files." msgstr "Los archivos de texto Unicode pueden tener saltos de línea DOS, Unix o Mac, como cualquier archivo de texto." #. type: textblock #: dos2unix.pod:565 msgid "All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII." msgstr "Todas las versiones de dos2unix y unix2dos pueden convertir archivos codificados como UTF-8, debido a que UTF-8 fue diseñado para retro-compatibilidad con ASCII." #. type: textblock #: dos2unix.pod:568 msgid "Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C." msgstr "Dos2unix y unix2dos con soporte Unicode UTF-16, pueden leer archivos de texto codificados como UTF-16 little y big endian. Para ver si dos2unix fue compilado con soporte UTF-16 escriba C." #. type: textblock #: dos2unix.pod:572 msgid "On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped." msgstr "En Unix/Linux los archivos codificados con UTF-16 se convierten a la codificación de caracteres local. Use el comando locale(1) para averiguar la codificación de caracteres local. Cuando no se puede hacer la conversión se obtendrá un error de conversión y se omitirá el archivo." #. type: textblock #: dos2unix.pod:577 msgid "On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux." msgstr "En Windows los archivos UTF-16 se convierten por defecto a UTF-8. Los archivos de texto forrajeados con UTF-8 están soportados tanto en Windows como en Unix/Linux." #. type: textblock #: dos2unix.pod:580 msgid "UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." msgstr "Las codificaciones UTF-16 y UTF-8 son totalmente compatibles, no se perderá ningún texto en la conversión. Cuando ocurre un error de conversión de UTF-16 a UTF-8, por ejemplo cuando el archivo de entrada UTF-16 contiene un error, se omitirá el archivo." #. type: textblock #: dos2unix.pod:584 msgid "When option C<-u> is used, the output file will be written in the same UTF-16 encoding as the input file. Option C<-u> prevents conversion to UTF-8." msgstr "Cuando se usa la opción C<-u>, el archivo de salida se escribirá en la misma codificación UTF-16 que el archivo de entrada. La opción C<-u> previene la conversión a UTF-8." #. type: textblock #: dos2unix.pod:587 msgid "Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16." msgstr "Dos2unix y unix2dos no tienen la opción de convertir archivos UTF-8 a UTF-16." #. type: textblock #: dos2unix.pod:589 msgid "ISO and 7-bit mode conversion do not work on UTF-16 files." msgstr "La conversión en modos ISO y 7-bit no funciona en archivos UTF-16." #. type: =head2 #: dos2unix.pod:591 msgid "Byte Order Mark" msgstr "Marca de orden de bytes" #. type: textblock #: dos2unix.pod:593 msgid "On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L." msgstr "En Windows los archivos de texto Unicode típicamente tienen una Marca de Orden de Bytes (BOM), debido a que muchos programas de Windows (incluyendo el Bloc de Notas) añaden una BOM por defecto. Véase también L." #. type: textblock #: dos2unix.pod:597 msgid "On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding." msgstr "En Unix los archivos Unicode no suelen tener BOM. Se supone que los archivos de texto son codificados en la codificación local de caracteres." #. type: textblock #: dos2unix.pod:600 msgid "Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file." msgstr "Dos2unix sólo puede detectar si un archivo está en formato UTF-16 si el archivo tiene una BOM. Cuando un archivo UTF-16 no tiene una BOM, dos2unix tratará el archivo como un archivo binario." #. type: textblock #: dos2unix.pod:604 msgid "Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM." msgstr "Use la opción C<-ul> o C<-ub> para convertir un archivo UTF-16 sin BOM." #. type: textblock #: dos2unix.pod:606 msgid "Dos2unix writes by default no BOM in the output file. With option C<-b> Dos2unix writes a BOM when the input file has a BOM." msgstr "Dos2Unix, por defecto, no escribe BOM en el archivo de salida. Con la opción C<-b> Dos2unix escribe el BOM cuando el archivo de entrada tiene BOM." #. type: textblock #: dos2unix.pod:609 msgid "Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option C<-r> to remove the BOM." msgstr "Unix2dos escribe BOM en el archivo de salida cuando el archivo de entrada tiene BOM. Use la opción C<-r> para eliminar la BOM." #. type: textblock #: dos2unix.pod:612 msgid "Dos2unix and unix2dos write always a BOM when option C<-m> is used." msgstr "Dos2unix y unix2dos escriben siempre BOM cuando se usa la opción C<-m>." #. type: =head2 #: dos2unix.pod:614 msgid "Unicode file names on Windows" msgstr "" #. type: textblock #: dos2unix.pod:616 msgid "Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C." msgstr "" #. type: textblock #: dos2unix.pod:622 msgid "There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name." msgstr "" #. type: =head2 #: dos2unix.pod:626 msgid "Unicode examples" msgstr "Ejemplos Unicode" #. type: textblock #: dos2unix.pod:628 msgid "Convert from Windows UTF-16 (with BOM) to Unix UTF-8:" msgstr "Convertir de Windows UTF-16 (con una BOM) a Unix UTF-8:" #. type: verbatim #: dos2unix.pod:630 #, no-wrap msgid "" " dos2unix -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:632 msgid "Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:" msgstr "Convertir de Windows UTF-16LE (sin una BOM) a Unix UTF-8:" #. type: verbatim #: dos2unix.pod:634 #, no-wrap msgid "" " dos2unix -ul -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -ul -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:636 msgid "Convert from Unix UTF-8 to Windows UTF-8 with BOM:" msgstr "Convertir de Unix UTF-8 a Windows UTF-8 sin una BOM:" #. type: verbatim #: dos2unix.pod:638 #, no-wrap msgid "" " unix2dos -m -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -m -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:640 msgid "Convert from Unix UTF-8 to Windows UTF-16:" msgstr "Convertir de Unix UTF-8 a Windows UTF-16:" #. type: verbatim #: dos2unix.pod:642 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" #. type: =head1 #: dos2unix.pod:644 msgid "GB18030" msgstr "GB18030" #. type: textblock #: dos2unix.pod:646 msgid "GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also L." msgstr "GB18030 es un estándar del gobierno chino. Todo producto software vendido en China está obligado por ley a contener un subconjunto del GB18030 estándar. Véase L." #. type: textblock #: dos2unix.pod:650 msgid "GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK." msgstr "GB18030 es totalmente compatible con Unicode y puede considerarse como formato de transformación Unicode. Como ocurre con UTF-8, GB18030 es compatible con ASCII. GB18030 también es compatible con la página de códigos de Windows 936, también conocida como GBK." #. type: textblock #: dos2unix.pod:654 msgid "On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command C to get the list of supported locales." msgstr "En Unix/Linux los archivos UTF-16 se convierten a GB18030 cuando la codificación local se establece en GB18030. Tenga en cuenta que esto sólo funcionará si la configuración local es soportada por el sistema. Utilice C para obtener el listado de configuraciones regionales admitidas." #. type: textblock #: dos2unix.pod:658 msgid "On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030." msgstr "Use la opción C<-ul> o C<-ub> para convertir un archivo UTF-16 sin BOM." #. type: textblock #: dos2unix.pod:660 msgid "GB18030 encoded files can have a Byte Order Mark, like Unicode files." msgstr "Los archivos codificados como GB18030 pueden tener una Marca de Orden de Bytes, como ocurre con los archivos Unicode." #. type: =head1 #: dos2unix.pod:662 msgid "EXAMPLES" msgstr "EJEMPLOS" #. type: textblock #: dos2unix.pod:664 msgid "Read input from 'stdin' and write output to 'stdout':" msgstr "Lee la entrada desde 'stdin' y escribe la salida a 'stdout':" #. type: verbatim #: dos2unix.pod:666 #, fuzzy, no-wrap #| msgid "" #| " find . -name *.txt |xargs dos2unix\n" #| "\n" msgid "" " dos2unix < a.txt\n" " cat a.txt | dos2unix\n" "\n" msgstr "" " find . -name *.txt |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:669 msgid "Convert and replace a.txt. Convert and replace b.txt:" msgstr "Convierte y reemplaza a.txt. Convierte y reemplaza b.txt:" #. type: verbatim #: dos2unix.pod:671 #, no-wrap msgid "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" msgstr "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" #. type: textblock #: dos2unix.pod:674 msgid "Convert and replace a.txt in ascii conversion mode:" msgstr "Convierte y reemplaza a.txt empleando modo de conversión ascii:" #. type: verbatim #: dos2unix.pod:676 #, no-wrap msgid "" " dos2unix a.txt\n" "\n" msgstr "" " dos2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:678 msgid "Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode:" msgstr "Convierte y reemplaza a.txt empleando modo de conversión ascii, convierte y reemplaza b.txt empleando modo de conversión de 7bits:" #. type: verbatim #: dos2unix.pod:681 #, no-wrap msgid "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" msgstr "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" #. type: textblock #: dos2unix.pod:685 msgid "Convert a.txt from Mac to Unix format:" msgstr "Convierte a.txt del formato de Mac a Unix:" #. type: verbatim #: dos2unix.pod:687 #, no-wrap msgid "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" msgstr "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:690 msgid "Convert a.txt from Unix to Mac format:" msgstr "Convierte a.txt del formato de Unix a Mac:" #. type: verbatim #: dos2unix.pod:692 #, no-wrap msgid "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" msgstr "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" #. type: textblock #: dos2unix.pod:695 msgid "Convert and replace a.txt while keeping original date stamp:" msgstr "Convierte y reemplaza a.txt manteniendo la fecha del archivo original:" #. type: verbatim #: dos2unix.pod:697 #, no-wrap msgid "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" msgstr "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" #. type: textblock #: dos2unix.pod:700 msgid "Convert a.txt and write to e.txt:" msgstr "Convierte a.txt y escribe la salida en e.txt:" #. type: verbatim #: dos2unix.pod:702 #, no-wrap msgid "" " dos2unix -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:704 msgid "Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:" msgstr "Convierte a.txt y escribe la salida en e.txt, manteniendo la fecha de e.txt igual a la de a.txt:" #. type: verbatim #: dos2unix.pod:706 #, no-wrap msgid "" " dos2unix -k -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -k -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:708 msgid "Convert and replace a.txt, convert b.txt and write to e.txt:" msgstr "Convierte y reemplaza a.txt, convierte b.txt y escribe en e.txt:" #. type: verbatim #: dos2unix.pod:710 #, no-wrap msgid "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" msgstr "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:713 msgid "Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt:" msgstr "Convierte c.txt y escribe en e.txt, convierte y reemplaza a.txt, convierte y reemplaza b.txt, convierte d.txt y escribe en f.txt:" #. type: verbatim #: dos2unix.pod:716 #, no-wrap msgid "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" msgstr "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" #. type: =head1 #: dos2unix.pod:718 msgid "RECURSIVE CONVERSION" msgstr "CONVERSIÓN RECURSIVA" #. type: textblock #: dos2unix.pod:720 msgid "Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type:" msgstr "Use dos2unix en combinación con los comandos find(1) y xargs(1) para convertir recursivamente archivos de texto contenidos en un árbol de directorios. Por ejemplo para convertir todos los archivos .txt en el árbol de directorios debajo del directorio actual escriba:" #. type: verbatim #: dos2unix.pod:724 #, fuzzy, no-wrap #| msgid "" #| " find . -name *.txt |xargs dos2unix\n" #| "\n" msgid "" " find . -name '*.txt' |xargs dos2unix\n" "\n" msgstr "" " find . -name *.txt |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:726 msgid "In a Windows Command Prompt the following command can be used:" msgstr "" #. type: verbatim #: dos2unix.pod:728 #, fuzzy, no-wrap #| msgid "" #| " find . -name *.txt |xargs dos2unix\n" #| "\n" msgid "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" msgstr "" " find . -name *.txt |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:730 msgid "PowerShell users can use the following command in Windows PowerShell:" msgstr "" #. type: verbatim #: dos2unix.pod:732 #, no-wrap msgid "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" msgstr "" #. type: =head1 #: dos2unix.pod:735 msgid "LOCALIZATION" msgstr "INTERNACIONALIZACIÓN" #. type: =item #: dos2unix.pod:739 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:741 msgid "The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:" msgstr "El idioma principal se selecciona con la variable de entorno LANG. La variable LANG consiste de varias partes. La primer parte es el código del idioma en minúsculas. La segunda es opcional y es el código del país en mayúsculas, precedido por un guión bajo. Existe también una tercera parte opcional: la codificación de caracteres, precedida por un punto. Unos cuantos ejemplos para intérpretes de comandos tipo POSIX estándar:" #. type: verbatim #: dos2unix.pod:748 #, no-wrap msgid "" " export LANG=nl Dutch\n" " export LANG=nl_NL Dutch, The Netherlands\n" " export LANG=nl_BE Dutch, Belgium\n" " export LANG=es_ES Spanish, Spain\n" " export LANG=es_MX Spanish, Mexico\n" " export LANG=en_US.iso88591 English, USA, Latin-1 encoding\n" " export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding\n" "\n" msgstr "" " export LANG=nl Neerlandés\n" " export LANG=nl_NL Neerlandés, Países Bajos\n" " export LANG=nl_BE Neerlandés, Bélgica\n" " export LANG=es_ES Español, España\n" " export LANG=es_MX Español, México\n" " export LANG=en_US.iso88591 Ingles, EE. UU., codificación Latín-1\n" " export LANG=en_GB.UTF-8 Ingles, Reino Unido, codificación UTF-8\n" "\n" #. type: textblock #: dos2unix.pod:756 msgid "For a complete list of language and country codes see the gettext manual: L" msgstr "Para obtener una lista completa de códigos de idioma y país véase el manual de gettext: L" #. type: textblock #: dos2unix.pod:759 msgid "On Unix systems you can use the command locale(1) to get locale specific information." msgstr "En sistemas Unix puede emplear el comando locale(1) para obtener información específica de locale." #. type: =item #: dos2unix.pod:762 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:764 msgid "With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than \"C\", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L" msgstr "Con la variable de entorno LANGUAGE puede especificar una lista de prioridad de los idiomas, separados por dos puntos. Dos2unix da preferencia a LANGUAGE sobre LANG. Por ejemplo, primero neerlandés y entonces alemán: C. Para usar una lista de prioridad de idiomas a través de la variable LANGUAGE tiene que habilitar antes la internacionalización, asignando un valor distinto de \"C\" a LANG (o LC_ALL). Véase también el manual de gettext: L" #. type: textblock #: dos2unix.pod:772 msgid "If you select a language which is not available you will get the standard English messages." msgstr "Si selecciona un idioma que no está disponible el programa funcionará en ingles." #. type: =item #: dos2unix.pod:776 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:778 msgid "With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used." msgstr "Con la variable de entorno DOS2UNIX_LOCALEDIR el LOCALEDIR asignado durante la compilación puede ser modificado. LOCALEDIR es usado para encontrar los archivos de idioma. El valor por defecto de GNU es C. El parámetro B<--version> mostrará el LOCALEDIR en uso." #. type: textblock #: dos2unix.pod:783 msgid "Example (POSIX shell):" msgstr "Ejemplo (intérprete de comandos POSIX):" #. type: verbatim #: dos2unix.pod:785 #, no-wrap msgid "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" msgstr "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" #. type: =head1 #: dos2unix.pod:790 msgid "RETURN VALUE" msgstr "VALOR DE RETORNO" #. type: textblock #: dos2unix.pod:792 msgid "On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned." msgstr "Se regresa cero cuando el programa termina exitosamente. Cuando ocurre un error del sistema se regresará el último número de error del sistema. Para otros errores se regresa 1." #. type: textblock #: dos2unix.pod:795 msgid "The return value is always zero in quiet mode, except when wrong command-line options are used." msgstr "El valor de retorno es siempre cero en modo silencioso, excepto cuando se emplean parámetros incorrectos." #. type: =head1 #: dos2unix.pod:798 msgid "STANDARDS" msgstr "ESTÁNDARES" #. type: textblock #: dos2unix.pod:800 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:802 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:804 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:806 msgid "L" msgstr "L" #. type: =head1 #: dos2unix.pod:808 msgid "AUTHORS" msgstr "AUTORES" #. type: textblock #: dos2unix.pod:810 msgid "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer)" msgstr "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer)" #. type: textblock #: dos2unix.pod:815 msgid "Project page: L" msgstr "Página del proyecto: L" #. type: textblock #: dos2unix.pod:817 msgid "SourceForge page: L" msgstr "Página de SourceForge: L" #. type: =head1 #: dos2unix.pod:819 msgid "SEE ALSO" msgstr "VÉASE TAMBIÉN" #. type: textblock #: dos2unix.pod:821 msgid "file(1) find(1) iconv(1) locale(1) xargs(1)" msgstr "file(1) find(1) iconv(1) locale(1) xargs(1)" #~ msgid "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgstr "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgid "The Windows versions of dos2unix and unix2dos convert UTF-16 encoded files always to UTF-8 encoded files. Unix versions of dos2unix/unix2dos convert UTF-16 encoded files to the locale character encoding when it is set to UTF-8. Use the locale(1) command to find out what the locale character encoding is." #~ msgstr "Las versiones Windows de dos2unix y unix2dos siempre convierten ficheros Codificados como UTF-16 a UTF-8. Las versiones Unix de dos2unix/unix2dos convierten ficheros UTF-16 a la codificación de caracteres local cuando es configurado a UTF-8. Emplee el comando locale(1) para determinar cual es la codificación de caracteres local." #~ msgid "Because UTF-8 formatted text files are well supported on both Windows and Unix, dos2unix and unix2dos have no option to write UTF-16 files. All UTF-16 characters can be encoded in UTF-8. Conversion from UTF-16 to UTF-8 is without loss. UTF-16 files will be skipped on Unix when the locale character encoding is not UTF-8, to prevent accidental loss of text. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." #~ msgstr "Dado que los ficheros de texto formateados UTF-8 son bien soportados tanto en Windows como en Unix, dos2unix y unix2dos no tienen opción para escribir ficheros UTF-16. Todos los caracteres UTF-16 pueden ser codificados en UTF-8. La conversión de UTF-16 a UTF-8 ocurre sin pérdida. Los ficheros UTF-16 serán ignorados en Unix cuando la codificación de caracteres local no sea UTF-8, para evitar la pérdida accidental de texto. Cuando ocurre un error de conversión de UTF-16 a UTF-8, por ejemplo cuando el fichero de entrada UTF-16 contiene un error, el fichero será ignorado." #~ msgid "Freecode: L" #~ msgstr "Freecode: L" #~ msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris and has similar conversion modes." #~ msgstr "Dos2unix fue moldeado a partir del dos2unix que existe en SunOS/Solaris y tiene modos de conversión similares." #~ msgid "Conversion modes I, I<7bit>, and I are similar to those of dos2unix/unix2dos under SunOS/Solaris." #~ msgstr "Los modos de conversión I, I<7bit>, e I son similares a los de los comandos dos2unix/unix2dos de SunOS/Solaris." #~ msgid "Dos2unix never writes a BOM in the output file, unless you use option C<-m>." #~ msgstr "Dos2unix nunca escribe una BOM en el fichero de salida, a menos que emplee la opción C<-m>." dos2unix-7.3.4/po-man/fr.po0000644000175500010010000021402212721132543014706 0ustar waterlanGeen# Messages français pour dos2unix-man. # Copyright (C) 2016 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # Frédéric Marchal , 2016. msgid "" msgstr "" "Project-Id-Version: dos2unix-man-7.3.3-beta9\n" "POT-Creation-Date: 2016-02-11 20:33+0100\n" "PO-Revision-Date: 2016-02-06 17:11+0100\n" "Last-Translator: Frédéric Marchal \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. type: =head1 #: dos2unix.pod:52 msgid "NAME" msgstr "NOM" #. type: textblock #: dos2unix.pod:54 msgid "dos2unix - DOS/Mac to Unix and vice versa text file format converter" msgstr "dos2unix - Convertit les fichiers textes du format DOS/Mac vers Unix et inversement" #. type: =head1 #: dos2unix.pod:56 msgid "SYNOPSIS" msgstr "SYNOPSIS" #. type: verbatim #: dos2unix.pod:58 #, no-wrap msgid "" " dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]\n" " unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]\n" "\n" msgstr "" " dos2unix [options] [FICHIER …] [-n FICHIER_ENTRÉE FICHIER_SORTIE …]\n" " unix2dos [options] [FICHIER …] [-n FICHIER_ENTRÉE FICHIER_SORTIE …]\n" "\n" #. type: =head1 #: dos2unix.pod:61 msgid "DESCRIPTION" msgstr "DESCRIPTION" #. type: textblock #: dos2unix.pod:63 msgid "The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa." msgstr "Le package Dos2unix inclut les utilitaires C et C pour convertir des fichiers textes au format DOS ou Mac vers le format Unix et inversement." #. type: textblock #: dos2unix.pod:66 msgid "In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks." msgstr "Dans les fichiers textes DOS/Windows, un saut de ligne est une combinaison de deux caractères: un retour de chariot (CR) suivi d'un saut de ligne (LF). Dans les fichiers textes Unix, le saut de ligne est un seul caractère: le saut de ligne (LF). Les fichiers textes Mac, avant Mac OS X, utilisaient le retour chariot (CR) comme seul caractère. De nos jours, Mac OS utilise le même style de saut de ligne que Unix (LF)." #. type: textblock #: dos2unix.pod:72 msgid "Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files." msgstr "Outre les sauts de lignes, Dos2unix convertit aussi le codage des fichiers. Quelques codes page DOS peuvent être convertis en Latin-1 sous Unix. L'Unicode des fichiers Windows (UTF-16) peut être converti en Unicode Unix (UTF-8)." #. type: textblock #: dos2unix.pod:76 msgid "Binary files are automatically skipped, unless conversion is forced." msgstr "Les fichiers binaires sont automatiquement ignorés à moins que la conversion soit forcée." #. type: textblock #: dos2unix.pod:78 msgid "Non-regular files, such as directories and FIFOs, are automatically skipped." msgstr "Les fichiers non réguliers tels que les répertoires et les FIFOs sont automatiquement ignorés." #. type: textblock #: dos2unix.pod:80 msgid "Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows." msgstr "Les liens symboliques et leur cible sont, par défaut, inchangés. En option, les liens symboliques peuvent être remplacés ou, au choix, la sortie peut être écrite dans la cible du lien symbolique. Écrire dans la cible d'un lien symbolique n'est pas supporté sous Windows." #. type: textblock #: dos2unix.pod:84 msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion." msgstr "Dos2unix a été conçu comme dos2unix sous SunOS/Solaris. Il y a une différence importante avec la version originale de SunOS/Solaris. Cette version effectue les conversions en place (ancien mode de fichier) tandis que la version originale de SunOS/Solaris ne supporte que la conversion par paire (nouveau mode de fichier). Voyez aussi les options C<-o> et C<-n>. Une autre différence est que SunOS/Solaris utilise par défaut le mode de conversion I tandis que cette version utilise par défaut le mode de conversion I." #. type: =head1 #: dos2unix.pod:92 msgid "OPTIONS" msgstr "OPTIONS" #. type: =item #: dos2unix.pod:96 msgid "B<-->" msgstr "B<-->" #. type: textblock #: dos2unix.pod:98 msgid "Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named \"-foo\", you can use this command:" msgstr "Traites toutes les options à sa suite comme étant des noms de fichiers. Utilisez cette option si vous voulez convertir des fichiers dont le nom commence par un tiret. Par exemple, pour convertir un fichier nommé « -foo », vous pouvez utiliser cette commande:" #. type: verbatim #: dos2unix.pod:102 #, no-wrap msgid "" " dos2unix -- -foo\n" "\n" msgstr "" " dos2unix -- -foo\n" "\n" #. type: textblock #: dos2unix.pod:104 msgid "Or in new file mode:" msgstr "Ou dans le style des nouveaux fichiers:" #. type: verbatim #: dos2unix.pod:106 #, no-wrap msgid "" " dos2unix -n -- -foo out.txt\n" "\n" msgstr "" " dos2unix -n -- -foo sortie.txt\n" "\n" #. type: =item #: dos2unix.pod:108 msgid "B<-ascii>" msgstr "B<-ascii>" #. type: textblock #: dos2unix.pod:110 msgid "Convert only line breaks. This is the default conversion mode." msgstr "Convertit uniquement les sauts de lignes. C'est le mode de conversion par défaut." #. type: =item #: dos2unix.pod:112 msgid "B<-iso>" msgstr "B<-iso>" #. type: textblock #: dos2unix.pod:114 msgid "Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES." msgstr "Convertit le jeu de caractères du DOS vers ISO-8859-1. Voyez aussi la section des MODES DE CONVERSION." #. type: =item #: dos2unix.pod:117 msgid "B<-1252>" msgstr "B<-1252>" #. type: textblock #: dos2unix.pod:119 msgid "Use Windows code page 1252 (Western European)." msgstr "Utilise le code page 1252 de Windows (Europe de l'ouest)." #. type: =item #: dos2unix.pod:121 msgid "B<-437>" msgstr "B<-437>" #. type: textblock #: dos2unix.pod:123 msgid "Use DOS code page 437 (US). This is the default code page used for ISO conversion." msgstr "Utilise le code page 437 du DOS (US). C'est le code page par défaut pour les conversions ISO." #. type: =item #: dos2unix.pod:125 msgid "B<-850>" msgstr "B<-850>" #. type: textblock #: dos2unix.pod:127 msgid "Use DOS code page 850 (Western European)." msgstr "Utilise le code page 850 du DOS (Europe de l'ouest)." #. type: =item #: dos2unix.pod:129 msgid "B<-860>" msgstr "B<-860>" #. type: textblock #: dos2unix.pod:131 msgid "Use DOS code page 860 (Portuguese)." msgstr "Utilise le code page 860 du DOS (portugais)." #. type: =item #: dos2unix.pod:133 msgid "B<-863>" msgstr "B<-863>" #. type: textblock #: dos2unix.pod:135 msgid "Use DOS code page 863 (French Canadian)." msgstr "Utilise le code page 863 du DOS (français canadien)." #. type: =item #: dos2unix.pod:137 msgid "B<-865>" msgstr "B<-865>" #. type: textblock #: dos2unix.pod:139 msgid "Use DOS code page 865 (Nordic)." msgstr "Utilise le code page 865 du DOS (nordique)." #. type: =item #: dos2unix.pod:141 msgid "B<-7>" msgstr "B<-7>" #. type: textblock #: dos2unix.pod:143 msgid "Convert 8 bit characters to 7 bit space." msgstr "Convertit les caractères 8 bits vers l'espace 7 bits." #. type: =item #: dos2unix.pod:145 msgid "B<-b, --keep-bom>" msgstr "B<-b, --keep-bom>" #. type: textblock #: dos2unix.pod:147 msgid "Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option C<-r>." msgstr "Conserve la marque d'ordre des octets (BOM). Si le fichier d'entrée a une BOM, elle est écrite dans le fichier de sortie. C'est le comportement par défaut quand les sauts de lignes sont convertis au format DOS. Consultez aussi l'option C<-r>." #. type: =item #: dos2unix.pod:151 msgid "B<-c, --convmode CONVMODE>" msgstr "B<-c, --convmode MODE_CONV>" #. type: textblock #: dos2unix.pod:153 msgid "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default." msgstr "Change le mode de conversion. MODE_CONV prend l'une des valeurs: I, I<7bit>, I, I. Ascii est la valeur par défaut." #. type: =item #: dos2unix.pod:157 msgid "B<-D, --display-enc ENCODING>" msgstr "B<-D, --display-enc ENCODAGE>" #. type: textblock #: dos2unix.pod:159 msgid "Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default." msgstr "Choisi l'encodage des textes affichés. L'ENCODAGE peut être : I, I, I, I, I. La valeur par défaut est ansi." #. type: textblock #: dos2unix.pod:163 msgid "This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed." msgstr "Cette option est uniquement disponible dans dos2unix pour Windows avec support pour les noms de fichiers Unicode. Cette option n'a aucun effet sur les noms de fichiers lus et écrits. Son effet se limite à leur affichage." #. type: textblock #: dos2unix.pod:167 msgid "There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages." msgstr "Il existe plusieurs méthodes pour afficher du texte dans une console Windows selon l'encodage du texte. Elles ont toutes leurs propres avantages et désavantages." #. type: =item #: dos2unix.pod:173 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:175 msgid "Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page." msgstr "La méthode par défaut de dos2unix est d'utiliser du texte encodé en ANSI. Elle a l'avantage d'être rétro compatible. Elle fonctionne avec des polices raster ou TrueType. Dans certaines régions, vous pouvez avoir besoin d'utiliser la commande C pour remplacer le code page DOS OEM actif par le code ANSI système de Windows car dos2unix utilise le code page système de Windows." #. type: textblock #: dos2unix.pod:181 msgid "The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK." msgstr "Le désavantage de ansi est que les noms de fichiers internationaux avec des caractères en dehors du code page système par défaut ne sont pas affichés correctement. Vous verrez un point d'interrogation ou un mauvais symbole à leur place. Cette méthode est acceptable si vous ne travaillez pas avec des noms de fichiers étrangers." #. type: =item #: dos2unix.pod:186 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:188 msgid "The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it." msgstr "L'avantage de l'encodage unicode (le nom de Windows pour UTF-16) est que le texte est habituellement affiché correctement. Il n'est pas nécessaire de changer le code page actif. Vous pouvez avoir besoin de remplacer la police de la console par une police TrueType pour afficher les caractères internationaux correctement. Lorsqu'un caractère n'est pas inclus dans la police TrueType, il sera généralement remplacé par un petit carré, parfois avec un point d'interrogation à l'intérieur." #. type: textblock #: dos2unix.pod:194 msgid "When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font." msgstr "Lorsque vous utilisez la console ConEmu, les textes sont affichés correctement car ConEmu sélectionne automatiquement une bonne police." #. type: textblock #: dos2unix.pod:197 msgid "The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program." msgstr "Le désavantage de unicode est qu'il n'est pas compatible avec ASCII. La sortie n'est pas facile à gérer quand vous la redirigez vers un autre programme." #. type: textblock #: dos2unix.pod:200 msgid "When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "Quand la méthode C est utilisée, le texte Unicode est précédé d'une BOM (Byte Order Mark=marque d'ordre des octets). Une BOM est nécessaire pour la redirection correcte ou le pipelining dans PowerShell." #. type: =item #: dos2unix.pod:205 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:207 msgid "The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding." msgstr "L'avantage de utf8 est qu'il est compatible avec ASCII. Vous devez utiliser une police TrueType dans la console. Avec une police TrueType, le texte est affiché comme avec un encodage C." #. type: textblock #: dos2unix.pod:211 msgid "The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed." msgstr "Le désavantage est que, si vous utilisez la police raster par défaut, tous les caractères non ASCII sont mal affichés. Pas uniquement les noms de fichiers unicode ! Les messages traduits deviennent inintelligibles. Sous Windows configuré pour une région de l'est de l'Asie, vous pouvez observer énormément de scintillements dans la console quand des messages sont affichés." #. type: textblock #: dos2unix.pod:217 msgid "In a ConEmu console the utf8 encoding method works well." msgstr "Dans une console ConEmu, l'encodage utf8 fonctionne bien." #. type: textblock #: dos2unix.pod:219 msgid "When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "Quand la méthode C est utilisée, le texte UTF-8 est précédé d'une BOM (Byte Order Mark=marque d'ordre des octets). Une BOM est nécessaire pour la redirection correcte ou le pipelining dans PowerShell." #. type: textblock #: dos2unix.pod:226 msgid "The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C." msgstr "L'encodage par défaut peut être changé en assignant la valeur C, C, C ou C à la variable d'environnement DOS2UNIX_DISPLAY_ENC." #. type: =item #: dos2unix.pod:229 msgid "B<-f, --force>" msgstr "B<-f, --force>" #. type: textblock #: dos2unix.pod:231 msgid "Force conversion of binary files." msgstr "Force la conversion de fichiers binaires." #. type: =item #: dos2unix.pod:233 msgid "B<-gb, --gb18030>" msgstr "B<-gb, --gb18030>" #. type: textblock #: dos2unix.pod:235 msgid "On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030." msgstr "Sous Windows, les fichiers UTF-16 sont convertis en UTF-8 par défaut sans considération pour les paramètres de la localisation. Utilisez cette option pour convertir UTF-16 en GB18030. Cette option n'est disponible que sous Windows. Consultez aussi la section GB18030." #. type: =item #: dos2unix.pod:239 msgid "B<-h, --help>" msgstr "B<-h, --help>" #. type: textblock #: dos2unix.pod:241 msgid "Display help and exit." msgstr "Affiche l'aide et s'arrête." #. type: =item #: dos2unix.pod:243 msgid "B<-i[FLAGS], --info[=FLAGS] FILE ...>" msgstr "B<-i[FANIONS], --info[=FANIONS] FICHIER …>" #. type: textblock #: dos2unix.pod:245 msgid "Display file information. No conversion is done." msgstr "Affiche les informations du fichier. Aucune conversion n'est réalisée." #. type: textblock #: dos2unix.pod:247 msgid "The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name." msgstr "Les informations suivantes sont affichées dans cet ordre: le nombre de sauts de ligne DOS, le nombre de sauts de ligne Unix, le nombre de sauts de ligne Mac, la marque d'ordre des octets, texte ou binaire, nom du fichier." #. type: textblock #: dos2unix.pod:251 msgid "Example output:" msgstr "Exemple de sortie :" #. type: verbatim #: dos2unix.pod:253 #, no-wrap msgid "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" msgstr "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" #. type: textblock #: dos2unix.pod:262 msgid "Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>." msgstr "Notez qu'un fichier binaire peut parfois être considéré à tord comme un fichier texte. Voyez aussi l'option C<-s>." #. type: textblock #: dos2unix.pod:264 msgid "Optionally extra flags can be set to change the output. One or more flags can be added." msgstr "Des fanions facultatifs peuvent être ajoutés pour changer la sortie. Un ou plusieurs fanions peuvent être ajoutés." #. type: =item #: dos2unix.pod:269 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:271 msgid "Print number of DOS line breaks." msgstr "Affiche le nombre de sauts de ligne DOS." #. type: =item #: dos2unix.pod:273 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:275 msgid "Print number of Unix line breaks." msgstr "Affiche le nombre de sauts de ligne Unix." #. type: =item #: dos2unix.pod:277 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:279 msgid "Print number of Mac line breaks." msgstr "Affiche le nombre de sauts de ligne Mac." #. type: =item #: dos2unix.pod:281 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:283 msgid "Print the byte order mark." msgstr "Afficher la marque d'ordre des octets." #. type: =item #: dos2unix.pod:285 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:287 msgid "Print if file is text or binary." msgstr "Affiche si le fichier est texte ou binaire." #. type: =item #: dos2unix.pod:289 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:291 msgid "Print only the files that would be converted." msgstr "Affiche uniquement les fichiers qui seraient convertis." #. type: textblock #: dos2unix.pod:293 msgid "With the C flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks." msgstr "Avec le fanion C, dos2unix n'affichera que les fichiers contenant des sauts de ligne DOS alors que unix2dos n'affichera que les noms des fichiers aillant des sauts de ligne Unix." #. type: =item #: dos2unix.pod:296 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:298 msgid "Print a header." msgstr "Afficher un en-tête." #. type: =item #: dos2unix.pod:300 msgid "B

" msgstr "B

" #. type: textblock #: dos2unix.pod:302 msgid "Show file names without path." msgstr "Montrer les noms des fichiers sans le chemin." #. type: textblock #: dos2unix.pod:306 msgid "Examples:" msgstr "Exemples:" #. type: textblock #: dos2unix.pod:308 msgid "Show information for all *.txt files:" msgstr "Afficher les informations pour tous les fichier *.txt :" #. type: verbatim #: dos2unix.pod:310 #, no-wrap msgid "" " dos2unix -i *.txt\n" "\n" msgstr "" " dos2unix -i *.txt\n" "\n" #. type: textblock #: dos2unix.pod:312 msgid "Show only the number of DOS line breaks and Unix line breaks:" msgstr "Afficher uniquement le nombre de sauts de ligne DOS et Unix :" #. type: verbatim #: dos2unix.pod:314 #, no-wrap msgid "" " dos2unix -idu *.txt\n" "\n" msgstr "" " dos2unix -idu *.txt\n" "\n" #. type: textblock #: dos2unix.pod:316 msgid "Show only the byte order mark:" msgstr "Montrer uniquement la marque d'ordre des octets :" #. type: verbatim #: dos2unix.pod:318 #, no-wrap msgid "" " dos2unix --info=b *.txt\n" "\n" msgstr "" " dos2unix --info=b *.txt\n" "\n" #. type: textblock #: dos2unix.pod:320 msgid "List the files that have DOS line breaks:" msgstr "Liste les fichiers qui ont des sauts de ligne DOS :" #. type: verbatim #: dos2unix.pod:322 #, no-wrap msgid "" " dos2unix -ic *.txt\n" "\n" msgstr "" " dos2unix -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:324 msgid "List the files that have Unix line breaks:" msgstr "Liste les fichiers qui ont des sauts de ligne Unix :" #. type: verbatim #: dos2unix.pod:326 #, no-wrap msgid "" " unix2dos -ic *.txt\n" "\n" msgstr "" " unix2dos -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:328 msgid "Convert only files that have DOS line breaks and leave the other files untouched:" msgstr "Ne converti que les fichiers qui ont des sauts de lignes DOS et laisse les autres fichiers inchangés:" #. type: verbatim #: dos2unix.pod:330 #, no-wrap msgid "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:332 msgid "Find text files that have DOS line breaks:" msgstr "Trouve les fichiers texte qui ont des sauts de ligne DOS :" #. type: verbatim #: dos2unix.pod:334 #, no-wrap msgid "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" msgstr "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" #. type: =item #: dos2unix.pod:336 msgid "B<-k, --keepdate>" msgstr "B<-k, --keepdate>" #. type: textblock #: dos2unix.pod:338 msgid "Keep the date stamp of output file same as input file." msgstr "La date du fichier de sortie est la même que celle du fichier d'entrée." #. type: =item #: dos2unix.pod:340 msgid "B<-L, --license>" msgstr "B<-L, --license>" #. type: textblock #: dos2unix.pod:342 msgid "Display program's license." msgstr "Affiche la licence du programme." #. type: =item #: dos2unix.pod:344 msgid "B<-l, --newline>" msgstr "B<-l, --newline>" #. type: textblock #: dos2unix.pod:346 msgid "Add additional newline." msgstr "Ajoute des sauts de lignes additionnels." #. type: textblock #: dos2unix.pod:348 msgid "B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks." msgstr "B: Seuls les sauts de lignes du DOS sont changés en deux sauts de lignes de Unix. En mode Mac, seuls les sauts de lignes Mac sont changés en deux sauts de lignes Unix." #. type: textblock #: dos2unix.pod:352 msgid "B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks." msgstr "B: Seuls les sauts de lignes Unix sont changés en deux sauts de lignes du DOS. En mode Mac, les sauts de lignes Unix sont remplacés par deux sauts de lignes Mac." #. type: =item #: dos2unix.pod:355 msgid "B<-m, --add-bom>" msgstr "B<-m, --add-bom>" #. type: textblock #: dos2unix.pod:357 msgid "Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written." msgstr "Écrit une marque d'ordre des octets (BOM) dans le fichier de sortie. Par défaut une BOM UTF-8 est écrite." #. type: textblock #: dos2unix.pod:360 msgid "When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM will be written." msgstr "Lorsque le fichier d'entrée est en UTF-16 et que l'option C<-u> est utilisée, une BOM UTF-16 est écrite." #. type: textblock #: dos2unix.pod:363 msgid "Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE." msgstr "N'utilisez jamais cette option quand l'encodage du fichier de sortie n'est ni UTF-8 ni UTF-16 ni GB18030. Consultez également la section UNICODE." #. type: =item #: dos2unix.pod:367 msgid "B<-n, --newfile INFILE OUTFILE ...>" msgstr "B<-n, --newfile FICHIER_ENTRÉE FICHIER_SORTIE …>" #. type: textblock #: dos2unix.pod:369 msgid "New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files." msgstr "Nouveau mode de fichiers. Convertit le fichier FICHER_ENTRÉE et écrit la sortie dans le fichier FICHIER_SORTIE. Les noms des fichiers doivent être indiqués par paires. Les jokers I doivent I être utilisés ou vous I vos fichiers." #. type: textblock #: dos2unix.pod:373 msgid "The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion." msgstr "La personne qui démarre la conversion dans le nouveau mode (pairé) des fichiers sera le propriétaire du fichier converti. Les permissions de lecture/écriture du nouveau fichier seront les permissions du fichier original moins le umask(1) de la personne qui exécute la conversion." #. type: =item #: dos2unix.pod:378 msgid "B<-o, --oldfile FILE ...>" msgstr "B<-o, --oldfile FICHIER …>" #. type: textblock #: dos2unix.pod:380 msgid "Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used." msgstr "Ancien mode de fichiers. Convertit le fichier FICHIER et écrit la sortie dedans. Le programme fonctionne dans ce mode par défaut. Les jokers peuvent être utilisés." #. type: textblock #: dos2unix.pod:383 msgid "In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix." msgstr "Dans l'ancien mode (en place) des fichiers, les fichiers convertis ont le même propriétaire, groupe et permissions lecture/écriture que le fichier original. Idem quand le fichier est converti par un utilisateur qui a la permission d'écrire dans le fichier (par exemple, root). La conversion est interrompue si il n'est pas possible de conserver les valeurs d'origine. Le changement de propriétaire pourrait signifier que le propriétaire original n'est plus en mesure de lire le fichier. Le changement de groupe pourrait être un risque pour la sécurité. Le fichier pourrait être rendu accessible en lecture par des personnes à qui il n'est pas destiné. La conservation du propriétaire, du groupe et des permissions de lecture/écriture n'est supportée que sous Unix." #. type: =item #: dos2unix.pod:392 msgid "B<-q, --quiet>" msgstr "B<-q, --quiet>" #. type: textblock #: dos2unix.pod:394 msgid "Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used." msgstr "Mode silencieux. Supprime les avertissements et les messages. La valeur de sortie est zéro sauf quand de mauvaises options sont utilisées sur la ligne de commande." #. type: =item #: dos2unix.pod:397 msgid "B<-r, --remove-bom>" msgstr "B<-r, --remove-bom>" #. type: textblock #: dos2unix.pod:399 msgid "Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option C<-b>." msgstr "Supprime la marque d'ordre des octets (BOM). N'écrit pas la BOM dans le fichier de sortie. Ceci est le comportement par défaut lorsque les sauts de lignes sont convertis au format Unix. Consultez aussi l'option C<-b>." #. type: =item #: dos2unix.pod:403 msgid "B<-s, --safe>" msgstr "B<-s, --safe>" #. type: textblock #: dos2unix.pod:405 msgid "Skip binary files (default)." msgstr "Ignore les fichiers binaires (par défaut)." #. type: textblock #: dos2unix.pod:407 msgid "The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file." msgstr "Ignorer les fichiers binaires sert à éviter les erreurs accidentelles. Attention que la détection de fichiers binaires n'est pas fiable à 100%. Les fichiers en entrée sont analysés pour y trouver des symboles binaires qui ne sont habituellement pas rencontrés dans des fichiers textes. Il est cependant possible qu'un fichier binaire ne contienne que des caractères textes normaux. Un tel fichier serait erronément traité comme un fichier texte." #. type: =item #: dos2unix.pod:413 msgid "B<-u, --keep-utf16>" msgstr "B<-u, --keep-utf16>" #. type: textblock #: dos2unix.pod:415 msgid "Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the C<-ascii> option." msgstr "Conserve l'encodage UTF-16 original du fichier d'entrée. Le fichier de sortie sera écrit dans le même encodage UTF-16 (petit ou grand boutien) que le fichier d'entrée. Ceci évite la transformation en UTF-8. Une BOM UTF-16 sera écrite en conséquent. Cette option peut être désactivée avec l'option C<-ascii>." #. type: =item #: dos2unix.pod:420 msgid "B<-ul, --assume-utf16le>" msgstr "B<-ul, --assume-utf16le>" #. type: textblock #: dos2unix.pod:422 msgid "Assume that the input file format is UTF-16LE." msgstr "Suppose que le fichier d'entrée est au format UTF-16LE." #. type: textblock #: dos2unix.pod:424 msgid "When there is a Byte Order Mark in the input file the BOM has priority over this option." msgstr "Quand il y a un indicateur d'ordre des octets dans le fichier d'entrée, l'indicateur a priorité sur cette option." #. type: textblock #: dos2unix.pod:427 msgid "When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file." msgstr "Si vous vous êtes trompé sur le format du fichier d'entrée (par exemple, ce n'était pas un fichier UTF16-LE) et que la conversion réussi, vous obtiendrez un fichier UTF-8 contenant le mauvais texte. Vous pouvez récupérer le fichier original avec iconv(1) en convertissant le fichier de sortie UTF-8 vers du UTF-16LE." #. type: textblock #: dos2unix.pod:432 msgid "The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off." msgstr "La présupposition de l'UTF-16LE fonctionne comme un I. En utilisant le mode I par défaut, UTF-16LE n'est plus présupposé." #. type: =item #: dos2unix.pod:435 msgid "B<-ub, --assume-utf16be>" msgstr "B<-ub, --assume-utf16be>" #. type: textblock #: dos2unix.pod:437 msgid "Assume that the input file format is UTF-16BE." msgstr "Suppose que le fichier d'entrée est au format UTF-16BE." #. type: textblock #: dos2unix.pod:439 msgid "This option works the same as option C<-ul>." msgstr "Cette option fonctionne comme l'option C<-ul>." #. type: =item #: dos2unix.pod:441 msgid "B<-v, --verbose>" msgstr "B<-v, --verbose>" #. type: textblock #: dos2unix.pod:443 msgid "Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks." msgstr "Affiche des messages verbeux. Des informations supplémentaires sont affichées à propos des marques d'ordre des octets et du nombre de sauts de lignes convertis." #. type: =item #: dos2unix.pod:446 msgid "B<-F, --follow-symlink>" msgstr "B<-F, --follow-symlink>" #. type: textblock #: dos2unix.pod:448 msgid "Follow symbolic links and convert the targets." msgstr "Suit les liens symboliques et convertit les cibles." #. type: =item #: dos2unix.pod:450 msgid "B<-R, --replace-symlink>" msgstr "B<-R, --replace-symlink>" #. type: textblock #: dos2unix.pod:452 msgid "Replace symbolic links with converted files (original target files remain unchanged)." msgstr "Remplace les liens symboliques par les fichiers convertis (les fichiers cibles originaux restent inchangés)." #. type: =item #: dos2unix.pod:455 msgid "B<-S, --skip-symlink>" msgstr "B<-S, --skip-symlink>" #. type: textblock #: dos2unix.pod:457 msgid "Keep symbolic links and targets unchanged (default)." msgstr "Ne change pas les liens symboliques ni les cibles (par défaut)." #. type: =item #: dos2unix.pod:459 msgid "B<-V, --version>" msgstr "B<-V, --version>" #. type: textblock #: dos2unix.pod:461 msgid "Display version information and exit." msgstr "Affiche les informations de version puis arrête." #. type: =head1 #: dos2unix.pod:465 msgid "MAC MODE" msgstr "MODE MAC" #. type: textblock #: dos2unix.pod:467 msgid "In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted." msgstr "En mode normal, les sauts de lignes sont convertis du DOS vers Unix et inversement. Les sauts de lignes Mac ne sont pas convertis." #. type: textblock #: dos2unix.pod:470 msgid "In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed." msgstr "En mode Mac, les sauts de lignes sont convertis du format Mac au format Unix et inversement. Les sauts de lignes DOS ne sont pas changés." #. type: textblock #: dos2unix.pod:473 msgid "To run in Mac mode use the command-line option C<-c mac> or use the commands C or C." msgstr "Pour fonctionner en mode Mac, utilisez l'option en ligne de commande C<-c mac> ou utilisez les commandes C ou C." #. type: =head1 #: dos2unix.pod:476 msgid "CONVERSION MODES" msgstr "MODES DE CONVERSION" #. type: =item #: dos2unix.pod:480 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:482 msgid "In mode C only line breaks are converted. This is the default conversion mode." msgstr "En mode C, seuls les sauts de lignes sont convertis. Ceci est le mode de conversion par défaut." #. type: textblock #: dos2unix.pod:485 msgid "Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files." msgstr "Bien que le nom de ce mode soit ASCII, qui est un standard 7 bits, ce mode travail en réalité sur 8 bits. Utilisez toujours ce mode lorsque vous convertissez des fichiers Unicode UTF-8." #. type: =item #: dos2unix.pod:489 msgid "B<7bit>" msgstr "B<7bit>" #. type: textblock #: dos2unix.pod:491 msgid "In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space." msgstr "Dans ce mode, tous les caractères 8 bits non ASCII (avec des valeurs entre 128 et 255) sont remplacés par une espace 7 bits." #. type: =item #: dos2unix.pod:494 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:496 msgid "Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart." msgstr "Les caractères sont convertis entre un jeu de caractères DOS (code page) et le jeu de caractères ISO-8859-1 (Latin-1) de Unix. Les caractères DOS sans équivalent ISO-8859-1, pour lesquels la conversion n'est pas possible, sont remplacés par un point. La même chose est valable pour les caractères ISO-8859-1 sans équivalent DOS." #. type: textblock #: dos2unix.pod:501 msgid "When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings." msgstr "Quand seule l'option C<-iso> est utilisée, dos2unix essaie de déterminer le code page actif. Quand ce n'est pas possible, dos2unix utilise le code page CP437 par défaut qui est surtout utilisé aux USA. Pour forcer l'utilisation d'un code page spécifique, utilisez les options C<-437> (US), C<-850> (Europe de l'ouest), C<-860> (portugais), C<-863> (français canadien) ou C<-865> (nordique). Le code page CP1252 de Windows (Europe de l'ouest) est également supporté avec l'option C<-1252>. Pour d'autres codes pages, utilisez dos2unix avec iconv(1). Iconv supporte une longue liste de codages de caractères." #. type: textblock #: dos2unix.pod:510 msgid "Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files." msgstr "N'utilisez jamais la conversion ISO sur des fichiers textes Unicode. Cela va corrompre les fichiers encodés en UTF-8." #. type: textblock #: dos2unix.pod:512 msgid "Some examples:" msgstr "Quelques exemples:" #. type: textblock #: dos2unix.pod:514 msgid "Convert from DOS default code page to Unix Latin-1:" msgstr "Convertir du code page par défaut du DOS au Latin-1 Unix :" #. type: verbatim #: dos2unix.pod:516 #, no-wrap msgid "" " dos2unix -iso -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -iso -n entrée.txt sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:518 msgid "Convert from DOS CP850 to Unix Latin-1:" msgstr "Convertir du CP850 du DOS au Latin-1 Unix :" #. type: verbatim #: dos2unix.pod:520 #, no-wrap msgid "" " dos2unix -850 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -850 -n entrée.txt sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:522 msgid "Convert from Windows CP1252 to Unix Latin-1:" msgstr "Convertir du CP1252 de Windows au Latin-1 de Unix :" #. type: verbatim #: dos2unix.pod:524 #, no-wrap msgid "" " dos2unix -1252 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -1252 -n entrée.txt sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:526 msgid "Convert from Windows CP1252 to Unix UTF-8 (Unicode):" msgstr "Convertir le CP1252 de Windows en UTF-8 de Unix (Unicode) :" #. type: verbatim #: dos2unix.pod:528 #, no-wrap msgid "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" msgstr "" " iconv -f CP1252 -t UTF-8 entrée.txt | dos2unix > sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:530 msgid "Convert from Unix Latin-1 to DOS default code page:" msgstr "Convertir du Latin-1 de Unix au code page par défaut de DOS :" #. type: verbatim #: dos2unix.pod:532 #, no-wrap msgid "" " unix2dos -iso -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -iso -n entrée.txt sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:534 msgid "Convert from Unix Latin-1 to DOS CP850:" msgstr "Convertir le Latin-1 de Unix en CP850 du DOS :" #. type: verbatim #: dos2unix.pod:536 #, no-wrap msgid "" " unix2dos -850 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -850 -n entrée.txt sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:538 msgid "Convert from Unix Latin-1 to Windows CP1252:" msgstr "Convertir le Latin-1 de Unix en CP1252 de Windows :" #. type: verbatim #: dos2unix.pod:540 #, no-wrap msgid "" " unix2dos -1252 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -1252 -n entrée.txt sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:542 msgid "Convert from Unix UTF-8 (Unicode) to Windows CP1252:" msgstr "Convertir le UTF-8 de Unix (Unicode) en CP1252 de Windows :" #. type: verbatim #: dos2unix.pod:544 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" msgstr "" " unix2dos < entrée.txt | iconv -f UTF-8 -t CP1252 > sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:546 msgid "See also L and L." msgstr "Consultez aussi L et L." #. type: =head1 #: dos2unix.pod:551 msgid "UNICODE" msgstr "UNICODE" #. type: =head2 #: dos2unix.pod:553 msgid "Encodings" msgstr "Codages" #. type: textblock #: dos2unix.pod:555 msgid "There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format." msgstr "Il existe plusieurs codages Unicode. Sous Unix et Linux, les fichiers sont généralement codés en UTF-8. Sous Windows, les fichiers textes Unicode peuvent être codés en UTF-8, UTF-16 ou UTF-16 gros boutien mais ils sont majoritairement codés au format UTF-16." #. type: =head2 #: dos2unix.pod:560 msgid "Conversion" msgstr "Conversion" #. type: textblock #: dos2unix.pod:562 msgid "Unicode text files can have DOS, Unix or Mac line breaks, like regular text files." msgstr "Les fichiers textes Unicode peuvent avoir des sauts de lignes DOS, Unix ou Mac, tout comme les fichiers textes normaux." #. type: textblock #: dos2unix.pod:565 msgid "All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII." msgstr "Toutes les versions de dos2unix et unix2dos peuvent convertir des fichiers codés en UTF-8 car UTF-8 a été conçu pour être rétro-compatible avec l'ASCII." #. type: textblock #: dos2unix.pod:568 msgid "Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C." msgstr "Dos2unix et unix2dos, avec le support pour l'Unicode UTF-16, peuvent lire les fichiers textes codés sous forme petit boutien ou gros boutien. Pour savoir si dos2unix a été compilé avec le support UTF-16 tapez C." #. type: textblock #: dos2unix.pod:572 msgid "On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped." msgstr "Sous Unix/Linux, les fichiers encodés en UTF-16 sont convertis vers l'encodage des caractères de la localisation. Utilisez locale(1) pour découvrir quel encodage de caractères est utilisé. Lorsque la conversion n'est pas possible, une erreur de conversion est produite et le fichier est abandonné." #. type: textblock #: dos2unix.pod:577 msgid "On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux." msgstr "Sous Windows, les fichiers UTF-16 sont convertis par défaut en UTF-8. Les fichiers textes formatés en UTF-8 sont bien supportés sous Windows et Unix/Linux." #. type: textblock #: dos2unix.pod:580 msgid "UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." msgstr "Les codages UTF-16 et UTF-8 sont parfaitement compatibles. Il n'y a pas de pertes lors de la conversion. Lorsqu'une erreur de conversion UTF-16 vers UTF-8 survient, par exemple, quand le fichier d'entrée UTF-16 contient une erreur, le fichier est ignoré." #. type: textblock #: dos2unix.pod:584 msgid "When option C<-u> is used, the output file will be written in the same UTF-16 encoding as the input file. Option C<-u> prevents conversion to UTF-8." msgstr "Quand l'option C<-u> est utilisée, le fichier de sortie est écrit dans le même encodage UTF-16 que le fichier d'entrée. L'option C<-u> empêche la conversion en UTF-8." #. type: textblock #: dos2unix.pod:587 msgid "Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16." msgstr "Dos2unix et unix2dos n'ont pas d'option pour convertir des fichiers UTF-8 en UTF-16." #. type: textblock #: dos2unix.pod:589 msgid "ISO and 7-bit mode conversion do not work on UTF-16 files." msgstr "Les modes de conversion ISO et 7 bits ne fonctionnent pas sur des fichiers UTF-16." #. type: =head2 #: dos2unix.pod:591 msgid "Byte Order Mark" msgstr "Marque d'ordre des octets" #. type: textblock #: dos2unix.pod:593 msgid "On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L." msgstr "Les fichiers textes Unicode sous Windows on généralement un indicateur d'ordre des octets (BOM) car de nombreux programmes Windows (y compris Notepad) ajoutent cet indicateur par défaut. Consultez aussi L." #. type: textblock #: dos2unix.pod:597 msgid "On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding." msgstr "Sous Unix, les fichiers Unicodes n'ont habituellement pas de BOM. Il est supposé que les fichiers textes sont codés selon le codage de l'environnement linguistique." #. type: textblock #: dos2unix.pod:600 msgid "Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file." msgstr "Dos2unix ne peut détecter que le fichier est au format UTF-16 si le fichier n'a pas de BOM. Quand le fichier UTF-16 n'a pas cet indicateur, dos2unix voit le fichier comme un fichier binaire." #. type: textblock #: dos2unix.pod:604 msgid "Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM." msgstr "Utilisez l'option C<-ul> ou C<-ub> pour convertir un fichier UTF-16 sans BOM." #. type: textblock #: dos2unix.pod:606 msgid "Dos2unix writes by default no BOM in the output file. With option C<-b> Dos2unix writes a BOM when the input file has a BOM." msgstr "Dos2unix, par défaut, n'écrit pas de BOM dans le fichier de sortie. Avec l'option C<-b>, Dos2unix écrit une BOM quand le fichier d'entrée a une BOM." #. type: textblock #: dos2unix.pod:609 msgid "Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option C<-r> to remove the BOM." msgstr "Unix2dos écrit par défaut une BOM dans le fichier de sortie quand le fichier d'entrée a une BOM. Utilisez l'option C<-r> pour supprimer la BOM." #. type: textblock #: dos2unix.pod:612 msgid "Dos2unix and unix2dos write always a BOM when option C<-m> is used." msgstr "Dos2unix et unix2dos écrivent toujours une BOM quand l'option C<-m> est utilisée." #. type: =head2 #: dos2unix.pod:614 msgid "Unicode file names on Windows" msgstr "Noms de fichiers unicode sous Windows" #. type: textblock #: dos2unix.pod:616 msgid "Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C." msgstr "Dos2unix supporte, en option, la lecture et l'écriture de noms de fichiers Unicode dans la ligne de commande de Windows. Cela signifie que dos2unix peut ouvrir des fichiers qui ont, dans leur nom, des caractères n'appartenant pas au code page système ANSI par défaut. Pour voir si dos2unix pour Windows a été compilé avec le support des noms de fichiers Unicode, tapez C." #. type: textblock #: dos2unix.pod:622 msgid "There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name." msgstr "Il y a quelques soucis avec l'affichage de noms de fichiers Unicode dans une console Windows. Voyez l'option C<-D>, C<--display-enc>. Les noms de fichiers peuvent être mal affichés dans la console mais les fichiers seront écrits avec les bons noms." #. type: =head2 #: dos2unix.pod:626 msgid "Unicode examples" msgstr "Exemples Unicode" #. type: textblock #: dos2unix.pod:628 msgid "Convert from Windows UTF-16 (with BOM) to Unix UTF-8:" msgstr "Convertir de l'UTF-16 Windows (avec BOM) vers l'UTF-8 de Unix :" #. type: verbatim #: dos2unix.pod:630 #, no-wrap msgid "" " dos2unix -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -n entrée.txt sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:632 msgid "Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:" msgstr "Convertir de l'UTF-16LE de Windows (sans BOM) vers l'UTF-8 de Unix :" #. type: verbatim #: dos2unix.pod:634 #, no-wrap msgid "" " dos2unix -ul -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -ul -n entrée.txt sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:636 msgid "Convert from Unix UTF-8 to Windows UTF-8 with BOM:" msgstr "Convertir de l'UTF-8 de Unix vers l'UTF-8 de Windows avec BOM :" #. type: verbatim #: dos2unix.pod:638 #, no-wrap msgid "" " unix2dos -m -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -m -n entrée.txt sortie.txt\n" "\n" #. type: textblock #: dos2unix.pod:640 msgid "Convert from Unix UTF-8 to Windows UTF-16:" msgstr "Convertir de l'UTF-8 de Unix vers l'UTF-16 de Windows :" #. type: verbatim #: dos2unix.pod:642 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" msgstr "" " unix2dos < entrée.txt | iconv -f UTF-8 -t UTF-16 > sortie.txt\n" "\n" #. type: =head1 #: dos2unix.pod:644 msgid "GB18030" msgstr "GB18030" #. type: textblock #: dos2unix.pod:646 msgid "GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also L." msgstr "GB18030 est un standard du gouvernement chinois. Tout logiciel vendu en Chine doit officiellement supporter un sous ensemble obligatoire du standard GB18030. Consultez L." #. type: textblock #: dos2unix.pod:650 msgid "GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK." msgstr "GB18030 est entièrement compatible avec Unicode et peut être considéré comme étant un format de transformation unicode. Comme UTF-8, GB18030 est compatible avec ASCII. GB18030 est aussi compatible avec le code page 936 de Windows aussi connu comme GBK." #. type: textblock #: dos2unix.pod:654 msgid "On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command C to get the list of supported locales." msgstr "Sous Unix/Linux, les fichiers UTF-16 sont convertis en GB18030 quand l'encodage de l'environnement linguistique est GB18030. Notez que cela ne fonctionnera que si l'environnement linguistique est supporté par le système. Utilisez la commande C pour obtenir la liste des environnements linguistiques supportés." #. type: textblock #: dos2unix.pod:658 msgid "On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030." msgstr "Sous Windows, vous avez besoin de l'option C<-gb> pour convertir UTF-16 en GB18030." #. type: textblock #: dos2unix.pod:660 msgid "GB18030 encoded files can have a Byte Order Mark, like Unicode files." msgstr "Les fichiers encodés en GB18030 peuvent avoir une marque d'ordre des octets, comme les fichiers Unicode." #. type: =head1 #: dos2unix.pod:662 msgid "EXAMPLES" msgstr "EXEMPLES" #. type: textblock #: dos2unix.pod:664 msgid "Read input from 'stdin' and write output to 'stdout':" msgstr "Lire l'entrée depuis « stdin » et écrire la sortie vers « stdout » :" #. type: verbatim #: dos2unix.pod:666 #, fuzzy, no-wrap #| msgid "" #| " dos2unix -ic *.txt | xargs dos2unix\n" #| "\n" msgid "" " dos2unix < a.txt\n" " cat a.txt | dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:669 msgid "Convert and replace a.txt. Convert and replace b.txt:" msgstr "Convertir et remplacer a.txt. Convertir et remplace b.txt :" #. type: verbatim #: dos2unix.pod:671 #, no-wrap msgid "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" msgstr "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" #. type: textblock #: dos2unix.pod:674 msgid "Convert and replace a.txt in ascii conversion mode:" msgstr "Convertir et remplacer a.txt en mode de conversion ascii :" #. type: verbatim #: dos2unix.pod:676 #, no-wrap msgid "" " dos2unix a.txt\n" "\n" msgstr "" " dos2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:678 msgid "Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode:" msgstr "Convertir et remplacer a.txt en mode de conversion ascii. Convertir et remplacer b.txt en mode de conversion 7 bits :" #. type: verbatim #: dos2unix.pod:681 #, no-wrap msgid "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" msgstr "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" #. type: textblock #: dos2unix.pod:685 msgid "Convert a.txt from Mac to Unix format:" msgstr "Convertir a.txt depuis le format Mac vers le format Unix :" #. type: verbatim #: dos2unix.pod:687 #, no-wrap msgid "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" msgstr "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:690 msgid "Convert a.txt from Unix to Mac format:" msgstr "Convertir a.txt du format Unix au format Mac :" #. type: verbatim #: dos2unix.pod:692 #, no-wrap msgid "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" msgstr "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" #. type: textblock #: dos2unix.pod:695 msgid "Convert and replace a.txt while keeping original date stamp:" msgstr "Convertir et remplacer a.txt tout en conservant la date originale :" #. type: verbatim #: dos2unix.pod:697 #, no-wrap msgid "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" msgstr "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" #. type: textblock #: dos2unix.pod:700 msgid "Convert a.txt and write to e.txt:" msgstr "Convertir a.txt et écrire dans e.txt :" #. type: verbatim #: dos2unix.pod:702 #, no-wrap msgid "" " dos2unix -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:704 msgid "Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:" msgstr "Convertir a.txt et écrire dans e.txt. La date de e.txt est la même que celle de a.txt :" #. type: verbatim #: dos2unix.pod:706 #, no-wrap msgid "" " dos2unix -k -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -k -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:708 msgid "Convert and replace a.txt, convert b.txt and write to e.txt:" msgstr "Convertir et remplacer a.txt. Convertir b.txt et écrire dans e.txt :" #. type: verbatim #: dos2unix.pod:710 #, no-wrap msgid "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" msgstr "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:713 msgid "Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt:" msgstr "Convertir c.txt et écrire dans e.txt. Convertir et remplacer a.txt. Convertir et remplacer b.txt. Convertir d.txt et écrire dans f.txt :" #. type: verbatim #: dos2unix.pod:716 #, no-wrap msgid "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" msgstr "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" #. type: =head1 #: dos2unix.pod:718 msgid "RECURSIVE CONVERSION" msgstr "CONVERSIONS RÉCURSIVES" #. type: textblock #: dos2unix.pod:720 msgid "Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type:" msgstr "Utilisez dos2unix avec les commandes find(1) et xargs(1) pour convertir récursivement des fichiers textes dans une arborescence de répertoires. Par exemple, pour convertir tous les fichiers .txt dans les répertoires sous le répertoire courant, tapez:" #. type: verbatim #: dos2unix.pod:724 #, no-wrap msgid "" " find . -name '*.txt' |xargs dos2unix\n" "\n" msgstr "" " find . -name '*.txt' |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:726 msgid "In a Windows Command Prompt the following command can be used:" msgstr "En ligne de commande sous Windows, la commande suivante peut être utilisée :" #. type: verbatim #: dos2unix.pod:728 #, no-wrap msgid "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" msgstr "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" " find /R %G in \n" "\n" #. type: textblock #: dos2unix.pod:730 msgid "PowerShell users can use the following command in Windows PowerShell:" msgstr "Les utilisateurs de PowerShell peuvent utiliser la commande suivante dans le PowerShell de Windows :" #. type: verbatim #: dos2unix.pod:732 #, no-wrap msgid "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" msgstr "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" #. type: =head1 #: dos2unix.pod:735 msgid "LOCALIZATION" msgstr "PARAMÈTRES LINGUISTIQUES" #. type: =item #: dos2unix.pod:739 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:741 msgid "The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:" msgstr "La langue principale est sélectionnée par la variable d'environnement LANG. La variable LANG est composée de plusieurs parties. La première partie est le code de la langue en minuscules. La deuxième partie est le code du pays en majuscules précédé d'un souligné. Elle est facultative. Il y a aussi une troisième partie facultative qui est le codage des caractères précédé par un point. Voici quelques exemples pour un shell au standard POSIX:" #. type: verbatim #: dos2unix.pod:748 #, no-wrap msgid "" " export LANG=nl Dutch\n" " export LANG=nl_NL Dutch, The Netherlands\n" " export LANG=nl_BE Dutch, Belgium\n" " export LANG=es_ES Spanish, Spain\n" " export LANG=es_MX Spanish, Mexico\n" " export LANG=en_US.iso88591 English, USA, Latin-1 encoding\n" " export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding\n" "\n" msgstr "" " export LANG=fr Français\n" " export LANG=fr_CA Français, Canada\n" " export LANG=fr_BE Français, Belgique\n" " export LANG=es_ES Espagnol, Espagne\n" " export LANG=es_MX Espagnol, Mexique\n" " export LANG=en_US.iso88591 Anglais, USA, codage Latin-1\n" " export LANG=en_GB.UTF-8 Anglais, UK, codage UTF-8\n" "\n" #. type: textblock #: dos2unix.pod:756 msgid "For a complete list of language and country codes see the gettext manual: L" msgstr "La liste complète des codes de langues et de pays est dans le manuel de gettext: L" #. type: textblock #: dos2unix.pod:759 msgid "On Unix systems you can use the command locale(1) to get locale specific information." msgstr "Sur les systèmes Unix, vous pouvez utiliser la commande locale(1) pour obtenir des informations sur l'environnement linguistique." #. type: =item #: dos2unix.pod:762 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:764 msgid "With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than \"C\", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L" msgstr "Avec la variable d'environnement LANGUAGE, vous pouvez spécifier une liste de langues prioritaires séparées par des deux-points. Dos2unix fait passer LANGUAGE avant LANG. Par exemple, pour utiliser le français avant l'anglais: C. Vous devez d'abord activer l'environnement linguistique en assignant une valeur autre que « C » à LANG (ou LC_ALL). Ensuite, vous pourrez utiliser la liste de priorité avec la variable LANGUAGE. Voyez également le manuel de gettext: L" #. type: textblock #: dos2unix.pod:772 msgid "If you select a language which is not available you will get the standard English messages." msgstr "Si vous sélectionnez une langue qui n'est pas disponible, vous obtiendrez des messages en anglais standard." #. type: =item #: dos2unix.pod:776 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:778 msgid "With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used." msgstr "Grâce à la variable d'environnement DOS2UNIX_LOCALEDIR, la variable LOCALEDIR compilée dans l'application peut être remplacée. LOCALEDIR est utilisée pour trouver les fichiers de langue. La valeur par défaut de GNU est C. L'option B<--version> affiche la valeur de LOCALEDIR utilisée." #. type: textblock #: dos2unix.pod:783 msgid "Example (POSIX shell):" msgstr "Exemple (shell POSIX):" #. type: verbatim #: dos2unix.pod:785 #, no-wrap msgid "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" msgstr "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" #. type: =head1 #: dos2unix.pod:790 msgid "RETURN VALUE" msgstr "VALEUR DE RETOUR" #. type: textblock #: dos2unix.pod:792 msgid "On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned." msgstr "Zéro est retourné en cas de succès. Si une erreur système se produit, la dernière erreur système est retournée. Pour les autres erreurs, 1 est renvoyé." #. type: textblock #: dos2unix.pod:795 msgid "The return value is always zero in quiet mode, except when wrong command-line options are used." msgstr "La valeur de sortie est toujours zéro en mode silencieux sauf quand de mauvaises options sont utilisées sur la ligne de commande." #. type: =head1 #: dos2unix.pod:798 msgid "STANDARDS" msgstr "STANDARDS" #. type: textblock #: dos2unix.pod:800 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:802 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:804 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:806 msgid "L" msgstr "L" #. type: =head1 #: dos2unix.pod:808 msgid "AUTHORS" msgstr "AUTEURS" #. type: textblock #: dos2unix.pod:810 msgid "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer)" msgstr "Benjamin Lin - , Bernd Johannes Wuebben (mode mac2unix) - , Christian Wurll (ajout de saut de ligne supplémentaire) - , Erwin Waterlander - (Mainteneur)" #. type: textblock #: dos2unix.pod:815 msgid "Project page: L" msgstr "Page du projet: L" #. type: textblock #: dos2unix.pod:817 msgid "SourceForge page: L" msgstr "Page SourceForge: L" #. type: =head1 #: dos2unix.pod:819 msgid "SEE ALSO" msgstr "VOIR AUSSI" #. type: textblock #: dos2unix.pod:821 msgid "file(1) find(1) iconv(1) locale(1) xargs(1)" msgstr "file(1) find(1) iconv(1) locale(1) xargs(1)" #~ msgid "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgstr "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgid "Freecode: L" #~ msgstr "Freecode: L" #~ msgid "The Windows versions of dos2unix and unix2dos convert UTF-16 encoded files always to UTF-8 encoded files. Unix versions of dos2unix/unix2dos convert UTF-16 encoded files to the locale character encoding when it is set to UTF-8. Use the locale(1) command to find out what the locale character encoding is." #~ msgstr "Les versions Windows de dos2unix et unix2dos convertissent toujours les fichiers UTF-16 en fichiers UTF-8. Les versions Unix de dos2unix/unix2dos convertissent les fichiers UTF-16 vers le codage de l'environnement linguistique quand il est en UTF-8. Utilisez la commande locale(1) pour connaître le codage de l'environnement linguistique en vigueur." #~ msgid "Because UTF-8 formatted text files are well supported on both Windows and Unix, dos2unix and unix2dos have no option to write UTF-16 files. All UTF-16 characters can be encoded in UTF-8. Conversion from UTF-16 to UTF-8 is without loss. UTF-16 files will be skipped on Unix when the locale character encoding is not UTF-8, to prevent accidental loss of text. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." #~ msgstr "Puisque les fichiers textes au format UTF-8 sont bien supportés sous Windows et Unix, dos2unix et unix2dos n'ont pas d'option pour écrire des fichiers UTF-16. Tous les caractères UTF-16 peuvent être codés en UTF-8. La conversion de UTF-16 vers UTF-8 est sans perte. Les fichiers UTF-16 seront ignorés sous Unix quand l'encodage des caractères de l'environnement linguistique n'est pas UTF-8 pour éviter la perte accidentelle du texte. Quand une conversion de UTF-16 vers UTF-8 échoue, par exemple parce que le fichier d'entrée UTF-16 contient des erreurs, le fichier est ignoré." #~ msgid "Dos2unix never writes a BOM in the output file, unless you use option C<-m>." #~ msgstr "Dos2unix n'écrit jamais de BOM dans le fichier de sortie à moins que vous utilisiez l'option C<-m>." #~ msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris and has similar conversion modes." #~ msgstr "Dos2unix a été conçu comme dos2unix sous SunOS/Solaris et a des modes de conversions similaires." #~ msgid "Conversion modes I, I<7bit>, and I are similar to those of dos2unix/unix2dos under SunOS/Solaris." #~ msgstr "Les modes de conversion I, I<7bit> et I sont similaires à ceux de dos2unix/unix2dos sous SunOS/Solaris." dos2unix-7.3.4/po-man/nl.po0000644000175500010010000020303612721132543014713 0ustar waterlanGeen# Dutch translations for the dos2unix man page. # Copyright (C) 2016 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # # “Hm! I can see those old men shake their heads.” # # Erwin Waterlander , 2014. # Benno Schulenberg , 2014, 2015, 2016. msgid "" msgstr "" "Project-Id-Version: dos2unix-man-7.3.3-beta9\n" "POT-Creation-Date: 2016-02-11 20:33+0100\n" "PO-Revision-Date: 2016-02-08 17:33+0100\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Dutch \n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. type: =head1 #: dos2unix.pod:52 msgid "NAME" msgstr "NAAM" #. type: textblock #: dos2unix.pod:54 msgid "dos2unix - DOS/Mac to Unix and vice versa text file format converter" msgstr "dos2unix - omzetter van tekstbestandsindelingen, van DOS/Mac naar Unix en vice versa" #. type: =head1 #: dos2unix.pod:56 msgid "SYNOPSIS" msgstr "OVERZICHT" #. type: verbatim #: dos2unix.pod:58 #, no-wrap msgid "" " dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]\n" " unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]\n" "\n" msgstr "" " dos2unix [opties] [BESTAND ...] [-n INVOERBESTAND UITVOERBESTAND ...]\n" " unix2dos [opties] [BESTAND ...] [-n INVOERBESTAND UITVOERBESTAND ...]\n" "\n" #. type: =head1 #: dos2unix.pod:61 msgid "DESCRIPTION" msgstr "BESCHRIJVING" #. type: textblock #: dos2unix.pod:63 msgid "The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa." msgstr "Het Dos2unix pakket bevat de toepassingen C en C om platte tekstbestanden in DOS- of Mac-indeling naar Unix-indeling om te zetten, en vice versa." #. type: textblock #: dos2unix.pod:66 msgid "In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks." msgstr "In DOS/Windows-tekstbestanden bestaat een regeleinde uit een combinatie van twee tekens: een 'Carriage Return' (CR) gevolgd door een 'Line Feed' (LF). In Unix-tekstbestanden bestaat een regeleinde uit één enkel 'Newline'-teken, dat gelijk is aan een DOS 'Line Feed'-teken (LF). In Mac-tekstbestanden, van vóór Mac OS X, bestaan regeleindes uit één enkel 'Carriage Return'-teken. Mac OS X is op Unix gebaseerd en heeft dezelfde regeleindes als Unix." #. type: textblock #: dos2unix.pod:72 msgid "Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files." msgstr "Naast regeleindes kan Dos2unix ook de codering van bestanden converteren. Enkele DOS-codetabellen kunnen omgezet worden naar Unix Latin-1. En Windows Unicode-bestanden (UTF-16) kunnen geconverteerd worden naar Unix Unicode-bestanden (UTF-8)." #. type: textblock #: dos2unix.pod:76 msgid "Binary files are automatically skipped, unless conversion is forced." msgstr "Binaire bestanden worden automatisch overgeslagen, behalve als de omzetting geforceerd wordt." #. type: textblock #: dos2unix.pod:78 msgid "Non-regular files, such as directories and FIFOs, are automatically skipped." msgstr "Niet-reguliere bestanden, zoals mappen en FIFO's, worden automatisch overgeslagen." #. type: textblock #: dos2unix.pod:80 msgid "Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows." msgstr "Symbolische koppelingen en hun doelen blijven standaard onaangeroerd. Optioneel kunnen symbolische koppelingen worden vervangen, of de uitvoer kan naar het doel van de symbolische koppeling worden geschreven. Op Windows wordt het schrijven naar het doel van een symbolische koppeling niet ondersteund." #. type: textblock #: dos2unix.pod:84 msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion." msgstr "Dos2unix is gemodelleerd naar dos2unix op SunOS/Solaris, maar er is een belangrijk verschil: deze versie van dos2unix voert standaard een vervangende conversie uit (oud-bestand-modus) terwijl de oorspronkelijke SunOS/Solaris-versie alleen de gepaarde conversie (nieuw-bestand-modus) kent. Zie ook de opties C<-o> en C<-n>. Een ander verschil is dat de SunOS/Solaris-versie standaard een conversie in I-modus doet terwijl deze versie standaard I-modus gebruikt." #. type: =head1 #: dos2unix.pod:92 msgid "OPTIONS" msgstr "OPTIES" #. type: =item #: dos2unix.pod:96 msgid "B<-->" msgstr "B<-->" #. type: textblock #: dos2unix.pod:98 msgid "Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named \"-foo\", you can use this command:" msgstr "Alle volgende opties als bestandsnamen behandelen. Gebruik deze optie als u een bestand wilt converteren waarvan de naam met een streepje begint. Bijvoorbeeld, om een bestand genaamd \"-foo\" om te zetten, gebruikt u de volgende opdracht:" #. type: verbatim #: dos2unix.pod:102 #, no-wrap msgid "" " dos2unix -- -foo\n" "\n" msgstr "" " dos2unix -- -foo\n" "\n" #. type: textblock #: dos2unix.pod:104 msgid "Or in new file mode:" msgstr "Of in nieuw-bestand-modus:" #. type: verbatim #: dos2unix.pod:106 #, no-wrap msgid "" " dos2unix -n -- -foo out.txt\n" "\n" msgstr "" " dos2unix -n -- -foo uit.txt\n" "\n" #. type: =item #: dos2unix.pod:108 msgid "B<-ascii>" msgstr "B<-ascii>" #. type: textblock #: dos2unix.pod:110 msgid "Convert only line breaks. This is the default conversion mode." msgstr "Alleen regeleindes converteren. Dit is de standaardconversiemodus." #. type: =item #: dos2unix.pod:112 msgid "B<-iso>" msgstr "B<-iso>" #. type: textblock #: dos2unix.pod:114 msgid "Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES." msgstr "Conversie tussen de tekensets DOS en ISO-8859-1. Zie ook de sectie B." #. type: =item #: dos2unix.pod:117 msgid "B<-1252>" msgstr "B<-1252>" #. type: textblock #: dos2unix.pod:119 msgid "Use Windows code page 1252 (Western European)." msgstr "Windows-codetabel 1252 (West-Europees) gebruiken." #. type: =item #: dos2unix.pod:121 msgid "B<-437>" msgstr "B<-437>" #. type: textblock #: dos2unix.pod:123 msgid "Use DOS code page 437 (US). This is the default code page used for ISO conversion." msgstr "DOS-codetabel 437 (VS) gebruiken. Dit is de standaard codetabel die gebruikt wordt bij ISO-conversie." #. type: =item #: dos2unix.pod:125 msgid "B<-850>" msgstr "B<-850>" #. type: textblock #: dos2unix.pod:127 msgid "Use DOS code page 850 (Western European)." msgstr "DOS-codetabel 850 (West-Europees) gebruiken." #. type: =item #: dos2unix.pod:129 msgid "B<-860>" msgstr "B<-860>" #. type: textblock #: dos2unix.pod:131 msgid "Use DOS code page 860 (Portuguese)." msgstr "DOS-codetabel 860 (Portugees) gebruiken." #. type: =item #: dos2unix.pod:133 msgid "B<-863>" msgstr "B<-863>" #. type: textblock #: dos2unix.pod:135 msgid "Use DOS code page 863 (French Canadian)." msgstr "DOS-codetabel 863 (Canadees Frans) gebruiken." #. type: =item #: dos2unix.pod:137 msgid "B<-865>" msgstr "B<-865>" #. type: textblock #: dos2unix.pod:139 msgid "Use DOS code page 865 (Nordic)." msgstr "DOS-codetabel 865 (Scandinavisch) gebruiken." #. type: =item #: dos2unix.pod:141 msgid "B<-7>" msgstr "B<-7>" #. type: textblock #: dos2unix.pod:143 msgid "Convert 8 bit characters to 7 bit space." msgstr "Lettertekens met het achtste bit gezet converteren naar spaties." #. type: =item #: dos2unix.pod:145 msgid "B<-b, --keep-bom>" msgstr "B<-b>, B<--keep-bom>" #. type: textblock #: dos2unix.pod:147 msgid "Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option C<-r>." msgstr "Een Byte-Order-Mark (BOM) behouden. Als het invoerbestand een BOM bevat, dan wordt ook een BOM naar het uitvoerbestand geschreven. Dit is het standaardgedrag bij conversie naar DOS. Zie ook optie C<-r>." #. type: =item #: dos2unix.pod:151 msgid "B<-c, --convmode CONVMODE>" msgstr "B<-c>, B<--convmode CONVERSIEMODUS>" #. type: textblock #: dos2unix.pod:153 msgid "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default." msgstr "De te gebruiken conversiemodus. CONVERSIEMODUS kan zijn: I, I<7bit>, I, of I, waarbij ascii de standaardinstelling is." #. type: =item #: dos2unix.pod:157 msgid "B<-D, --display-enc ENCODING>" msgstr "B<-D>, B<--display-enc CODERING>" #. type: textblock #: dos2unix.pod:159 msgid "Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default." msgstr "De te gebruiken tekencodering voor weergegeven tekst. CODERING kan zijn: I, I, I, I, of I, waarbij ansi de standaardinstelling is." #. type: textblock #: dos2unix.pod:163 msgid "This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed." msgstr "Deze optie is alleen beschikbaar in dos2unix voor Windows met Unicode-bestandsnaam-ondersteuning. Deze optie heeft geen effect op de gelezen en geschreven bestandsnamen, maar alleen op hoe deze weergegeven worden." #. type: textblock #: dos2unix.pod:167 msgid "There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages." msgstr "" #. type: =item #: dos2unix.pod:173 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:175 msgid "Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page." msgstr "" #. type: textblock #: dos2unix.pod:181 msgid "The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK." msgstr "" #. type: =item #: dos2unix.pod:186 msgid "B" msgstr "B, B" #. type: textblock #: dos2unix.pod:188 msgid "The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it." msgstr "" #. type: textblock #: dos2unix.pod:194 msgid "When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font." msgstr "" #. type: textblock #: dos2unix.pod:197 msgid "The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program." msgstr "" #. type: textblock #: dos2unix.pod:200 msgid "When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "" #. type: =item #: dos2unix.pod:205 msgid "B" msgstr "B, B" #. type: textblock #: dos2unix.pod:207 msgid "The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding." msgstr "" #. type: textblock #: dos2unix.pod:211 msgid "The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed." msgstr "" #. type: textblock #: dos2unix.pod:217 msgid "In a ConEmu console the utf8 encoding method works well." msgstr "" #. type: textblock #: dos2unix.pod:219 msgid "When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "" #. type: textblock #: dos2unix.pod:226 msgid "The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C." msgstr "" #. type: =item #: dos2unix.pod:229 msgid "B<-f, --force>" msgstr "B<-f>, B<--force>" #. type: textblock #: dos2unix.pod:231 msgid "Force conversion of binary files." msgstr "Conversie van binaire bestanden afdwingen." #. type: =item #: dos2unix.pod:233 msgid "B<-gb, --gb18030>" msgstr "B<-gb>, B<--gb18030>" #. type: textblock #: dos2unix.pod:235 msgid "On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030." msgstr "Op Windows worden UTF-16-bestanden standaard naar UTF-8 geconverteerd, ongeacht de ingestelde taalregio. Gebruik deze optie om UTF-16-bestanden naar GB18030 te converteren. Deze optie is alleen beschikbaar op Windows. Zie ook de sectie B." #. type: =item #: dos2unix.pod:239 msgid "B<-h, --help>" msgstr "B<-h>, B<--help>" #. type: textblock #: dos2unix.pod:241 msgid "Display help and exit." msgstr "Een hulptekst tonen." #. type: =item #: dos2unix.pod:243 msgid "B<-i[FLAGS], --info[=FLAGS] FILE ...>" msgstr "B<-i>[B], B<--info>[B<=VLAGGEN>] B..." #. type: textblock #: dos2unix.pod:245 msgid "Display file information. No conversion is done." msgstr "Bestandsinformatie tonen. Er wordt niets geconverteerd." #. type: textblock #: dos2unix.pod:247 msgid "The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name." msgstr "De volgende informatie wordt weergegeven, in deze volgorde: het aantal DOS-regeleindes, het aantal Unix-regeleindes, het aantal Mac-regeleindes, de Byte-Order-Mark, of het een tekst- of binair bestand is, en de bestandsnaam." #. type: textblock #: dos2unix.pod:251 msgid "Example output:" msgstr "Voorbeelduitvoer:" #. type: verbatim #: dos2unix.pod:253 #, no-wrap msgid "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" msgstr "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" #. type: textblock #: dos2unix.pod:262 msgid "Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>." msgstr "Merk op dat een binair bestand soms voor een tekstbestand aangezien kan worden. Zie ook optie C<-s>." #. type: textblock #: dos2unix.pod:264 msgid "Optionally extra flags can be set to change the output. One or more flags can be added." msgstr "Bij de optie kunnen één of meer vlaggen meegegeven worden om de uitvoer te beperken." #. type: =item #: dos2unix.pod:269 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:271 msgid "Print number of DOS line breaks." msgstr "Het aantal DOS-regeleindes tonen." #. type: =item #: dos2unix.pod:273 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:275 msgid "Print number of Unix line breaks." msgstr "Het aantal Unix-regeleindes tonen." #. type: =item #: dos2unix.pod:277 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:279 msgid "Print number of Mac line breaks." msgstr "Het aantal Mac-regeleindes tonen." #. type: =item #: dos2unix.pod:281 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:283 msgid "Print the byte order mark." msgstr "De Byte-Order-Mark tonen." #. type: =item #: dos2unix.pod:285 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:287 msgid "Print if file is text or binary." msgstr "Tonen of het bestand tekst is of binair." #. type: =item #: dos2unix.pod:289 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:291 msgid "Print only the files that would be converted." msgstr "Alleen de namen tonen van de bestanden die geconverteerd zouden worden." #. type: textblock #: dos2unix.pod:293 msgid "With the C flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks." msgstr "Met de vlag C toont dos2unix alleen de bestanden die DOS-regeleindes bevatten, en unix2dos alleen de bestanden die Unix-regeleindes bevatten." #. type: =item #: dos2unix.pod:296 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:298 msgid "Print a header." msgstr "Een kopregel printen." #. type: =item #: dos2unix.pod:300 msgid "B

" msgstr "B

" #. type: textblock #: dos2unix.pod:302 msgid "Show file names without path." msgstr "Bestandsnamen tonen zonder pad." #. type: textblock #: dos2unix.pod:306 msgid "Examples:" msgstr "Voorbeelden:" #. type: textblock #: dos2unix.pod:308 msgid "Show information for all *.txt files:" msgstr "Informatie weergeven voor alle bestanden met de extensie 'txt':" #. type: verbatim #: dos2unix.pod:310 #, no-wrap msgid "" " dos2unix -i *.txt\n" "\n" msgstr "" " dos2unix -i *.txt\n" "\n" #. type: textblock #: dos2unix.pod:312 msgid "Show only the number of DOS line breaks and Unix line breaks:" msgstr "Alleen de aantallen DOS-regeleindes en Unix-regeleindes tonen:" #. type: verbatim #: dos2unix.pod:314 #, no-wrap msgid "" " dos2unix -idu *.txt\n" "\n" msgstr "" " dos2unix -idu *.txt\n" "\n" #. type: textblock #: dos2unix.pod:316 msgid "Show only the byte order mark:" msgstr "Alleen de Byte-Order-Mark tonen:" #. type: verbatim #: dos2unix.pod:318 #, no-wrap msgid "" " dos2unix --info=b *.txt\n" "\n" msgstr "" " dos2unix --info=b *.txt\n" "\n" #. type: textblock #: dos2unix.pod:320 msgid "List the files that have DOS line breaks:" msgstr "De bestanden opsommen die DOS-regeleindes bevatten:" #. type: verbatim #: dos2unix.pod:322 #, no-wrap msgid "" " dos2unix -ic *.txt\n" "\n" msgstr "" " dos2unix -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:324 msgid "List the files that have Unix line breaks:" msgstr "De bestanden opsommen die Unix-regeleindes bevatten:" #. type: verbatim #: dos2unix.pod:326 #, no-wrap msgid "" " unix2dos -ic *.txt\n" "\n" msgstr "" " unix2dos -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:328 msgid "Convert only files that have DOS line breaks and leave the other files untouched:" msgstr "Alleen bestanden die DOS-regeleindes bevatten converteren en andere bestanden ongemoeid laten:" #. type: verbatim #: dos2unix.pod:330 #, no-wrap msgid "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:332 msgid "Find text files that have DOS line breaks:" msgstr "De bestanden vinden die DOS-regeleindes bevatten:" #. type: verbatim #: dos2unix.pod:334 #, no-wrap msgid "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" msgstr "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" #. type: =item #: dos2unix.pod:336 msgid "B<-k, --keepdate>" msgstr "B<-k>, B<--keepdate>" #. type: textblock #: dos2unix.pod:338 msgid "Keep the date stamp of output file same as input file." msgstr "Het tijdsstempel van het invoerbestand behouden voor het uitvoerbestand." #. type: =item #: dos2unix.pod:340 msgid "B<-L, --license>" msgstr "B<-L>, B<--license>" #. type: textblock #: dos2unix.pod:342 msgid "Display program's license." msgstr "De softwarelicentie tonen." #. type: =item #: dos2unix.pod:344 msgid "B<-l, --newline>" msgstr "B<-l>, B<--newline>" #. type: textblock #: dos2unix.pod:346 msgid "Add additional newline." msgstr "Een extra regeleinde toevoegen." #. type: textblock #: dos2unix.pod:348 msgid "B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks." msgstr "B: Alleen DOS-regeleindes worden omgezet naar twee Unix-regeleindes. In Mac-modus worden alleen Mac-regeleindes omgezet naar twee Unix-regeleindes." #. type: textblock #: dos2unix.pod:352 msgid "B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks." msgstr "B: Alleen Unix-regeleindes worden omgezet naar twee DOS-regeleindes. In Mac-modus worden Unix-regeleindes omgezet naar twee Mac-regeleindes." #. type: =item #: dos2unix.pod:355 msgid "B<-m, --add-bom>" msgstr "B<-m>, B<--add-bom>" #. type: textblock #: dos2unix.pod:357 msgid "Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written." msgstr "Een Byte-Order-Mark (BOM) naar het uitvoerbestand schrijven. Standaard wordt een UTF-8-BOM geschreven." #. type: textblock #: dos2unix.pod:360 msgid "When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM will be written." msgstr "Als het invoerbestand in UTF-16 is, en de optie C<-u> is gegeven, dan wordt een UTF-16-BOM geschreven." #. type: textblock #: dos2unix.pod:363 msgid "Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE." msgstr "Gebruik deze optie nooit als de codering van het uitvoerbestand niet UTF-8, UTF-16, of GB18030 is. Zie ook de sectie B." #. type: =item #: dos2unix.pod:367 msgid "B<-n, --newfile INFILE OUTFILE ...>" msgstr "B<-n>, B<--newfile INVOERBESTAND UITVOERBESTAND> ..." #. type: textblock #: dos2unix.pod:369 msgid "New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files." msgstr "Nieuw-bestand-modus. Het bestand INVOERBESTAND converteren en naar bestand UITVOERBESTAND schrijven. Bestandsnamen moeten opgegeven worden in paren. Jokertekens moeten Igebruikt worden, anders I je de bestanden." #. type: textblock #: dos2unix.pod:373 msgid "The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion." msgstr "De gebruiker die de conversie start in nieuw-bestand (gepaarde) modus wordt de eigenaar van het geconverteerde bestand. De lees/schrijf-toegangsrechten van het nieuwe bestand worden de toegangsrechten van het originele bestand minus de umask(1) van de gebruiker die de conversie draait." #. type: =item #: dos2unix.pod:378 msgid "B<-o, --oldfile FILE ...>" msgstr "B<-o>, B<--oldfile BESTAND> ..." #. type: textblock #: dos2unix.pod:380 msgid "Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used." msgstr "Oud-bestand-modus. Het bestand BESTAND converteren en overschrijven. Dit is de standaard modus. Jokertekens kunnen gebruikt worden." #. type: textblock #: dos2unix.pod:383 msgid "In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix." msgstr "In oud-bestand (vervangende) modus krijgt het geconverteerde bestand dezelfde eigenaar, groep en lees/schrijf-rechten als het originele bestand. Ook wanneer het bestand wordt omgezet door een andere gebruiker die schrijfrechten heeft op het bestand (b.v. gebruiker root). De omzetting wordt afgebroken wanneer het niet mogelijk is de originele waardes te behouden. Verandering van eigenaar kan betekenen dat de originele eigenaar het bestand niet meer kan lezen. Verandering van groep zou een veiligheidsrisico kunnen zijn, het bestand zou leesbaar kunnen worden voor personen voor wie het niet bestemd is. Behoud van eigenaar, groep en lees/schrijf-rechten wordt alleen ondersteund op Unix." #. type: =item #: dos2unix.pod:392 msgid "B<-q, --quiet>" msgstr "B<-q>, B<--quiet>" #. type: textblock #: dos2unix.pod:394 msgid "Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used." msgstr "Stille werking. Alle waarschuwingen onderdrukken. De afsluitwaarde is nul, behalve wanneer verkeerde opties worden gegeven." #. type: =item #: dos2unix.pod:397 msgid "B<-r, --remove-bom>" msgstr "B<-r>, B<--remove-bom>" #. type: textblock #: dos2unix.pod:399 msgid "Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option C<-b>." msgstr "Een Byte-Order-Mark (BOM) verwijderen. Er wordt geen BOM naar het uitvoerbestand geschreven. Dit is het standaardgedrag bij conversie naar Unix. Zie ook optie C<-b>." #. type: =item #: dos2unix.pod:403 msgid "B<-s, --safe>" msgstr "B<-s>, B<--safe>" #. type: textblock #: dos2unix.pod:405 msgid "Skip binary files (default)." msgstr "Binaire bestanden overslaan (standaard)." #. type: textblock #: dos2unix.pod:407 msgid "The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file." msgstr "Binaire bestanden worden overgeslagen om vergissingen te voorkomen. Het detecteren van binaire bestanden is echter niet 100% betrouwbaar. Invoerbestanden worden gescand op binaire tekens die gewoonlijk niet in tekstbestanden voorkomen. Maar het is mogelijk dat een binair bestand enkel normale teksttekens bevat. Zo'n binair bestand zal dan foutief als een tekstbestand gezien worden." #. type: =item #: dos2unix.pod:413 msgid "B<-u, --keep-utf16>" msgstr "B<-u>, B<--keep-utf16>" #. type: textblock #: dos2unix.pod:415 msgid "Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the C<-ascii> option." msgstr "De originele UTF-16-codering van het invoerbestand behouden. Het uitvoerbestand wordt in dezelfde UTF-16-codering (little endian of big endian) geschreven als het invoerbestand. Dit voorkomt conversie naar UTF-8. Er wordt ook een corresponderende UTF-16-BOM geschreven. Deze optie kan uitgeschakeld worden met de optie C<-ascii>." #. type: =item #: dos2unix.pod:420 msgid "B<-ul, --assume-utf16le>" msgstr "B<-ul>, B<--assume-utf16le>" #. type: textblock #: dos2unix.pod:422 msgid "Assume that the input file format is UTF-16LE." msgstr "Veronderstellen dat de indeling van het invoerbestand UTF-16LE is." #. type: textblock #: dos2unix.pod:424 msgid "When there is a Byte Order Mark in the input file the BOM has priority over this option." msgstr "Wanneer het invoerbestand een Byte-Order-Mark (BOM) bevat, dan gaat deze BOM vóór deze optie." #. type: textblock #: dos2unix.pod:427 msgid "When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file." msgstr "Wanneer een verkeerde aanname is gemaakt (het invoerbestand was geen UTF-16LE) en de conversie verliep met succes, dan krijgt u een UTF-8-bestand met verkeerde tekst. De verkeerde conversie kan ongedaan worden gemaakt door met iconv(1) het UTF-8-uitvoerbestand terug om te zetten naar UTF-16LE. Dit zal het originele bestand terug brengen." #. type: textblock #: dos2unix.pod:432 msgid "The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off." msgstr "De aanname van UTF-16LE werkt als een I. Door de standaardmodus I in te schakelen wordt de UTF-16LE-veronderstelling uitgeschakeld." #. type: =item #: dos2unix.pod:435 msgid "B<-ub, --assume-utf16be>" msgstr "B<-ub>, B<--assume-utf16be>" #. type: textblock #: dos2unix.pod:437 msgid "Assume that the input file format is UTF-16BE." msgstr "Veronderstellen dat de indeling van het invoerbestand UTF-16BE is." #. type: textblock #: dos2unix.pod:439 msgid "This option works the same as option C<-ul>." msgstr "Deze optie werkt hetzelfde als optie C<-ul>." #. type: =item #: dos2unix.pod:441 msgid "B<-v, --verbose>" msgstr "B<-v>, B<--verbose>" #. type: textblock #: dos2unix.pod:443 msgid "Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks." msgstr "Extra meldingen weergeven. Er wordt extra informatie getoond over Byte-Order-Marks en het aantal geconverteerde regeleindes." #. type: =item #: dos2unix.pod:446 msgid "B<-F, --follow-symlink>" msgstr "B<-F>, B<--follow-symlink>" #. type: textblock #: dos2unix.pod:448 msgid "Follow symbolic links and convert the targets." msgstr "Symbolische koppelingen volgen en de doelen converteren." #. type: =item #: dos2unix.pod:450 msgid "B<-R, --replace-symlink>" msgstr "B<-R>, B<--replace-symlink>" #. type: textblock #: dos2unix.pod:452 msgid "Replace symbolic links with converted files (original target files remain unchanged)." msgstr "Symbolische koppelingen vervangen door geconverteerde bestanden (de originele doelbestanden blijven ongewijzigd)." #. type: =item #: dos2unix.pod:455 msgid "B<-S, --skip-symlink>" msgstr "B<-S>, B<--skip-symlink>" #. type: textblock #: dos2unix.pod:457 msgid "Keep symbolic links and targets unchanged (default)." msgstr "Symbolische koppelingen en doelen ongewijzigd laten (standaard)." #. type: =item #: dos2unix.pod:459 msgid "B<-V, --version>" msgstr "B<-V>, B<--version>" #. type: textblock #: dos2unix.pod:461 msgid "Display version information and exit." msgstr "Versie-informatie tonen." #. type: =head1 #: dos2unix.pod:465 msgid "MAC MODE" msgstr "MAC-MODUS" #. type: textblock #: dos2unix.pod:467 msgid "In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted." msgstr "In normale modus worden DOS-regeleindes naar Unix omgezet en vice versa. Mac-regeleindes worden niet omgezet." #. type: textblock #: dos2unix.pod:470 msgid "In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed." msgstr "In Mac-modus worden Mac-regeleindes naar Unix omgezet en vice versa. DOS-regeleindes blijven ongewijzigd." #. type: textblock #: dos2unix.pod:473 msgid "To run in Mac mode use the command-line option C<-c mac> or use the commands C or C." msgstr "Om in Mac-modus te draaien kunt u de opdrachtregeloptie C<-c mac> gebruiken, of de opdrachten C of C." #. type: =head1 #: dos2unix.pod:476 msgid "CONVERSION MODES" msgstr "CONVERSIEMODI" #. type: =item #: dos2unix.pod:480 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:482 msgid "In mode C only line breaks are converted. This is the default conversion mode." msgstr "In modus C worden alleen regeleindes omgezet. Dit is de standaardmodus." #. type: textblock #: dos2unix.pod:485 msgid "Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files." msgstr "Hoewel de naam van deze modus ASCII is, wat een 7-bits standaard is, is de werkelijke modus 8-bits. Gebruik altijd deze modus wanneer u Unicode UTF-8-bestanden omzet." #. type: =item #: dos2unix.pod:489 msgid "B<7bit>" msgstr "B<7bit>" #. type: textblock #: dos2unix.pod:491 msgid "In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space." msgstr "Alle 8-bits niet-ASCII lettertekens (met waardes van 128 t/m 255) worden omgezet naar een 7-bits spatie." #. type: =item #: dos2unix.pod:494 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:496 msgid "Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart." msgstr "Tekens worden omgezet tussen een DOS-tekenset (codetabel) en de ISO-tekenset ISO-8859-1 (Latin-1) op Unix. DOS-tekens zonder een ISO-8859-1-equivalent, waarvoor dus geen omzetting mogelijk is, worden omgezet in een punt. Hetzelfde geldt voor ISO-8859-1-tekens zonder DOS-tegenhanger." #. type: textblock #: dos2unix.pod:501 msgid "When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings." msgstr "Wanneer alleen optie C<-iso> gebruikt wordt, zal dos2unix proberen de actieve codetabel te gebruiken. Als dat niet mogelijk is wordt codetabel CP437 gebruikt, die vooral in de VS gebruikt wordt. Om een bepaalde codetabel te forceren, kunt u de opties C<-850> (West-Europees), C<-860> (Portugees), C<-863> (Canadees Frans) of C<-865> (Scandinavisch) gebruiken. Windows-codetabel CP1252 (West-Europees) wordt ook ondersteund met optie C<-1252>. Gebruik voor andere codetabellen dos2unix in combinatie met iconv(1). Iconv kan omzetten tussen een lange lijst tekensetcoderingen." #. type: textblock #: dos2unix.pod:510 msgid "Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files." msgstr "Gebruik ISO-conversie nooit op Unicode-tekstbestanden. Het zal UTF-8-gecodeerde bestanden beschadigen." #. type: textblock #: dos2unix.pod:512 msgid "Some examples:" msgstr "Enkele voorbeelden:" #. type: textblock #: dos2unix.pod:514 msgid "Convert from DOS default code page to Unix Latin-1:" msgstr "Omzetten van de standaard DOS-codetabel naar Unix Latin-1:" #. type: verbatim #: dos2unix.pod:516 #, no-wrap msgid "" " dos2unix -iso -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -iso -n in.txt uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:518 msgid "Convert from DOS CP850 to Unix Latin-1:" msgstr "Omzetten van DOS CP850 naar Unix Latin-1:" #. type: verbatim #: dos2unix.pod:520 #, no-wrap msgid "" " dos2unix -850 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -850 -n in.txt uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:522 msgid "Convert from Windows CP1252 to Unix Latin-1:" msgstr "Omzetten van Windows CP1252 naar Unix Latin-1:" #. type: verbatim #: dos2unix.pod:524 #, no-wrap msgid "" " dos2unix -1252 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -1252 -n in.txt uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:526 msgid "Convert from Windows CP1252 to Unix UTF-8 (Unicode):" msgstr "Omzetten van Windows CP1252 naar Unix UTF-8 (Unicode):" #. type: verbatim #: dos2unix.pod:528 #, no-wrap msgid "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" msgstr "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:530 msgid "Convert from Unix Latin-1 to DOS default code page:" msgstr "Omzetten van Unix Latin-1 naar de standaard DOS-codetabel:" #. type: verbatim #: dos2unix.pod:532 #, no-wrap msgid "" " unix2dos -iso -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -iso -n in.txt uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:534 msgid "Convert from Unix Latin-1 to DOS CP850:" msgstr "Omzetten van Unix Latin-1 naar DOS CP850:" #. type: verbatim #: dos2unix.pod:536 #, no-wrap msgid "" " unix2dos -850 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -850 -n in.txt uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:538 msgid "Convert from Unix Latin-1 to Windows CP1252:" msgstr "Omzetten van Unix Latin-1 naar Windows CP1252:" #. type: verbatim #: dos2unix.pod:540 #, no-wrap msgid "" " unix2dos -1252 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -1252 -n in.txt uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:542 msgid "Convert from Unix UTF-8 (Unicode) to Windows CP1252:" msgstr "Omzetten van Unix UTF-8 (Unicode) naar Windows CP1252:" #. type: verbatim #: dos2unix.pod:544 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:546 msgid "See also L and L." msgstr "Zie ook L en L." #. type: =head1 #: dos2unix.pod:551 msgid "UNICODE" msgstr "UNICODE" #. type: =head2 #: dos2unix.pod:553 msgid "Encodings" msgstr "Coderingen" #. type: textblock #: dos2unix.pod:555 msgid "There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format." msgstr "Er bestaan verschillende Unicode-coderingen. Op Unix en Linux zijn Unicode-bestanden typisch gecodeerd in UTF-8. Op Windows kunnen Unicode-tekstbestanden gecodeerd zijn in UTF-8, UTF-16 of UTF-16 big endian, maar ze zijn meestal gecodeerd in UTF-16." #. type: =head2 #: dos2unix.pod:560 msgid "Conversion" msgstr "Conversie" #. type: textblock #: dos2unix.pod:562 msgid "Unicode text files can have DOS, Unix or Mac line breaks, like regular text files." msgstr "Unicode-tekstbestanden kunnen DOS-, Unix- of Mac-regeleindes hebben, net als reguliere tekstbestanden." #. type: textblock #: dos2unix.pod:565 msgid "All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII." msgstr "Alle versies van dos2unix en unix2dos kunnen UTF-8-gecodeerde bestanden omzetten, want UTF-8 is ontworpen op compatibiliteit met ASCII." #. type: textblock #: dos2unix.pod:568 msgid "Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C." msgstr "Dos2unix en unix2dos met Unicode UTF-16-ondersteuning kunnen little en big endian UTF-16-gecodeerde tekstbestanden lezen. Om er achter te komen of dos2unix gebouwd is met UTF-16- ondersteuning, typt u C." #. type: textblock #: dos2unix.pod:572 msgid "On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped." msgstr "Op Unix/Linux worden UTF-16-bestanden geconverteerd naar de codering van de ingestelde taalregio. Gebruik de opdracht B(1) om te zien wat de ingestelde codering is. Wanneer conversie niet mogelijk is, treedt er een fout op en wordt het bestand overgeslagen." #. type: textblock #: dos2unix.pod:577 msgid "On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux." msgstr "Op Windows worden UTF-16-bestanden standaard naar UTF-8 geconverteerd. UTF-8-tekstbestanden worden alom goed ondersteund, zowel op Windows als Unix/Linux." #. type: textblock #: dos2unix.pod:580 msgid "UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." msgstr "De UTF-16- en UTF-8-coderingen zijn volledig compatibel, er gaat bij het converteren niets verloren. Als er tijdens de conversie van UTF-16 naar UTF-8 een fout optreedt, bijvoorbeeld omdat het UTF-16-invoerbestand een fout bevat, dan wordt het bestand overgeslagen." #. type: textblock #: dos2unix.pod:584 msgid "When option C<-u> is used, the output file will be written in the same UTF-16 encoding as the input file. Option C<-u> prevents conversion to UTF-8." msgstr "Wanneer C<-u> gebruikt wordt, wordt het uitvoerbestand in dezelfde UTF-16-codering geschreven als het invoerbestand. Optie C<-u> voorkomt conversie naar UTF-8." #. type: textblock #: dos2unix.pod:587 msgid "Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16." msgstr "Dos2unix en unix2dos hebben geen optie om van UTF-8 naar UTF-16 te converteren." #. type: textblock #: dos2unix.pod:589 msgid "ISO and 7-bit mode conversion do not work on UTF-16 files." msgstr "ISO- en 7-bits-conversie werken niet op UTF-16-bestanden." #. type: =head2 #: dos2unix.pod:591 msgid "Byte Order Mark" msgstr "Byte-Order-Mark" #. type: textblock #: dos2unix.pod:593 msgid "On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L." msgstr "Op Windows bevatten Unicode-tekstbestanden gewoonlijk een Byte-Order-Mark (BOM), omdat veel Windows-programma's (inclusief Kladblok) standaard een BOM toevoegen. Zie ook L." #. type: textblock #: dos2unix.pod:597 msgid "On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding." msgstr "Op Unix hebben Unicode-tekstbestanden meestal geen BOM. Er wordt aangenomen dat de codering van tekstbestanden gelijk is aan de tekencodering van de ingestelde taalregio." #. type: textblock #: dos2unix.pod:600 msgid "Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file." msgstr "Dos2unix kan alleen detecteren of een bestand in UTF-16-codering is als het bestand een BOM bevat. Wanneer een UTF-16-bestand geen BOM heeft, ziet dos2unix het bestand als een binair bestand." #. type: textblock #: dos2unix.pod:604 msgid "Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM." msgstr "Gebruik optie C<-ul> of C<-ub> om een UTF-16-bestand zonder BOM om te zetten." #. type: textblock #: dos2unix.pod:606 msgid "Dos2unix writes by default no BOM in the output file. With option C<-b> Dos2unix writes a BOM when the input file has a BOM." msgstr "Dos2unix schrijft standaard geen BOM in het uitvoerbestand. Met optie C<-b> schrijft dos2unix een BOM wanneer het invoerbestand een BOM bevat." #. type: textblock #: dos2unix.pod:609 msgid "Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option C<-r> to remove the BOM." msgstr "Unix2dos schrijft standaard een BOM in het uitvoerbestand wanneer het invoerbestand een BOM bevat. Gebruik optie C<-r> om de BOM te verwijderen." #. type: textblock #: dos2unix.pod:612 msgid "Dos2unix and unix2dos write always a BOM when option C<-m> is used." msgstr "Dos2unix en unix2dos schrijven altijd een BOM wanneer optie C<-m> gebruikt wordt." #. type: =head2 #: dos2unix.pod:614 msgid "Unicode file names on Windows" msgstr "Unicode-bestandsnamen op Windows" #. type: textblock #: dos2unix.pod:616 msgid "Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C." msgstr "Dos2unix heeft optionele ondersteuning voor het lezen en schrijven van Unicode-bestandsnamen in de Windows Opdrachtprompt. Dit betekent dat dos2unix bestanden kan openen waarvan de naam tekens bevat die niet voorkomen in de standaard ANSI-codetabel. Om te zien of dos2unix voor Windows gecompileerd werd met ondersteuning voor Unicode-bestandsnamen, typt u C." #. type: textblock #: dos2unix.pod:622 msgid "There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name." msgstr "Er zijn enige problemen met het weergeven van Unicode-bestandsnamen in een Windows-console; zie bij optie C<-D>, C<--display-enc>. De bestandsnamen kunnen verkeerd weergegeven worden, maar de bestanden zullen geschreven worden met de correcte naam." #. type: =head2 #: dos2unix.pod:626 msgid "Unicode examples" msgstr "Unicode-voorbeelden" #. type: textblock #: dos2unix.pod:628 msgid "Convert from Windows UTF-16 (with BOM) to Unix UTF-8:" msgstr "Omzetten van Windows UTF-16 (met BOM) naar Unix UTF-8:" #. type: verbatim #: dos2unix.pod:630 #, no-wrap msgid "" " dos2unix -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -n in.txt uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:632 msgid "Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:" msgstr "Omzetten van Windows UTF-16LE (zonder BOM) naar Unix UTF-8:" #. type: verbatim #: dos2unix.pod:634 #, no-wrap msgid "" " dos2unix -ul -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -ul -n in.txt uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:636 msgid "Convert from Unix UTF-8 to Windows UTF-8 with BOM:" msgstr "Omzetten van Unix UTF-8 naar Windows UTF-8 met BOM:" #. type: verbatim #: dos2unix.pod:638 #, no-wrap msgid "" " unix2dos -m -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -m -n in.txt uit.txt\n" "\n" #. type: textblock #: dos2unix.pod:640 msgid "Convert from Unix UTF-8 to Windows UTF-16:" msgstr "Omzetten van Unix UTF-8 naar Windows UTF-16:" #. type: verbatim #: dos2unix.pod:642 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > uit.txt\n" "\n" #. type: =head1 #: dos2unix.pod:644 msgid "GB18030" msgstr "GB18030" #. type: textblock #: dos2unix.pod:646 msgid "GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also L." msgstr "GB18030 is een standaard van de Chinese overheid. Een subset van de GB18030-standaard is officieel verplicht voor alle softwareproducten die in China verkocht worden. Zie ook L." #. type: textblock #: dos2unix.pod:650 msgid "GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK." msgstr "GB18030 is volledig compatibel met Unicode, en kan als een Unicodetransformatie beschouwd worden. Net als UTF-8 is GB18030 compatibel met ASCII. GB18030 is ook compatibel met Windows-codetabel 936 (ook wel GBK genoemd)." #. type: textblock #: dos2unix.pod:654 msgid "On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command C to get the list of supported locales." msgstr "Op Unix/Linux worden UTF-16-bestanden naar GB18030 geconverteerd wanneer de taalregio-codering GB18030 is. Merk op dat dit alleen werkt als deze taalregio-instelling door het systeem ondersteund wordt. Gebruik het commando C voor een overzicht van de beschikbare taalregio's." #. type: textblock #: dos2unix.pod:658 msgid "On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030." msgstr "Op Windows dient u de optie C<-gb> te gebruiken om UTF-16-bestanden naar GB18030 te converteren." #. type: textblock #: dos2unix.pod:660 msgid "GB18030 encoded files can have a Byte Order Mark, like Unicode files." msgstr "GB18030-bestanden kunnen een Byte-Order-Mark bevatten, net als Unicode-bestanden." #. type: =head1 #: dos2unix.pod:662 msgid "EXAMPLES" msgstr "VOORBEELDEN" #. type: textblock #: dos2unix.pod:664 msgid "Read input from 'stdin' and write output to 'stdout':" msgstr "Invoer lezen van standaardinvoer en uitvoer schrijven naar standaarduitvoer:" #. type: verbatim #: dos2unix.pod:666 #, fuzzy, no-wrap #| msgid "" #| " dos2unix -ic *.txt | xargs dos2unix\n" #| "\n" msgid "" " dos2unix < a.txt\n" " cat a.txt | dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:669 msgid "Convert and replace a.txt. Convert and replace b.txt:" msgstr "Omzetten en vervangen van a.txt; omzetten en vervangen van b.txt:" #. type: verbatim #: dos2unix.pod:671 #, no-wrap msgid "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" msgstr "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" #. type: textblock #: dos2unix.pod:674 msgid "Convert and replace a.txt in ascii conversion mode:" msgstr "Omzetten en vervangen van a.txt in ascii-conversiemodus:" #. type: verbatim #: dos2unix.pod:676 #, no-wrap msgid "" " dos2unix a.txt\n" "\n" msgstr "" " dos2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:678 msgid "Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode:" msgstr "Omzetten en vervangen van a.txt in ascii-conversiemodus; omzetten en vervangen van b.txt in 7-bits conversiemodus:" #. type: verbatim #: dos2unix.pod:681 #, no-wrap msgid "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" msgstr "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" #. type: textblock #: dos2unix.pod:685 msgid "Convert a.txt from Mac to Unix format:" msgstr "Omzetten van a.txt van Mac- naar Unix-indeling:" #. type: verbatim #: dos2unix.pod:687 #, no-wrap msgid "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" msgstr "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:690 msgid "Convert a.txt from Unix to Mac format:" msgstr "Omzetten van a.txt van Unix- naar Mac-indeling:" #. type: verbatim #: dos2unix.pod:692 #, no-wrap msgid "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" msgstr "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" #. type: textblock #: dos2unix.pod:695 msgid "Convert and replace a.txt while keeping original date stamp:" msgstr "Omzetten en vervangen van a.txt met behoud van origineel tijdsstempel:" #. type: verbatim #: dos2unix.pod:697 #, no-wrap msgid "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" msgstr "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" #. type: textblock #: dos2unix.pod:700 msgid "Convert a.txt and write to e.txt:" msgstr "Omzetten van a.txt en resultaat naar e.txt schrijven:" #. type: verbatim #: dos2unix.pod:702 #, no-wrap msgid "" " dos2unix -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:704 msgid "Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:" msgstr "Omzetten van a.txt en naar e.txt schrijven, met tijdsstempel van e.txt gelijk aan die van a.txt:" #. type: verbatim #: dos2unix.pod:706 #, no-wrap msgid "" " dos2unix -k -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -k -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:708 msgid "Convert and replace a.txt, convert b.txt and write to e.txt:" msgstr "Omzetten en vervangen van a.txt; omzetten van b.txt en naar e.txt schrijven:" #. type: verbatim #: dos2unix.pod:710 #, no-wrap msgid "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" msgstr "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:713 msgid "Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt:" msgstr "Omzetten van c.txt en naar e.txt schrijven; omzetten en vervangen van a.txt; omzetten en vervangen van b.txt; omzetten van d.txt en naar f.txt schrijven." #. type: verbatim #: dos2unix.pod:716 #, no-wrap msgid "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" msgstr "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" #. type: =head1 #: dos2unix.pod:718 msgid "RECURSIVE CONVERSION" msgstr "RECURSIEVE CONVERSIE" #. type: textblock #: dos2unix.pod:720 msgid "Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type:" msgstr "Gebruik dos2unix in combinatie met de opdrachten B(1) en B(1) om tekstbestanden in een mappenboom recursief om te zetten. Bijvoorbeeld om alle .txt-bestanden in de mappenboom onder de huidige map te converteren, typt u:" #. type: verbatim #: dos2unix.pod:724 #, no-wrap msgid "" " find . -name '*.txt' |xargs dos2unix\n" "\n" msgstr "" " find . -name '*.txt' | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:726 msgid "In a Windows Command Prompt the following command can be used:" msgstr "In een Windows Opdrachtprompt kan de volgende opdracht gebruikt worden:" #. type: verbatim #: dos2unix.pod:728 #, no-wrap msgid "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" msgstr "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" #. type: textblock #: dos2unix.pod:730 msgid "PowerShell users can use the following command in Windows PowerShell:" msgstr "" #. type: verbatim #: dos2unix.pod:732 #, no-wrap msgid "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" msgstr "" #. type: =head1 #: dos2unix.pod:735 msgid "LOCALIZATION" msgstr "LOKALISATIE" #. type: =item #: dos2unix.pod:739 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:741 msgid "The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:" msgstr "De primaire taal wordt geselecteerd via de omgevingsvariabele LANG. De variabele LANG bestaat uit verschillende onderdelen. Het eerste deel is in kleine letters de taalcode. Het tweede deel is optioneel en is de landcode in hoofdletters, voorafgegaan door een liggend streepje. Er is ook een optioneel derde deel: de tekencodering, voorafgegaan door een punt. Enkele voorbeelden voor een POSIX-shell:" #. type: verbatim #: dos2unix.pod:748 #, no-wrap msgid "" " export LANG=nl Dutch\n" " export LANG=nl_NL Dutch, The Netherlands\n" " export LANG=nl_BE Dutch, Belgium\n" " export LANG=es_ES Spanish, Spain\n" " export LANG=es_MX Spanish, Mexico\n" " export LANG=en_US.iso88591 English, USA, Latin-1 encoding\n" " export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding\n" "\n" msgstr "" " export LANG=nl Nederlands\n" " export LANG=nl_NL Nederlands, Nederland\n" " export LANG=nl_BE Nederlands, België\n" " export LANG=es_ES Spaans, Spanje\n" " export LANG=es_MX Spaans, Mexico\n" " export LANG=en_US.iso88591 Engels, VS, Latin-1-codering\n" " export LANG=en_GB.UTF-8 Engels, GB, UTF-8-codering\n" "\n" #. type: textblock #: dos2unix.pod:756 msgid "For a complete list of language and country codes see the gettext manual: L" msgstr "Voor een complete lijst van taal- en landcodes zie de gettext-handleiding: L" #. type: textblock #: dos2unix.pod:759 msgid "On Unix systems you can use the command locale(1) to get locale specific information." msgstr "Op Unix-systemen kunt u de opdracht B(1) gebruiken om specifieke taalregio-informatie te verkrijgen." #. type: =item #: dos2unix.pod:762 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:764 msgid "With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than \"C\", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L" msgstr "Met de omgevingsvariabele LANGUAGE kunt u een prioriteitenlijst specificeren van talen, gescheiden door dubbele punten. Dos2unix geeft voorrang aan LANGUAGE boven LANG. Bijvoorbeeld, eerst Nederlands en dan Duits: C. U moet eerst lokalisatie in werking stellen, door het instellen van LANG (of LC_ALL) op een waarde ongelijk aan \"C\", voordat u een talen-prioriteitenlijst kunt gebruiken via de variabele LANGUAGE. Zie ook de gettext-handleiding: L" #. type: textblock #: dos2unix.pod:772 msgid "If you select a language which is not available you will get the standard English messages." msgstr "Als u een taal kiest die niet beschikbaar is, worden de standaard Engelse berichten gebruikt." #. type: =item #: dos2unix.pod:776 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:778 msgid "With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used." msgstr "Met de omgevingsvariabele DOS2UNIX_LOCALEDIR kan de LOCALEDIR die ingesteld werd tijdens compilatie worden overstemd. LOCALEDIR wordt gebruikt om de taalbestanden te vinden. De GNU standaardwaarde is C. De optie B<--version> laat de gebruikte LOCALEDIR zien." #. type: textblock #: dos2unix.pod:783 msgid "Example (POSIX shell):" msgstr "Voorbeeld (POSIX-shell):" #. type: verbatim #: dos2unix.pod:785 #, no-wrap msgid "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" msgstr "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" #. type: =head1 #: dos2unix.pod:790 msgid "RETURN VALUE" msgstr "AFSLUITWAARDE" #. type: textblock #: dos2unix.pod:792 msgid "On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned." msgstr "Bij succes wordt nul teruggegeven. Wanneer een systeemfout optreedt wordt het laatste systeemfoutnummer teruggegeven. Bij andere fouten wordt 1 teruggegeven." #. type: textblock #: dos2unix.pod:795 msgid "The return value is always zero in quiet mode, except when wrong command-line options are used." msgstr "De afsluitwaarde is altijd nul in de stillewerkingsmodus, behalve wanneer verkeerde opties worden gegeven." #. type: =head1 #: dos2unix.pod:798 msgid "STANDARDS" msgstr "STANDAARDEN" #. type: textblock #: dos2unix.pod:800 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:802 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:804 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:806 msgid "L" msgstr "" #. type: =head1 #: dos2unix.pod:808 msgid "AUTHORS" msgstr "AUTEURS" #. type: textblock #: dos2unix.pod:810 msgid "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer)" msgstr "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix-modus) - , Christian Wurll (toevoegen van extra regeleindes) - , Erwin Waterlander - (beheerder)" #. type: textblock #: dos2unix.pod:815 msgid "Project page: L" msgstr "Projectpagina: L" #. type: textblock #: dos2unix.pod:817 msgid "SourceForge page: L" msgstr "SourceForge-pagina: L" #. type: =head1 #: dos2unix.pod:819 msgid "SEE ALSO" msgstr "ZIE OOK" #. type: textblock #: dos2unix.pod:821 msgid "file(1) find(1) iconv(1) locale(1) xargs(1)" msgstr "file(1) find(1) iconv(1) locale(1) xargs(1)" #~ msgid "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgstr "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgid "Freecode: L" #~ msgstr "Freecode: L" #~ msgid "The Windows versions of dos2unix and unix2dos convert UTF-16 encoded files always to UTF-8 encoded files. Unix versions of dos2unix/unix2dos convert UTF-16 encoded files to the locale character encoding when it is set to UTF-8. Use the locale(1) command to find out what the locale character encoding is." #~ msgstr "De Windows-versies van dos2unix en unix2dos converteren UTF-16-gecodeerde bestanden altijd naar UTF-8-gecodeerde bestanden. Unix-versies van dos2unix/unix2dos zetten UTF-16-gecodeerde bestanden om naar de lokale tekencodering als die gelijk is aan UTF-8. Gebruik de opdracht locale(1) om uit te vinden wat de lokale tekencodering is." #~ msgid "Because UTF-8 formatted text files are well supported on both Windows and Unix, dos2unix and unix2dos have no option to write UTF-16 files. All UTF-16 characters can be encoded in UTF-8. Conversion from UTF-16 to UTF-8 is without loss. UTF-16 files will be skipped on Unix when the locale character encoding is not UTF-8, to prevent accidental loss of text. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." #~ msgstr "Omdat UTF-8-gecodeerde tekstbestanden zowel op Windows en Unix goed ondersteund worden, hebben dos2unix en unix2dos geen optie om UTF-16-bestanden te schrijven. Alle UTF-16-tekens kunnen worden omgezet naar UTF-8. De omzetting van UTF-16 naar UTF-8 is verliesvrij. Op Unix worden UTF-16-bestanden overgeslagen als de lokale tekencodering ongelijk is aan UTF-8, om te voorkomen dat er per ongeluk tekst verloren gaat. Wanneer een conversiefout van UTF-16 naar UTF-8 optreedt, bijvoorbeeld wanneer het UTF-16-invoerbestand een fout bevat, wordt het bestand overgeslagen." #~ msgid "Dos2unix never writes a BOM in the output file, unless you use option C<-m>." #~ msgstr "Dos2unix schrijft nooit een BOM in het uitvoerbestand, tenzij optie C<-m> gebruikt wordt." #~ msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris and has similar conversion modes." #~ msgstr "Dos2unix is gemodelleerd naar dos2unix onder SunOS/Solaris en heeft vergelijkbare omzettingsmodi." #~ msgid "Conversion modes I, I<7bit>, and I are similar to those of dos2unix/unix2dos under SunOS/Solaris." #~ msgstr "De conversiemodi I, I<7bit>, en I zijn gelijk aan die van dos2unix/unix2dos onder SunOS/Solaris." dos2unix-7.3.4/po-man/pl.po0000644000175500010010000020337412721132543014722 0ustar waterlanGeen# Polish translation for dos2unix man. # This file is distributed under the same license as the dos2unix package. # Jakub Bogusz , 2014-2016. # msgid "" msgstr "" "Project-Id-Version: dos2unix-man 7.3.3-beta9\n" "POT-Creation-Date: 2016-02-11 20:33+0100\n" "PO-Revision-Date: 2016-02-07 21:20+0100\n" "Last-Translator: Jakub Bogusz \n" "Language-Team: Polish \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #. type: =head1 #: dos2unix.pod:52 msgid "NAME" msgstr "NAZWA" #. type: textblock #: dos2unix.pod:54 msgid "dos2unix - DOS/Mac to Unix and vice versa text file format converter" msgstr "dos2unix - konwerter formatu plików tekstowych między systemami DOS/Mac a Uniksem" #. type: =head1 #: dos2unix.pod:56 msgid "SYNOPSIS" msgstr "SKŁADNIA" #. type: verbatim #: dos2unix.pod:58 #, no-wrap msgid "" " dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]\n" " unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]\n" "\n" msgstr "" " dos2unix [opcje] [PLIK ...] [-n PLIK_WEJ PLIK_WYJ ...]\n" " unix2dos [opcje] [PLIK ...] [-n PLIK_WEJ PLIK_WYJ ...]\n" "\n" #. type: =head1 #: dos2unix.pod:61 msgid "DESCRIPTION" msgstr "OPIS" #. type: textblock #: dos2unix.pod:63 msgid "The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa." msgstr "Pakiet Dos2unix zawiera narzędzia C oraz C do konwersji zwykłych plików tekstowych między formatami używanymi w systemach DOS lub Mac a formatem uniksowym." #. type: textblock #: dos2unix.pod:66 msgid "In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks." msgstr "W plikach tekstowych systemu DOS/Windows oznaczenie końca linii to połączenie dwóch znaków: powrotu karetki (CR) i przesunięcia linii (LF). W uniksowych plikach tekstowych koniec linii to pojedynczy znak LF. W plikach tekstowych systemu Mac sprzed Mac OS X koniec linii był pojedynczym znakiem CR. Obecnie Mac OS wykorzystuje uniksowe końce linii (LF)." #. type: textblock #: dos2unix.pod:72 msgid "Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files." msgstr "Oprócz oznaczeń końców linii Dos2unix potrafi konwertować także kodowanie plików. Kilko stron kodowych DOS-a może być przekonwertowanych do uniksowego Latin-1, a windowsowy Unicode (UTF-16) do powszechniejszego pod Uniksem kodowania Unicode UTF-8." #. type: textblock #: dos2unix.pod:76 msgid "Binary files are automatically skipped, unless conversion is forced." msgstr "Pliki binarne są pomijane automatycznie, chyba że konwersja zostanie wymuszona." #. type: textblock #: dos2unix.pod:78 msgid "Non-regular files, such as directories and FIFOs, are automatically skipped." msgstr "Pliki inne niż zwykłe, np. katalogi lub FIFO, są pomijane automatycznie." #. type: textblock #: dos2unix.pod:80 msgid "Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows." msgstr "Dowiązania symboliczne i ich cele są domyślnie pozostawiane bez zmian. Dowiązania symboliczne mogą być opcjonalnie zastępowane, albo wyjście może być zapisywane do celu dowiązania. Zapis do celu dowiązania symbolicznego nie jest obsługiwane pod Windows." #. type: textblock #: dos2unix.pod:84 msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion." msgstr "Dos2unix powstał na podstawie narzędzia dos2unix z systemu SunOS/Solaris. Jest jedna istotna różnica w stosunku do oryginalnej wersji z SunOS-a/Solarisa: ta wersja domyślnie wykonuje konwersję w miejscu (tryb starego pliku), podczas gdy oryginalna obsługiwała tylko konwersję parami (tryb nowego pliku) - p. także opcje C<-o> i C<-n>. Ponadto wersja z SunOS-a/Solarisa domyślnie wykonuje konwersję w trybie I, podczas gdy ta wersja domyślnie wykonuje konwersję w trybie I." #. type: =head1 #: dos2unix.pod:92 msgid "OPTIONS" msgstr "OPCJE" #. type: =item #: dos2unix.pod:96 msgid "B<-->" msgstr "B<-->" #. type: textblock #: dos2unix.pod:98 msgid "Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named \"-foo\", you can use this command:" msgstr "Potraktowanie wszystkich kolejnych opcji jako nazw plików. Tej opcji należy użyć, aby przekonwertować pliki, których nazwy zaczynają się od minusa. Przykładowo, aby przekonwertować plik o nazwie \"-foo\", można użyć polecenia:" #. type: verbatim #: dos2unix.pod:102 #, no-wrap msgid "" " dos2unix -- -foo\n" "\n" msgstr "" " dos2unix -- -foo\n" "\n" #. type: textblock #: dos2unix.pod:104 msgid "Or in new file mode:" msgstr "Lub w trybie nowego pliku:" #. type: verbatim #: dos2unix.pod:106 #, no-wrap msgid "" " dos2unix -n -- -foo out.txt\n" "\n" msgstr "" " dos2unix -n -- -foo out.txt\n" "\n" #. type: =item #: dos2unix.pod:108 msgid "B<-ascii>" msgstr "B<-ascii>" #. type: textblock #: dos2unix.pod:110 msgid "Convert only line breaks. This is the default conversion mode." msgstr "Konwersja tylko znaków końca linii. Jest to domyślny tryb konwersji." #. type: =item #: dos2unix.pod:112 msgid "B<-iso>" msgstr "B<-iso>" #. type: textblock #: dos2unix.pod:114 msgid "Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES." msgstr "Konwersja między zestawami znaków DOS i ISO-8859-1. Więcej w sekcji TRYBY KONWERSJI." #. type: =item #: dos2unix.pod:117 msgid "B<-1252>" msgstr "B<-1252>" #. type: textblock #: dos2unix.pod:119 msgid "Use Windows code page 1252 (Western European)." msgstr "Użycie strony kodowej Windows 1252 (zachodnioeuropejskiej)." #. type: =item #: dos2unix.pod:121 msgid "B<-437>" msgstr "B<-437>" #. type: textblock #: dos2unix.pod:123 msgid "Use DOS code page 437 (US). This is the default code page used for ISO conversion." msgstr "Użycie strony kodowej DOS 437 (US). Jest to domyślna strona kodowa używana przy konwersji ISO." #. type: =item #: dos2unix.pod:125 msgid "B<-850>" msgstr "B<-850>" #. type: textblock #: dos2unix.pod:127 msgid "Use DOS code page 850 (Western European)." msgstr "Użycie strony kodowej DOS 850 (zachodnioeuropejskiej)." #. type: =item #: dos2unix.pod:129 msgid "B<-860>" msgstr "B<-860>" #. type: textblock #: dos2unix.pod:131 msgid "Use DOS code page 860 (Portuguese)." msgstr "Użycie strony kodowej DOS 860 (portugalskiej)." #. type: =item #: dos2unix.pod:133 msgid "B<-863>" msgstr "B<-863>" #. type: textblock #: dos2unix.pod:135 msgid "Use DOS code page 863 (French Canadian)." msgstr "Użycie strony kodowej DOS 863 (kanadyjskiej francuskiej)." #. type: =item #: dos2unix.pod:137 msgid "B<-865>" msgstr "B<-865>" #. type: textblock #: dos2unix.pod:139 msgid "Use DOS code page 865 (Nordic)." msgstr "Użycie strony kodowej DOS 865 (nordyckiej)." #. type: =item #: dos2unix.pod:141 msgid "B<-7>" msgstr "B<-7>" #. type: textblock #: dos2unix.pod:143 msgid "Convert 8 bit characters to 7 bit space." msgstr "Konwersja znaków 8-bitowych do przestrzeni 7-bitowej." #. type: =item #: dos2unix.pod:145 msgid "B<-b, --keep-bom>" msgstr "B<-b, --keep-bom>" #. type: textblock #: dos2unix.pod:147 msgid "Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option C<-r>." msgstr "Zachowanie znaku BOM (Byte Order Makr). Jeżeli plik wejściowy zawiera BOM, powoduje zapisanie go w pliku wyjściowym. Jest to domyślne zachowanie przy konwersji na DOS-owe końce linii. P. także opcja C<-r>." #. type: =item #: dos2unix.pod:151 msgid "B<-c, --convmode CONVMODE>" msgstr "B<-c, --convmode TRYB_KONW>" #. type: textblock #: dos2unix.pod:153 msgid "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default." msgstr "Ustawienie trybu konwersji. TRYB_KONW to jeden z: I, I<7bit>, I, I, przy czym domyślny jest ascii." #. type: =item #: dos2unix.pod:157 msgid "B<-D, --display-enc ENCODING>" msgstr "B<-D, --display-enc KODOWANIE>" #. type: textblock #: dos2unix.pod:159 msgid "Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default." msgstr "Ustawienie kodowania wyświetlanego tekstu. KODOWANIE to jedno z: I, I, I, I, I, przy czym domyślne to ansi." #. type: textblock #: dos2unix.pod:163 msgid "This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed." msgstr "Ta opcja jest dostępna wyłączenie w programie dos2unix dla Windows z obsługą nazw plików Unicode. Nie ma wpływu na same nawy odczytywanych i zapisywanych plików, a jedynie na sposób ich wyświetlania." #. type: textblock #: dos2unix.pod:167 msgid "There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages." msgstr "Istnieje kilka sposobów wyświetlania tekstu w konsoli Windows w zależności od kodowania tekstu. Wszystkie mają swoje zalety i wady." #. type: =item #: dos2unix.pod:173 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:175 msgid "Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page." msgstr "Domyślna metoda programu dos2unix to stosowanie tekstu kodowanego w ANSI. Zaletą jest wsteczna zgodność. Działa z fontami rastrowymi, jak i TrueType. W niektórych rejonach może być potrzeba zmiany aktywnej strony kodowej DOS OEM na systemową stronę kodową Windows ANSI przy użyciu polecenia C, ponieważ dos2unix wykorzystuje systemową stronę kodową Windows." #. type: textblock #: dos2unix.pod:181 msgid "The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK." msgstr "Wadą kodowania ansi jest fakt, że międzynarodowe nazwy plików ze znakami spoza domyślnej systemowej strony kodowej nie są wyświetlane właściwie. Można zamiast tego zobaczyć znak zapytania albo niewłaściwy symbol. Jeżeli nie pracujemy z obcymi nazwami plików, ta metoda jest poprawna." #. type: =item #: dos2unix.pod:186 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:188 msgid "The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it." msgstr "Zaletą kodowania unicode (windowsową nazwą dla UTF-16) jest (zwykle) właściwe wyświetlanie tekstu. Nie ma potrzeby zmiany aktywnej strony kodowej. Może być potrzeba zmiany fontu konsoli na font TrueType, aby znaki międzynarodowe były wyświetlane poprawnie. Jeśli znak nie jest obecny w foncie TrueType, zwykle widać mały kwadrat, czasami ze znakiem zapytania w środku." #. type: textblock #: dos2unix.pod:194 msgid "When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font." msgstr "W przypadku używania konsoli ConEmu cały tekst jest wyświetlany poprawnie, ponieważ ConEmu automatycznie wybiera dobry font." #. type: textblock #: dos2unix.pod:197 msgid "The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program." msgstr "Wadą kodowania unicode jest niezgodność z ASCII. Wyjście nie jest łatwe do obsłużenia w przypadku przekierowania do innego programu lub pliku." #. type: textblock #: dos2unix.pod:200 msgid "When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "W przypadku użycia metody C, tekst w unikodzie jest poprzedzony znakiem BOM (Byte Order Mark). BOM jest wymagany do poprawnego przekierowania lub przekazywania przez potok w powłoce PowerShell." #. type: =item #: dos2unix.pod:205 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:207 msgid "The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding." msgstr "Zaletą kodowania utf8 jest zgodność z ASCII. Trzeba ustawić font konsoli na font TrueType. Przy użyciu fontu TrueType tekst jest wyświetlany podobnie do kodowania C." #. type: textblock #: dos2unix.pod:211 msgid "The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed." msgstr "Wadą jest fakt, że w przypadku używania domyślnego fontu rastrowego, wszystkie znaki spoza ASCII są wyświetlane niepoprawnie. Nie tylko unikodowe nazwy plików, ale także przetłumaczone komunikaty stają się nieczytelne. W Windows skonfigurowanym dla rejonu Azji Wschodniej widać dużo migotania konsoli w trakcie wyświetlania komunikatów." #. type: textblock #: dos2unix.pod:217 msgid "In a ConEmu console the utf8 encoding method works well." msgstr "W konsoli ConEmu metoda kodowania utf8 działa dobrze." #. type: textblock #: dos2unix.pod:219 msgid "When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "W przypadku użycia metody C, tekst w UTF-8 jest poprzedzony znakiem BOM (Byte Order Mark). BOM jest wymagany do poprawnego przekierowania lub przekazywania przez potok w powłoce PowerShell." #. type: textblock #: dos2unix.pod:226 msgid "The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C." msgstr "Domyślne kodowanie można zmienić przy użyciu zmiennej środowiskowej DOS2UNIX_DISPLAY_ENC, ustawiając ją na C, C, C lub C." #. type: =item #: dos2unix.pod:229 msgid "B<-f, --force>" msgstr "B<-f, --force>" #. type: textblock #: dos2unix.pod:231 msgid "Force conversion of binary files." msgstr "Wymuszenie konwersji plików binarnych." #. type: =item #: dos2unix.pod:233 msgid "B<-gb, --gb18030>" msgstr "B<-gb, --gb18030>" #. type: textblock #: dos2unix.pod:235 msgid "On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030." msgstr "Pod Windows pliki w UTF-16 są domyślnie konwertowane do UTF-8, niezależnie od ustawienia lokalizacji. Ta opcja pozwala przekonwertować pliki w UTF-16 do GB18030. Opcja jest dostępna tylko pod Windows, więcej w sekcji dotyczącej GB18030." #. type: =item #: dos2unix.pod:239 msgid "B<-h, --help>" msgstr "B<-h, --help>" #. type: textblock #: dos2unix.pod:241 msgid "Display help and exit." msgstr "Wyświetlenie opisu i zakończenie." #. type: =item #: dos2unix.pod:243 msgid "B<-i[FLAGS], --info[=FLAGS] FILE ...>" msgstr "B<-i[FLAGI], --info[=FLAGI] PLIK ...>" #. type: textblock #: dos2unix.pod:245 msgid "Display file information. No conversion is done." msgstr "Wyświetlenie informacji o pliku. Konwersja nie jest wykonywana." #. type: textblock #: dos2unix.pod:247 msgid "The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name." msgstr "Wypisywane są następujące informacje, w tej kolejności: liczba DOS-owych końców linii, liczba uniksowych końców linii, liczba macowych końców linii, znacznik BOM, tekstowy lub binarny, nazwa pliku." #. type: textblock #: dos2unix.pod:251 msgid "Example output:" msgstr "Przykładowe wyjście:" #. type: verbatim #: dos2unix.pod:253 #, no-wrap msgid "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" msgstr "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" #. type: textblock #: dos2unix.pod:262 msgid "Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>." msgstr "Uwaga: czasami plik binarny może być błędnie rozpoznany jako tekstowy. P. także opcja C<-s>." #. type: textblock #: dos2unix.pod:264 msgid "Optionally extra flags can be set to change the output. One or more flags can be added." msgstr "Opcjonalnie można ustawić dodatkowe flagi, aby zmienić wyjście. Można dodać jedną lub więcej flag." #. type: =item #: dos2unix.pod:269 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:271 msgid "Print number of DOS line breaks." msgstr "Wypisanie liczby DOS-owych końców linii." #. type: =item #: dos2unix.pod:273 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:275 msgid "Print number of Unix line breaks." msgstr "Wypisanie liczby uniksowych końców linii." #. type: =item #: dos2unix.pod:277 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:279 msgid "Print number of Mac line breaks." msgstr "Wypisanie liczby macowych końców linii." #. type: =item #: dos2unix.pod:281 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:283 msgid "Print the byte order mark." msgstr "Wypisanie znacznika BOM." #. type: =item #: dos2unix.pod:285 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:287 msgid "Print if file is text or binary." msgstr "Wypisanie, czy plik jest tekstowy, czy binarny." #. type: =item #: dos2unix.pod:289 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:291 msgid "Print only the files that would be converted." msgstr "Wypisanie tylko plików, które zostałyby przekonwertowane." #. type: textblock #: dos2unix.pod:293 msgid "With the C flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks." msgstr "Z flagą C dos2unix wypisze tylko pliki zawierające DOS-owe końce linii, a unix2dos wypisze tylko nazwy plików zawierających uniksowe końce linii." #. type: =item #: dos2unix.pod:296 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:298 msgid "Print a header." msgstr "Wypisanie nagłówka." #. type: =item #: dos2unix.pod:300 msgid "B

" msgstr "B

" #. type: textblock #: dos2unix.pod:302 msgid "Show file names without path." msgstr "Wyświetlanie nazw plików bez ścieżki." #. type: textblock #: dos2unix.pod:306 msgid "Examples:" msgstr "Przykłady:" #. type: textblock #: dos2unix.pod:308 msgid "Show information for all *.txt files:" msgstr "Pokazanie informacji o wszystkich plikach *.txt:" #. type: verbatim #: dos2unix.pod:310 #, no-wrap msgid "" " dos2unix -i *.txt\n" "\n" msgstr "" " dos2unix -i *.txt\n" "\n" #. type: textblock #: dos2unix.pod:312 msgid "Show only the number of DOS line breaks and Unix line breaks:" msgstr "Pokazanie tylko liczby DOS-owych i uniksowych końców linii:" #. type: verbatim #: dos2unix.pod:314 #, no-wrap msgid "" " dos2unix -idu *.txt\n" "\n" msgstr "" " dos2unix -idu *.txt\n" "\n" #. type: textblock #: dos2unix.pod:316 msgid "Show only the byte order mark:" msgstr "Pokazanie tylko znacznika BOM:" #. type: verbatim #: dos2unix.pod:318 #, no-wrap msgid "" " dos2unix --info=b *.txt\n" "\n" msgstr "" " dos2unix --info=b *.txt\n" "\n" #. type: textblock #: dos2unix.pod:320 msgid "List the files that have DOS line breaks:" msgstr "Wypisanie listy plików zawierających DOS-owe końce linii:" #. type: verbatim #: dos2unix.pod:322 #, no-wrap msgid "" " dos2unix -ic *.txt\n" "\n" msgstr "" " dos2unix -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:324 msgid "List the files that have Unix line breaks:" msgstr "Wypisanie listy plików zawierających uniksowe końce linii:" #. type: verbatim #: dos2unix.pod:326 #, no-wrap msgid "" " unix2dos -ic *.txt\n" "\n" msgstr "" " unix2dos -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:328 msgid "Convert only files that have DOS line breaks and leave the other files untouched:" msgstr "Konwersja tylko plików mających DOS-owe końce linii, pozostawienie pozostałych bez zmian:" #. type: verbatim #: dos2unix.pod:330 #, no-wrap msgid "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:332 msgid "Find text files that have DOS line breaks:" msgstr "Wyszukanie plików tekstowych zawierających DOS-owe końce linii:" #. type: verbatim #: dos2unix.pod:334 #, no-wrap msgid "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" msgstr "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" #. type: =item #: dos2unix.pod:336 msgid "B<-k, --keepdate>" msgstr "B<-k, --keepdate>" #. type: textblock #: dos2unix.pod:338 msgid "Keep the date stamp of output file same as input file." msgstr "Zachowanie znacznika czasu pliku wyjściowego takiego samego, jak pliku wejściowego." #. type: =item #: dos2unix.pod:340 msgid "B<-L, --license>" msgstr "B<-L, --license>" #. type: textblock #: dos2unix.pod:342 msgid "Display program's license." msgstr "Wyświetlenie licencji programu." #. type: =item #: dos2unix.pod:344 msgid "B<-l, --newline>" msgstr "B<-l, --newline>" #. type: textblock #: dos2unix.pod:346 msgid "Add additional newline." msgstr "Dodanie dodatkowego znaku końca linii." #. type: textblock #: dos2unix.pod:348 msgid "B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks." msgstr "B: tylko DOS-owe znaki końca linii są zamieniane na dwa uniksowe. W trybie Mac tylko macowe znaki końca linii są zamieniane na dwa uniksowe." #. type: textblock #: dos2unix.pod:352 msgid "B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks." msgstr "B: tylko uniksowe znaki końca linii są zamieniane na dwa DOS-owe. W trybie Mac uniksowe znaki końca linii są zamieniane na dwa macowe." #. type: =item #: dos2unix.pod:355 msgid "B<-m, --add-bom>" msgstr "B<-m, --add-bom>" #. type: textblock #: dos2unix.pod:357 msgid "Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written." msgstr "Zapisanie znacznika BOM (Byte Order Mark) w pliku wyjściowym. Domyślnie zapisywany jest BOM UTF-8." #. type: textblock #: dos2unix.pod:360 msgid "When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM will be written." msgstr "Jeśli plik wejściowy jest w kodowaniu UTF-16 i użyto opcji C<-u>, zostanie zapisany BOM UTF-16." #. type: textblock #: dos2unix.pod:363 msgid "Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE." msgstr "Nigdy nie należy używać tej opcji, jeśli kodowanie wyjściowe jest inne niż UTF-8, UTF-16 lub GB18030. Więcej w sekcji UNICODE." #. type: =item #: dos2unix.pod:367 msgid "B<-n, --newfile INFILE OUTFILE ...>" msgstr "B<-n, --newfile PLIK_WEJ PLIK_WYJ ...>" #. type: textblock #: dos2unix.pod:369 msgid "New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files." msgstr "Tryb nowego pliku. Konwersja PLIKU_WEJ z zapisem wyjścia do PLIKU_WYJ. Nazwy plików muszą być podane parami, a masek I należy używać, gdyż I to utratę plików." #. type: textblock #: dos2unix.pod:373 msgid "The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion." msgstr "Osoba uruchamiająca konwersję w trybie nowego pliku (par) będzie właścicielem przekonwertowanego pliku. Prawa odczytu/zapisu nowego pliku będą pochodziły z praw pliku oryginalnego po odjęciu umask(1) osoby uruchamiającej konwersję." #. type: =item #: dos2unix.pod:378 msgid "B<-o, --oldfile FILE ...>" msgstr "B<-o, --oldfile PLIK ...>" #. type: textblock #: dos2unix.pod:380 msgid "Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used." msgstr "Tryb starego pliku. Konwersja PLIKU i nadpisanie go wyjściem. Program działa domyślnie w tym trybie. Można używać masek." #. type: textblock #: dos2unix.pod:383 msgid "In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix." msgstr "W trybie starego pliku (w miejscu) przekonwertowany plik otrzymuje tego samego właściciela, grupę oraz prawa odczytu/zapisu, jak plik oryginalny - także wtedy, gdy plik jest konwertowany przez innego użytkownika, mającego prawo zapisu do pliku (np. przez użytkownika root). Konwersja zostanie przerwana, jeśli nie będzie możliwe zachowanie oryginalnych wartości. Zmiana właściciela mogłaby oznaczać, że pierwotny właściciel nie może już odczytać pliku. Zmiana grupy mogłaby być zagrożeniem bezpieczeństwa, plik mógłby być czytelny dla nie zamierzonych osób. Zachowanie właściciela, grupy i praw odczytu/zapisu jest obsługiwane tylko na Uniksie." #. type: =item #: dos2unix.pod:392 msgid "B<-q, --quiet>" msgstr "B<-q, --quiet>" #. type: textblock #: dos2unix.pod:394 msgid "Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used." msgstr "Tryb cichy. Pominięcie wszystkich ostrzeżeń i komunikatów. Zwracanym kodem jest zero, chyba że podano błędne opcje linii poleceń." #. type: =item #: dos2unix.pod:397 msgid "B<-r, --remove-bom>" msgstr "B<-r, --remove-bom>" #. type: textblock #: dos2unix.pod:399 msgid "Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option C<-b>." msgstr "Usunięcie znaków BOM (Byte Order Mark). Bez zapisywania BOM do pliku wyjściowego. Jest to domyślne zachowanie przy konwersji na uniksowe końce linii. P. także opcja C<-b>." #. type: =item #: dos2unix.pod:403 msgid "B<-s, --safe>" msgstr "B<-s, --safe>" #. type: textblock #: dos2unix.pod:405 msgid "Skip binary files (default)." msgstr "Pominięcie plików binarnych (domyślne)." #. type: textblock #: dos2unix.pod:407 msgid "The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file." msgstr "Pomijanie plików binarnych ma na celu zapobieżenie przypadkowym błędom. Uwaga: wykrywanie plików binarnych nie jest w 100% odporne na błędy. Pliki wejściowe są przeszukiwane pod kątem symboli binarnych, które zwykle nie występują w plikach tekstowych. Może się zdarzyć, że plik binarny zawiera tylko zwykłe znaki tekstowe. Taki plik binarny będzie błędnie widziany jako plik tekstowy." #. type: =item #: dos2unix.pod:413 msgid "B<-u, --keep-utf16>" msgstr "B<-u, --keep-utf16>" #. type: textblock #: dos2unix.pod:415 msgid "Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the C<-ascii> option." msgstr "Zachowanie oryginalnego kodowania pliku wejściowego UTF-16. Plik wyjściowy zostanie zapisany w tym samym kodowaniu UTF-16 (little lub big endian), co plik wejściowy. Zapobiega to przekształceniu do UTF-8. Do pliku zostanie zapisany odpowiedni znacznik BOM UTF-16. Tę opcję można wyłączyć opcją C<-ascii>." #. type: =item #: dos2unix.pod:420 msgid "B<-ul, --assume-utf16le>" msgstr "B<-ul, --assume-utf16le>" #. type: textblock #: dos2unix.pod:422 msgid "Assume that the input file format is UTF-16LE." msgstr "Przyjęcie, że format pliku wejściowego to UTF-16LE." #. type: textblock #: dos2unix.pod:424 msgid "When there is a Byte Order Mark in the input file the BOM has priority over this option." msgstr "Jeśli w pliku wejściowym jest znacznik BOM (Byte Order Mark), ma on priorytet nad tą opcją." #. type: textblock #: dos2unix.pod:427 msgid "When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file." msgstr "Jeśli przyjęto błędne założenie (plik wejściowy nie jest w formacie UTF-16LE), a konwersja się uda, wynikiem będzie plik wyjściowy UTF-8 ze złym tekstem. Konwersję tę można odwrócić przy użyciu polecenia iconv(1) do konwersji wyjścia UTF-8 z powrotem do UTF-16LE. Przywróci to plik oryginalny." #. type: textblock #: dos2unix.pod:432 msgid "The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off." msgstr "Przyjęcie UTF-16LE działa jako I. Przy przełączeniu na domyślny tryb I przyjęcie UTF-16LE jest wyłączane." #. type: =item #: dos2unix.pod:435 msgid "B<-ub, --assume-utf16be>" msgstr "B<-ub, --assume-utf16be>" #. type: textblock #: dos2unix.pod:437 msgid "Assume that the input file format is UTF-16BE." msgstr "Przyjęcie, że format pliku wejściowego to UTF-16BE." #. type: textblock #: dos2unix.pod:439 msgid "This option works the same as option C<-ul>." msgstr "Ta opcja działa analogicznie do C<-ul>." #. type: =item #: dos2unix.pod:441 msgid "B<-v, --verbose>" msgstr "B<-v, --verbose>" #. type: textblock #: dos2unix.pod:443 msgid "Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks." msgstr "Wyświetlanie szczegółowych komunikatów. Wyświetlane śa dodatkowe informacje o znacznikach BOM (Byte Order Mark) oraz liczbie przekonwertowanych końców linii." #. type: =item #: dos2unix.pod:446 msgid "B<-F, --follow-symlink>" msgstr "B<-F, --follow-symlink>" #. type: textblock #: dos2unix.pod:448 msgid "Follow symbolic links and convert the targets." msgstr "Podążanie za dowiązaniami symbolicznymi i konwertowanie ich celów" #. type: =item #: dos2unix.pod:450 msgid "B<-R, --replace-symlink>" msgstr "B<-R, --replace-symlink>" #. type: textblock #: dos2unix.pod:452 msgid "Replace symbolic links with converted files (original target files remain unchanged)." msgstr "Zastępowanie dowiązań symbolicznych przekonwertowanymi plikami (oryginalne pliki docelowe pozostają bez zmian)." #. type: =item #: dos2unix.pod:455 msgid "B<-S, --skip-symlink>" msgstr "B<-S, --skip-symlink>" #. type: textblock #: dos2unix.pod:457 msgid "Keep symbolic links and targets unchanged (default)." msgstr "Pozostawienie dowiązań symbolicznych i celów bez zmian (domyślne)." #. type: =item #: dos2unix.pod:459 msgid "B<-V, --version>" msgstr "B<-V, --version>" #. type: textblock #: dos2unix.pod:461 msgid "Display version information and exit." msgstr "Wyświetlenie informacji o wersji i zakończenie." #. type: =head1 #: dos2unix.pod:465 msgid "MAC MODE" msgstr "TRYB MAC" #. type: textblock #: dos2unix.pod:467 msgid "In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted." msgstr "W zwykłym trybie znaki końca linii są konwertowane z DOS-a do Uniksa i odwrotnie. Znaki końca linii systemu Mac nie są konwertowane." #. type: textblock #: dos2unix.pod:470 msgid "In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed." msgstr "W trybie Mac znaki końca linii są konwertowane z formatu Maca do Uniksa i odwrotnie. Znaki końca linii systemu DOS nie są zmieniane." #. type: textblock #: dos2unix.pod:473 msgid "To run in Mac mode use the command-line option C<-c mac> or use the commands C or C." msgstr "Aby uruchomić program w trybie Mac, należy użyć opcji linii poleceń C<-c mac> albo użyć poleceń C lub C." #. type: =head1 #: dos2unix.pod:476 msgid "CONVERSION MODES" msgstr "TRYBY KONWERSJI" #. type: =item #: dos2unix.pod:480 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:482 msgid "In mode C only line breaks are converted. This is the default conversion mode." msgstr "W trybie C konwertowane są tylko końce linii. Jest to domyślny tryb konwersji." #. type: textblock #: dos2unix.pod:485 msgid "Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files." msgstr "Mimo że nazwa tego trybu to ASCII, które jest standardem 7-bitowym, jest to tryb 8-bitowy. Należy zawsze używać tego trybu przy konwersji plików Unicode UTF-8." #. type: =item #: dos2unix.pod:489 msgid "B<7bit>" msgstr "B<7bit>" #. type: textblock #: dos2unix.pod:491 msgid "In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space." msgstr "W tym trybie wszystkie znaki 8-bitowe spoza ASCII (o wartościach od 128 do 255) są konwertowane do przestrzeni 7-bitowej." #. type: =item #: dos2unix.pod:494 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:496 msgid "Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart." msgstr "W tym trybie znaki są konwertowane między zestawem znaków DOS (stroną kodową) a zestawem znaków ISO-8859-1 (Latin-1) używanym na Uniksie. Znaki DOS-owe nie mające odpowiednika w ISO-8859-1, których nie da się przekonwertować, są zamieniane na kropkę. To samo dotyczy znaków ISO-8859-1 bez odpowiednika w DOS-ie." #. type: textblock #: dos2unix.pod:501 msgid "When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings." msgstr "Jeśli używana jest tylko opcja C<-iso>, dos2unix próbuje wykryć aktywną stronę kodową. Jeśli nie jest to możliwe, dos2unix używa domyślnej strony kodowej CP437, stosowanej głównie w USA. Aby wymusić określoną stronę kodową, należy użyć opcji C<-437> (US), C<-850> (zachodnioeuropejska), C<-860> (portugalska), C<-863> (kanadyjska francuska) lub C<-865> (nordycka). Ponadto obsługiwana jest strona kodowa Windows CP1252 (zachodnioeuropejska) przy użyciu opcji C<-1252>. W przypadku innych stron kodowych można użyć narzędzia dos2unix wraz z iconv(1). Iconv potrafi konwertować między wieloma kodowaniami znaków." #. type: textblock #: dos2unix.pod:510 msgid "Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files." msgstr "Nigdy nie należy używać konwersji ISO na plikach tekstowych w Unicode. Uszkodziłaby pliki kodowane UTF-8." #. type: textblock #: dos2unix.pod:512 msgid "Some examples:" msgstr "Kilka przykładów:" #. type: textblock #: dos2unix.pod:514 msgid "Convert from DOS default code page to Unix Latin-1:" msgstr "Konwersja z domyślnej strony kodowej DOS do uniksowego Latin-1:" #. type: verbatim #: dos2unix.pod:516 #, no-wrap msgid "" " dos2unix -iso -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -iso -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:518 msgid "Convert from DOS CP850 to Unix Latin-1:" msgstr "Konwersja ze strony kodowej DOS CP850 do uniksowego Latin-1:" #. type: verbatim #: dos2unix.pod:520 #, no-wrap msgid "" " dos2unix -850 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -850 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:522 msgid "Convert from Windows CP1252 to Unix Latin-1:" msgstr "Konwersja ze strony kodowej Windows CP1252 do uniksowego Latin-1:" #. type: verbatim #: dos2unix.pod:524 #, no-wrap msgid "" " dos2unix -1252 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -1252 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:526 msgid "Convert from Windows CP1252 to Unix UTF-8 (Unicode):" msgstr "Konwersja ze strony kodowej Windows CP1252 do uniksowego UTF-8 (Unicode):" #. type: verbatim #: dos2unix.pod:528 #, no-wrap msgid "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" msgstr "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" #. type: textblock #: dos2unix.pod:530 msgid "Convert from Unix Latin-1 to DOS default code page:" msgstr "Konwersa z uniksowego Latin-1 do domyślnej strony kodowej DOS:" #. type: verbatim #: dos2unix.pod:532 #, no-wrap msgid "" " unix2dos -iso -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -iso -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:534 msgid "Convert from Unix Latin-1 to DOS CP850:" msgstr "Konwersja z uniksowego Latin-1 do strony kodowej DOS CP850:" #. type: verbatim #: dos2unix.pod:536 #, no-wrap msgid "" " unix2dos -850 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -850 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:538 msgid "Convert from Unix Latin-1 to Windows CP1252:" msgstr "Konwersja z uniksowego Latin-1 do strony kodowej Windows CP1252:" #. type: verbatim #: dos2unix.pod:540 #, no-wrap msgid "" " unix2dos -1252 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -1252 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:542 msgid "Convert from Unix UTF-8 (Unicode) to Windows CP1252:" msgstr "Konwersja z uniksowego UTF-8 (Unicode) do strony kodowej Windows CP1252:" #. type: verbatim #: dos2unix.pod:544 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" #. type: textblock #: dos2unix.pod:546 msgid "See also L and L." msgstr "Więcej pod adresem L oraz L." #. type: =head1 #: dos2unix.pod:551 msgid "UNICODE" msgstr "UNICODE" #. type: =head2 #: dos2unix.pod:553 msgid "Encodings" msgstr "Kodowania" #. type: textblock #: dos2unix.pod:555 msgid "There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format." msgstr "Istnieją różne kodowania Unicode. Pod Uniksem i Linuksem pliki Unicode są zwykle kodowane z użyciem UTF-8. Pod Windows pliki tekstowe Unicode mogą być kodowane w UTF-8, UTF-16, UTF-16 big-endian, ale przeważnie są kodowane w UTF-16." #. type: =head2 #: dos2unix.pod:560 msgid "Conversion" msgstr "Konwersje" #. type: textblock #: dos2unix.pod:562 msgid "Unicode text files can have DOS, Unix or Mac line breaks, like regular text files." msgstr "Pliki tekstowe Unicode mogą mieć znaki końca linii systemu DOS, Unix lub Mac, podobnie jak zwykłe pliki tekstowe." #. type: textblock #: dos2unix.pod:565 msgid "All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII." msgstr "Wszystkie wersje dos2unix i unix2dos potrafią konwertować pliki kodowane UTF-8, ponieważ UTF-8 jest wstecznie zgodne z ASCII." #. type: textblock #: dos2unix.pod:568 msgid "Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C." msgstr "Dos2unix i unix2dos z obsługą Unicode UTF-16 potrafią odczytywać pliki tekstowe kodowane UTF-16 little- oraz big-endian. Aby sprawdzić, czy dos2unix został zbudowany z obsługą UTF-16, należy napisać C." #. type: textblock #: dos2unix.pod:572 msgid "On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped." msgstr "Pod Uniksem/Linuksem pliki w kodowaniu UTF-16 są konwertowane do kodowania znaków ustawionej lokalizacji. Kodowanie znaków dla lokalizacji można sprawdzić poleceniem locale(1). Jeśli konwersja nie jest możliwa, wystąpi błąd, a plik zostanie pominięty." #. type: textblock #: dos2unix.pod:577 msgid "On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux." msgstr "Pod Windows pliki UTF-16 są domyślnie konwertowane do UTF-8. Pliki tekstkowe w kodowaniu UTF-8 są dobrze obsługiwane zarówno pod Windows, jak i Uniksem/Linuksem." #. type: textblock #: dos2unix.pod:580 msgid "UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." msgstr "Kodowania UTF-16 i UTF-8 są w pełni zgodne, konwersja nie spowoduje utraty żadnej części tekstu. W przypadku wystąpienia błędu konwersji, na przykład w przypadku błędu w pliku wejściowym UTF-16, plik zostanie pominięty." #. type: textblock #: dos2unix.pod:584 msgid "When option C<-u> is used, the output file will be written in the same UTF-16 encoding as the input file. Option C<-u> prevents conversion to UTF-8." msgstr "W przypadku użycia opcji C<-u>, plik wejściowy zostanie zapisany w tym samym kodowaniu UTF-16, co plik wejściowy. Opcja C<-u> zapobiega konwersji do UTF-8." #. type: textblock #: dos2unix.pod:587 msgid "Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16." msgstr "Dos2unix oraz unix2dos nie mają opcji pozwalającej na konwersję plików UTF-8 do UTF-16." #. type: textblock #: dos2unix.pod:589 msgid "ISO and 7-bit mode conversion do not work on UTF-16 files." msgstr "Tryby konwersji ISO i 7-bit nie działają na plikach UTF-16." #. type: =head2 #: dos2unix.pod:591 msgid "Byte Order Mark" msgstr "Znacznik BOM" #. type: textblock #: dos2unix.pod:593 msgid "On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L." msgstr "W systemie Windows pliki tekstowe zwykle zawierają znacznik BOM (Byte Order Mark), ponieważ wiele programów dla Windows (w tym Notepad) dodaje domyślnie znaczniki BOM. Więcej informacji można znaleźć pod adresem L." #. type: textblock #: dos2unix.pod:597 msgid "On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding." msgstr "Pod Uniksem pliki Unicode zwykle nie mają znacznika BOM. Pliki tekstowe są traktowane jako kodowane zgodnie z kodowaniem znaków ustawionej lokalizacji." #. type: textblock #: dos2unix.pod:600 msgid "Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file." msgstr "Dos2unix potrafi wykryć tylko, czy plik jest w formacie UTF-16, jeśli zawiera znacznik BOM. Jeśli plik UTF-16 nie ma tego znacznika, dos2unix potraktuje plik jako binarny." #. type: textblock #: dos2unix.pod:604 msgid "Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM." msgstr "Do konwersji pliku UTF-16 bez znacznika BOM można użyć opcji C<-ul> lub C<-ub>." #. type: textblock #: dos2unix.pod:606 msgid "Dos2unix writes by default no BOM in the output file. With option C<-b> Dos2unix writes a BOM when the input file has a BOM." msgstr "Dos2unix nie zapisuje domyślnie znaku BOM w pliku wyjściowym. Z opcją C<-b> Dos2unix zapisuje BOM, jeśli plik wejściowy zawiera BOM." #. type: textblock #: dos2unix.pod:609 msgid "Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option C<-r> to remove the BOM." msgstr "Unix2dos domyślnie zapisuje znaczniki BOM w pliku wyjściowym, jeśli plik wejściowy ma BOM. Aby usunąć BOM, można użyć opcji C<-r>." #. type: textblock #: dos2unix.pod:612 msgid "Dos2unix and unix2dos write always a BOM when option C<-m> is used." msgstr "Dos2unix oraz unix2dos zawsze zapisują znaczniki BOM, jeśli użyta zostanie opcja C<-m>." #. type: =head2 #: dos2unix.pod:614 msgid "Unicode file names on Windows" msgstr "Unikodowe nazwy plików w Windows" #. type: textblock #: dos2unix.pod:616 msgid "Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C." msgstr "Dos2unix ma opcjonalną obsługę odczytu i zapisu nazw plików Unicode w linii poleceń Windows. Oznacza to, że dos2unix potrafi otwierać pliki zawierające w nazwie znaki spoza domyślnej systemowej strony kodowej ANSI. Aby sprawdzić, czy dos2unix dla Windows został zbudowany z obsługą nazw plików Unicode, można wpisać C." #. type: textblock #: dos2unix.pod:622 msgid "There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name." msgstr "Przy wyświetlaniu nazw plików Unicode w konsoli Windows występuje kilka problemów. Więcej informacji w opisie opcji C<-D>, C<--display-enc>. Nazwy plików mogą być wyświetlane błędnie na konsoli, ale pliki będą zapisywane z poprawną nazwą." #. type: =head2 #: dos2unix.pod:626 msgid "Unicode examples" msgstr "Przykłady Unicode" #. type: textblock #: dos2unix.pod:628 msgid "Convert from Windows UTF-16 (with BOM) to Unix UTF-8:" msgstr "Konwersja pliku UTF-16 (z BOM) z formatu Windows do uniksowego UTF-8:" #. type: verbatim #: dos2unix.pod:630 #, no-wrap msgid "" " dos2unix -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:632 msgid "Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:" msgstr "Konwersja pliku UTF-16LE (bez BOM) z formatu Windows do uniksowego UTF-8:" #. type: verbatim #: dos2unix.pod:634 #, no-wrap msgid "" " dos2unix -ul -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -ul -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:636 msgid "Convert from Unix UTF-8 to Windows UTF-8 with BOM:" msgstr "Konwersja z uniksowego UTF-8 do UTF-8 z BOM dla Windows:" #. type: verbatim #: dos2unix.pod:638 #, no-wrap msgid "" " unix2dos -m -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -m -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:640 msgid "Convert from Unix UTF-8 to Windows UTF-16:" msgstr "Konwersja z uniksowego UTF-8 do UTF-16 dla Windows:" #. type: verbatim #: dos2unix.pod:642 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" #. type: =head1 #: dos2unix.pod:644 msgid "GB18030" msgstr "GB18030" #. type: textblock #: dos2unix.pod:646 msgid "GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also L." msgstr "GB18030 to standard urzędowy w Chinach. Obowiązkowy podzbiór standardu GB18030 jest oficjalnym wymaganiem każdego oprogramowania sprzedawanego w Chinach. Więcej pod adresem L." #. type: textblock #: dos2unix.pod:650 msgid "GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK." msgstr "GB18030 jest w pełni zgodny z Unicode i może być uważany za format transformacji unikodu. Podobnie jak UTF-8, GB18030 jest zgodny z ASCII. Jest także zgodny ze stroną kodową Windows 936, znaną też jako GBK." #. type: textblock #: dos2unix.pod:654 msgid "On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command C to get the list of supported locales." msgstr "Pod Uniksem/Linuksem pliki UTF-16 są konwertowane do GB18030, jeśli kodowanie dla lokalizacji jest ustawione na GB18030. Uwaga: będzie to działać tylko, jeśli lokalizacja jest obsługiwana przez system. Listę obsługiwanych lokalizacji można sprawdzić poleceniem C." #. type: textblock #: dos2unix.pod:658 msgid "On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030." msgstr "Pod Windows w celu konwersji plików UTF-16 do GB18030 należy użyć opcji C<-gb>." #. type: textblock #: dos2unix.pod:660 msgid "GB18030 encoded files can have a Byte Order Mark, like Unicode files." msgstr "Pliki w kodowaniu GB18030 mogą mieć znacznik BOM, podobnie jak pliki w Unicode." #. type: =head1 #: dos2unix.pod:662 msgid "EXAMPLES" msgstr "PRZYKŁADY" #. type: textblock #: dos2unix.pod:664 msgid "Read input from 'stdin' and write output to 'stdout':" msgstr "Odczyt ze standardowego wejścia i zapis na standardowe wyjście:" #. type: verbatim #: dos2unix.pod:666 #, fuzzy, no-wrap #| msgid "" #| " dos2unix -ic *.txt | xargs dos2unix\n" #| "\n" msgid "" " dos2unix < a.txt\n" " cat a.txt | dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:669 msgid "Convert and replace a.txt. Convert and replace b.txt:" msgstr "Konwersja i zastąpienie a.txt; konwersja i zastąpienie b.txt:" #. type: verbatim #: dos2unix.pod:671 #, no-wrap msgid "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" msgstr "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" #. type: textblock #: dos2unix.pod:674 msgid "Convert and replace a.txt in ascii conversion mode:" msgstr "Konwersja i zastąpienie a.txt w trybie ascii:" #. type: verbatim #: dos2unix.pod:676 #, no-wrap msgid "" " dos2unix a.txt\n" "\n" msgstr "" " dos2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:678 msgid "Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode:" msgstr "Konwersja i zastąpienie a.txt w trybie ascii; konwersja i zastąpienie b.txt w trybie 7-bitowym:" #. type: verbatim #: dos2unix.pod:681 #, no-wrap msgid "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" msgstr "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" #. type: textblock #: dos2unix.pod:685 msgid "Convert a.txt from Mac to Unix format:" msgstr "Konwersja a.txt z formatu Mac do formatu uniksowego:" #. type: verbatim #: dos2unix.pod:687 #, no-wrap msgid "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" msgstr "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:690 msgid "Convert a.txt from Unix to Mac format:" msgstr "Konwersja a.txt z formatu uniksowego do formatu Mac:" #. type: verbatim #: dos2unix.pod:692 #, no-wrap msgid "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" msgstr "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" #. type: textblock #: dos2unix.pod:695 msgid "Convert and replace a.txt while keeping original date stamp:" msgstr "Konwersja i zastąpienie a.txt z zachowaniem oryginalnego znacznika czasu:" #. type: verbatim #: dos2unix.pod:697 #, no-wrap msgid "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" msgstr "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" #. type: textblock #: dos2unix.pod:700 msgid "Convert a.txt and write to e.txt:" msgstr "Konwersja a.txt i zapis do e.txt:" #. type: verbatim #: dos2unix.pod:702 #, no-wrap msgid "" " dos2unix -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:704 msgid "Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:" msgstr "Konwersja a.txt i zapis do e.txt z zachowaniem znacznika czasu e.txt takiego, jak a.txt:" #. type: verbatim #: dos2unix.pod:706 #, no-wrap msgid "" " dos2unix -k -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -k -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:708 msgid "Convert and replace a.txt, convert b.txt and write to e.txt:" msgstr "Konwersja i zastąpienie a.txt; konwersja b.txt i zapis do e.txt:" #. type: verbatim #: dos2unix.pod:710 #, no-wrap msgid "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" msgstr "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:713 msgid "Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt:" msgstr "Konwersja c.txt i zapis do e.txt; konwersja i zastąpienie a.txt; konwersja i zastąpienie b.txt; konwersja d.txt i zapis do f.txt:" #. type: verbatim #: dos2unix.pod:716 #, no-wrap msgid "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" msgstr "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" #. type: =head1 #: dos2unix.pod:718 msgid "RECURSIVE CONVERSION" msgstr "KONWERSJA REKURENCYJNA" #. type: textblock #: dos2unix.pod:720 msgid "Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type:" msgstr "Można użyć dos2unix w połączeniu z poleceniami find(1) i xargs(1) do rekurencyjnej konwersji plików tekstowych w strukturze drzewa katalogów. Na przykład, aby przekonwertować wszystkie pliki .txt w drzewie katalogów poniżej katalogu bieżącego, należy napisać:" #. type: verbatim #: dos2unix.pod:724 #, no-wrap msgid "" " find . -name '*.txt' |xargs dos2unix\n" "\n" msgstr "" " find . -name '*.txt' |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:726 msgid "In a Windows Command Prompt the following command can be used:" msgstr "Z poziomu linii poleceń Windows można użyć następującego polecenia:" #. type: verbatim #: dos2unix.pod:728 #, no-wrap msgid "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" msgstr "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" #. type: textblock #: dos2unix.pod:730 msgid "PowerShell users can use the following command in Windows PowerShell:" msgstr "Użytkownicy powłoki PowerShell mogą użyć następującego polecenia w Windows PowerShell:" #. type: verbatim #: dos2unix.pod:732 #, no-wrap msgid "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" msgstr "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" #. type: =head1 #: dos2unix.pod:735 msgid "LOCALIZATION" msgstr "LOKALIZACJA" #. type: =item #: dos2unix.pod:739 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:741 msgid "The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:" msgstr "Główny język wybiera się zmienną środowiskową LANG. Zmienna LANG składa się z kilku części. Pierwsza część to małe litery oznaczające kod języka. Druga część jest opcjonalna i zawiera kod kraju pisany wielkimi literami, poprzedzony podkreśleniem. Jest także opcjonalna trzecia część: kodowanie znaków, poprzedzone kropką. Kilka przykładów dla powłok zgodnych ze standardem POSIX:" #. type: verbatim #: dos2unix.pod:748 #, no-wrap msgid "" " export LANG=nl Dutch\n" " export LANG=nl_NL Dutch, The Netherlands\n" " export LANG=nl_BE Dutch, Belgium\n" " export LANG=es_ES Spanish, Spain\n" " export LANG=es_MX Spanish, Mexico\n" " export LANG=en_US.iso88591 English, USA, Latin-1 encoding\n" " export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding\n" "\n" msgstr "" " export LANG=nl holenderski\n" " export LANG=nl_NL holenderski, Holandia\n" " export LANG=nl_BE holenderski, Belgia\n" " export LANG=es_ES hiszpański, Hiszpania\n" " export LANG=es_MX hiszpański, Meksyk\n" " export LANG=en_US.iso88591 angielski, USA, kodowanie Latin-1\n" " export LANG=en_GB.UTF-8 angielski, Wlk. Brytania, kodowanie UTF-8\n" "\n" #. type: textblock #: dos2unix.pod:756 msgid "For a complete list of language and country codes see the gettext manual: L" msgstr "Pełną listę kodów języków i krajów można znaleźć w podręczniku do gettexta: L" #. type: textblock #: dos2unix.pod:759 msgid "On Unix systems you can use the command locale(1) to get locale specific information." msgstr "W systemach uniksowych do uzyskania informacji dotyczących lokalizacji można użyć polecenia locale(1)." #. type: =item #: dos2unix.pod:762 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:764 msgid "With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than \"C\", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L" msgstr "Przy użyciu zmiennej środowiskowej LANGUAGE można określić listę języków wg priorytetu, oddzielonych dwukropkami. Dos2unix przyjmuje pierwszeństwo zmiennej LANGUAGE nad LANG. Na przykład, najpierw holenderski, następnie niemiecki: C. Aby skorzystać z listy wg priorytetów ze zmiennej LANGUAGE, trzeba najpierw włączyć lokalizację przez ustawienie zmiennej LANG (lub LC_ALL) na wartość inną niż \"C\". Więcej informacji znajduje się w podręczniku do gettexta: L" #. type: textblock #: dos2unix.pod:772 msgid "If you select a language which is not available you will get the standard English messages." msgstr "W przypadku wybrania niedostępnego języka, otrzymamy standardowe, angielskie komunikaty." #. type: =item #: dos2unix.pod:776 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:778 msgid "With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used." msgstr "Przy użyciu zmiennej środowiskowej DOS2UNIX_LOCALEDIR, można nadpisać ustawienie LOCALEDIR z czasu kompilacji. LOCALEDIR to katalog używany do znalezienia plików lokalizacji. Domyślną wartością dla GNU jest C. Opcja B<--version> wyświetla używaną wartość LOCALEDIR." #. type: textblock #: dos2unix.pod:783 msgid "Example (POSIX shell):" msgstr "Przykład (dla powłoki POSIX):" #. type: verbatim #: dos2unix.pod:785 #, no-wrap msgid "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" msgstr "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" #. type: =head1 #: dos2unix.pod:790 msgid "RETURN VALUE" msgstr "WARTOŚĆ ZWRACANA" #. type: textblock #: dos2unix.pod:792 msgid "On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned." msgstr "W przypadku powodzenia zwracane jest zero. Jeśli wystąpi błąd systemowy, zwracany jest ostatni błąd systemowy. W przypadku innych błędów zwracane jest 1." #. type: textblock #: dos2unix.pod:795 msgid "The return value is always zero in quiet mode, except when wrong command-line options are used." msgstr "Wartość zwracana w trybie cichym to zawsze zero, z wyjątkiem sytuacji podania błędnych opcji linii poleceń." #. type: =head1 #: dos2unix.pod:798 msgid "STANDARDS" msgstr "STANDARDY" #. type: textblock #: dos2unix.pod:800 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:802 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:804 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:806 msgid "L" msgstr "L" #. type: =head1 #: dos2unix.pod:808 msgid "AUTHORS" msgstr "AUTORZY" #. type: textblock #: dos2unix.pod:810 msgid "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer)" msgstr "Benjamin Lin ; Bernd Johannes Wuebben (tryb mac2unix) ; Christian Wurll (dodawanie dodatkowej nowej linii) ; Erwin Waterlander (prowadzący)" #. type: textblock #: dos2unix.pod:815 msgid "Project page: L" msgstr "Strona projektu: L" #. type: textblock #: dos2unix.pod:817 msgid "SourceForge page: L" msgstr "Strona SourceForge: L" #. type: =head1 #: dos2unix.pod:819 msgid "SEE ALSO" msgstr "ZOBACZ TAKŻE" #. type: textblock #: dos2unix.pod:821 msgid "file(1) find(1) iconv(1) locale(1) xargs(1)" msgstr "file(1) find(1) iconv(1) locale(1) xargs(1)" #~ msgid "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgstr "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" dos2unix-7.3.4/po-man/pt_BR.po0000644000175500010010000021135612721132543015314 0ustar waterlanGeen# Brazilian Portuguese translation for dos2unix-man # Copyright (c) 2016 Erwin Waterlander (msgids) # Copyright (C) 2016 Free Software Foundation, Inc. # This file is distributed under the same license as the dos2unix package. # Rafael Fontenelle , 2014, 2015, 2016. msgid "" msgstr "" "Project-Id-Version: dos2unix-man 7.3.3-beta9\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-02-05 20:20+0100\n" "PO-Revision-Date: 2016-03-15 00:21-0300\n" "Last-Translator: Rafael Fontenelle \n" "Language-Team: Brazilian Portuguese \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Poedit 1.8.7\n" #. type: =head1 #: dos2unix.pod:52 msgid "NAME" msgstr "NOME" #. type: textblock #: dos2unix.pod:54 msgid "dos2unix - DOS/Mac to Unix and vice versa text file format converter" msgstr "dos2unix - Conversor de formato de arquivo texto de DOS/Mac para Unix e vice-versa" #. type: =head1 #: dos2unix.pod:56 msgid "SYNOPSIS" msgstr "SINOPSE" #. type: verbatim #: dos2unix.pod:58 #, no-wrap msgid "" " dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]\n" " unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]\n" "\n" msgstr "" " dos2unix [opções] [ARQUIVO ...] [-n ARQENT ARQSAÍDA ...]\n" " unix2dos [opções] [ARQUIVO ...] [-n ARQENT ARQSAÍDA ...]\n" "\n" #. type: =head1 #: dos2unix.pod:61 msgid "DESCRIPTION" msgstr "DESCRIÇÃO" #. type: textblock #: dos2unix.pod:63 msgid "The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa." msgstr "O pacote Dos2unix inclui utilitários de C e C para converter arquivos texto nos formatos DOS ou Mac para formato Unix e vice-versa." #. type: textblock #: dos2unix.pod:66 msgid "In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks." msgstr "Em arquivos texto DOS/Windows uma quebra de linha, também conhecida como nova linha, é uma combinação de dois caracteres: um Carriage Return (CR) seguido por um Line Feed (LF). Em arquivos texto do Unix uma quebra de linha é um único caractere: o Line Feed (LF). Em arquivos texto do Mac, anteriores ao Mac OS X, uma quebra de linha era um único caractere Carriage Return (CR). Hoje em dia, Mac OS usa quebras de linha no estilo do Unix (LF)." #. type: textblock #: dos2unix.pod:72 msgid "Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files." msgstr "Além das quebras de linhas, Dos2unix também pode converter as codificações de arquivos. Algumas poucas páginas podem ser convertidos para Latin-1 para Unix. E arquivos Unicode do Windows (UTF-16) podem ser convertidos para arquivos Unicode do Unix (UTF-8)." #. type: textblock #: dos2unix.pod:76 msgid "Binary files are automatically skipped, unless conversion is forced." msgstr "Arquivos binários são ignorados automaticamente, a menos que a conversão seja forçada." #. type: textblock #: dos2unix.pod:78 msgid "Non-regular files, such as directories and FIFOs, are automatically skipped." msgstr "Arquivos não regulares, tais como diretórios e FIFOs, são ignorados automaticamente." #. type: textblock #: dos2unix.pod:80 msgid "Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows." msgstr "Ligações simbólicas e seus alvos são por padrão mantidas intocáveis. Ligações simbólicas podem opcionalmente ser substituídas, ou a saída pode ser escrita para o alvo das ligações simbólicas. Não há suporte às ligações simbólicas do Windows." #. type: textblock #: dos2unix.pod:84 msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion." msgstr "Dos2unix foi modelado seguindo dos2unix do SunOS/Solaris. Há uma diferença importante em relação à versão original do SunOS/Solaris. Essa versão faz conversão no-lugar (modo arquivo antigo) por padrão, enquanto a versão original do SunOS/Solaris fornecia suporte apenas a conversão pareada (modo de novo arquivo). Veja também as opções C<-o> e C<-n>. Uma outra diferença é que a versão SunOS/Solaris usa, por padrão, a conversão de modo do I enquanto esta versão usa o do I." #. type: =head1 #: dos2unix.pod:92 msgid "OPTIONS" msgstr "OPÇÕES" #. type: =item #: dos2unix.pod:96 msgid "B<-->" msgstr "B<-->" #. type: textblock #: dos2unix.pod:98 msgid "Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named \"-foo\", you can use this command:" msgstr "Trata as opções seguintes como nomes de arquivos. Use essa opção se você quiser converter arquivos cujos nomes iniciam com um traço. Por exemplo, para converter um arquivo chamado \"foo\", você pode usar este comando:" #. type: verbatim #: dos2unix.pod:102 #, no-wrap msgid "" " dos2unix -- -foo\n" "\n" msgstr "" " dos2unix -- -foo\n" "\n" #. type: textblock #: dos2unix.pod:104 msgid "Or in new file mode:" msgstr "Ou em modo de novo arquivo:" #. type: verbatim #: dos2unix.pod:106 #, no-wrap msgid "" " dos2unix -n -- -foo out.txt\n" "\n" msgstr "" " dos2unix -n -- -foo saída.txt\n" "\n" #. type: =item #: dos2unix.pod:108 msgid "B<-ascii>" msgstr "B<-ascii>" #. type: textblock #: dos2unix.pod:110 msgid "Convert only line breaks. This is the default conversion mode." msgstr "Converte apenas as quebras de linhas. Esse é o modo de conversão padrão." #. type: =item #: dos2unix.pod:112 msgid "B<-iso>" msgstr "B<-iso>" #. type: textblock #: dos2unix.pod:114 msgid "Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES." msgstr "Conversão entre conjunto de caractere do DOS e ISO-8859-1. Veja também a seção MODOS DE CONVERSÃO." #. type: =item #: dos2unix.pod:117 msgid "B<-1252>" msgstr "B<-1252>" #. type: textblock #: dos2unix.pod:119 msgid "Use Windows code page 1252 (Western European)." msgstr "Usa a página de código 1252 do Windows (Europa ocidental)." #. type: =item #: dos2unix.pod:121 msgid "B<-437>" msgstr "B<-437>" #. type: textblock #: dos2unix.pod:123 msgid "Use DOS code page 437 (US). This is the default code page used for ISO conversion." msgstr "Usa a página de código 437 do DOS (EUA). Essa é a página de código padrão usada para conversão ISO." #. type: =item #: dos2unix.pod:125 msgid "B<-850>" msgstr "B<-850>" #. type: textblock #: dos2unix.pod:127 msgid "Use DOS code page 850 (Western European)." msgstr "Usa a página de código 850 do DOS (Europa ocidental)." #. type: =item #: dos2unix.pod:129 msgid "B<-860>" msgstr "B<-860>" #. type: textblock #: dos2unix.pod:131 msgid "Use DOS code page 860 (Portuguese)." msgstr "Usa a página de código 860 do DOS (Português)." #. type: =item #: dos2unix.pod:133 msgid "B<-863>" msgstr "B<-863>" #. type: textblock #: dos2unix.pod:135 msgid "Use DOS code page 863 (French Canadian)." msgstr "Usa a página de código 863 do DOS (Francês do Canadá)." #. type: =item #: dos2unix.pod:137 msgid "B<-865>" msgstr "B<-865>" #. type: textblock #: dos2unix.pod:139 msgid "Use DOS code page 865 (Nordic)." msgstr "Usa a página de código 865 do DOS (Nórdico)." #. type: =item #: dos2unix.pod:141 msgid "B<-7>" msgstr "B<-7>" #. type: textblock #: dos2unix.pod:143 msgid "Convert 8 bit characters to 7 bit space." msgstr "Converte caracteres de 8 bits para espaço de 7 bits." #. type: =item #: dos2unix.pod:145 msgid "B<-b, --keep-bom>" msgstr "B<-b, --keep-bom>" #. type: textblock #: dos2unix.pod:147 msgid "Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option C<-r>." msgstr "Mantém marca de ordem de bytes (BOM). Quando o arquivo de entrada possuir um BOM, escreve um BOM no arquivo de saída. Esse é o comportamento padrão ao converter para quebras de linha do DOS. Veja também a opção C<-r>." #. type: =item #: dos2unix.pod:151 msgid "B<-c, --convmode CONVMODE>" msgstr "B<-c, --convmode MODOCONV>" #. type: textblock #: dos2unix.pod:153 msgid "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default." msgstr "Define o modo de conversão, sendo MODOCONV um dentre: I, I<7bit>, I, I com ascii sendo o padrão." #. type: =item #: dos2unix.pod:157 msgid "B<-D, --display-enc ENCODING>" msgstr "B<-D, --display-enc CODIFICAÇÃO>" #. type: textblock #: dos2unix.pod:159 msgid "Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default." msgstr "Define a codificação do texto exibido, sendo CODIFICAÇÃO um dentre: I, I, I, I com ansi sendo o padrão." #. type: textblock #: dos2unix.pod:163 msgid "This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed." msgstr "Essa opção está disponível apenas no dos2unix para Windows com suporte a nome de arquivo em Unicode. Essa opção não possui efeito nos nomes de arquivos lidos e escritos, apenas em como eles são exibidos." #. type: textblock #: dos2unix.pod:167 msgid "There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages." msgstr "Há vários métodos para exibir texto em um console Windows baseado na codificação do texto. Todos eles possuem suas próprias vantagens e desvantagens." #. type: =item #: dos2unix.pod:173 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:175 msgid "Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page." msgstr "O método padrão do dos2unix é usar o texto codificado em ANSI. A sua vantagem é a compatibilidade reversa. Ele funciona com fontes raster e TrueType. Em algumas regiões você pode precisar alterar a página de código OEM do DOS para ANSI do sistema Windows usando o comando C, porque dos2unix usa a página de código do sistema Windows." #. type: textblock #: dos2unix.pod:181 msgid "The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK." msgstr "A desvantagem do ansi é que nomes de arquivos internacionais com caracteres fora a página de código padrão do sistema não são exibidos apropriadamente. Você verá um sinal de interrogação, ou um símbolo incorreto. Quando você não utiliza nomes de arquivos estrangeiros, esse método funciona bem." #. type: =item #: dos2unix.pod:186 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:188 msgid "The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it." msgstr "A vantagem da codificação do unicode (o nome Windows para UTF-16) é que o texto é normalmente exibido apropriadamente. Não há necessidade para alterar a página de código ativa. Você pode precisar definir a fonte do console para uma fonte TrueType para que caracteres internacionais sejam exibidos apropriadamente. Quando um caractere não está incluído na fonte TrueType, geralmente você vê um pequeno quadrado, algumas vezes com um sinal de interrogação nele." #. type: textblock #: dos2unix.pod:194 msgid "When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font." msgstr "Quando você usa o console ConEmu todo texto é exibido apropriadamente, porque o ConEmu seleciona automaticamente um fonte boa." #. type: textblock #: dos2unix.pod:197 msgid "The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program." msgstr "A desvantagem do unicode é que ele não é compatível com ASCII. A saída não é fácil de lidar quando você o redireciona para um outro programa." #. type: textblock #: dos2unix.pod:200 msgid "When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "Quando o método é usado, o texto Unicode será precedido com um BOM (Byte Order Mark, ou marca de ordem de byte). Um BOM é necessário para o redirecionamento, ou \"piping\", correto no PowerShell." #. type: =item #: dos2unix.pod:205 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:207 msgid "The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding." msgstr "A vantagem do utf8 é que ele é compatível com ASCII. Você precisa definir a fonte do console para uma fonte TrueType. Com uma fonte TrueType, o texto é exibido similar a uma codificação C." #. type: textblock #: dos2unix.pod:211 msgid "The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed." msgstr "A desvantagem é que quando você usa a fonte \"raster\" padrão, caracteres não-ASCII são exibidos incorretamente. Não apenas nomes de arquivos unicode, mas também mensagens traduzidas ficam ilegíveis. No Windows configurado para uma região leste da Ásia, você pode ver muitas falhas no console quando as mensagens são exibidas." #. type: textblock #: dos2unix.pod:217 msgid "In a ConEmu console the utf8 encoding method works well." msgstr "Em um console ConEmu, o método de codificação utf8 funciona bem." #. type: textblock #: dos2unix.pod:219 msgid "When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "Quando o método é usado, o texto UTF-8 será precedido com um BOM (Byte Order Mark, ou marca de ordem de byte). Um BOM é necessário para o redirecionamento, ou \"piping\", correto no PowerShell." #. type: textblock #: dos2unix.pod:226 msgid "The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C." msgstr "A codificação padrão pode ser alterada com a variável de ambiente DOS2UNIX_DISPLAY_ENC definindo-a para C, C, C ou C." #. type: =item #: dos2unix.pod:229 msgid "B<-f, --force>" msgstr "B<-f, --force>" #. type: textblock #: dos2unix.pod:231 msgid "Force conversion of binary files." msgstr "Força a conversão de arquivos binários." #. type: =item #: dos2unix.pod:233 msgid "B<-gb, --gb18030>" msgstr "B<-gb, --gb18030>" #. type: textblock #: dos2unix.pod:235 msgid "On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030." msgstr "No Windows, arquivos UTF-16 são convertidos, por padrão, para UTF-8, independentemente da localização definida. Use esta opção para converter arquivos UTF-16 para GB18030. Essa opção está disponível apenas no Windows. Veja também a seção GB18030." #. type: =item #: dos2unix.pod:239 msgid "B<-h, --help>" msgstr "B<-h, --help>" #. type: textblock #: dos2unix.pod:241 msgid "Display help and exit." msgstr "Exibe ajuda e sai." #. type: =item #: dos2unix.pod:243 msgid "B<-i[FLAGS], --info[=FLAGS] FILE ...>" msgstr "B<-i[OPÇÕES], --info[=OPÇÕES] ARQUIVO ...>" #. type: textblock #: dos2unix.pod:245 msgid "Display file information. No conversion is done." msgstr "Exibe informação do arquivo. Nenhuma conversão é feita." #. type: textblock #: dos2unix.pod:247 msgid "The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name." msgstr "A seguinte informação é exibida, nesta ordem: número de quebras de linha do DOS, número de quebras de linha do Unix, número de quebras de linha do Mac, marca de ordem de byte, \"text\" ou \"binary\", nome de arquivo." #. type: textblock #: dos2unix.pod:251 msgid "Example output:" msgstr "Exemplo de saída:" #. type: verbatim #: dos2unix.pod:253 #, no-wrap msgid "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" msgstr "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" #. type: textblock #: dos2unix.pod:262 msgid "Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>." msgstr "Note que em algumas vezes um arquivo binário pode ser confundido com um arquivo texto. Veja também a opção C<-s>." #. type: textblock #: dos2unix.pod:264 msgid "Optionally extra flags can be set to change the output. One or more flags can be added." msgstr "Opcionalmente, opções extra podem ser definidas para alterar a saída. Uma ou mais opções podem ser adicionadas." #. type: =item #: dos2unix.pod:269 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:271 msgid "Print number of DOS line breaks." msgstr "Exibe o número de quebras de linhas do DOS." #. type: =item #: dos2unix.pod:273 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:275 msgid "Print number of Unix line breaks." msgstr "Exibe o número de quebras de linhas do Unix." #. type: =item #: dos2unix.pod:277 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:279 msgid "Print number of Mac line breaks." msgstr "Exibe o número de quebras de linhas do Mac." #. type: =item #: dos2unix.pod:281 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:283 msgid "Print the byte order mark." msgstr "Exibe a marca de ordem de byte." #. type: =item #: dos2unix.pod:285 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:287 msgid "Print if file is text or binary." msgstr "Exibe se arquivo é texto ou binário." #. type: =item #: dos2unix.pod:289 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:291 msgid "Print only the files that would be converted." msgstr "Exibe apenas os arquivos que seriam convertidos." #. type: textblock #: dos2unix.pod:293 msgid "With the C flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks." msgstr "Com a opção C, dos2unix vai exibir apenas os arquivos que contêm quebras de linha do DOS, unix2dos vai exibir apenas os nomes de arquivos que contêm quebras de linha do Unix." #. type: =item #: dos2unix.pod:296 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:298 msgid "Print a header." msgstr "Exibe um cabeçalho." #. type: =item #: dos2unix.pod:300 msgid "B

" msgstr "B

" #. type: textblock #: dos2unix.pod:302 msgid "Show file names without path." msgstr "Mostra nomes de arquivos sem caminho." #. type: textblock #: dos2unix.pod:306 msgid "Examples:" msgstr "Exemplos:" #. type: textblock #: dos2unix.pod:308 msgid "Show information for all *.txt files:" msgstr "Mostra informação sobre todos os arquivos *.txt:" #. type: verbatim #: dos2unix.pod:310 #, no-wrap msgid "" " dos2unix -i *.txt\n" "\n" msgstr "" " dos2unix -i *.txt\n" "\n" #. type: textblock #: dos2unix.pod:312 msgid "Show only the number of DOS line breaks and Unix line breaks:" msgstr "Mostra apenas o número de quebras de linha DOS e Unix:" #. type: verbatim #: dos2unix.pod:314 #, no-wrap msgid "" " dos2unix -idu *.txt\n" "\n" msgstr "" " dos2unix -idu *.txt\n" "\n" #. type: textblock #: dos2unix.pod:316 msgid "Show only the byte order mark:" msgstr "Mostra apenas a marca de ordem de byte:" #. type: verbatim #: dos2unix.pod:318 #, no-wrap msgid "" " dos2unix --info=b *.txt\n" "\n" msgstr "" " dos2unix --info=b *.txt\n" "\n" #. type: textblock #: dos2unix.pod:320 msgid "List the files that have DOS line breaks:" msgstr "Lista os arquivos que possuem quebras de linha do DOS:" #. type: verbatim #: dos2unix.pod:322 #, no-wrap msgid "" " dos2unix -ic *.txt\n" "\n" msgstr "" " dos2unix -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:324 msgid "List the files that have Unix line breaks:" msgstr "Lista os arquivos que possuem quebras de linha do Unix:" #. type: verbatim #: dos2unix.pod:326 #, no-wrap msgid "" " unix2dos -ic *.txt\n" "\n" msgstr "" " unix2dos -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:328 msgid "Convert only files that have DOS line breaks and leave the other files untouched:" msgstr "Converte apenas arquivos que possuem quebras de linha do DOS e não altera outros arquivos:" #. type: verbatim #: dos2unix.pod:330 #, no-wrap msgid "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:332 msgid "Find text files that have DOS line breaks:" msgstr "Localiza arquivos de texto que possuam quebras de linha do DOS:" #. type: verbatim #: dos2unix.pod:334 #, no-wrap msgid "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" msgstr "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" #. type: =item #: dos2unix.pod:336 msgid "B<-k, --keepdate>" msgstr "B<-k, --keepdate>" #. type: textblock #: dos2unix.pod:338 msgid "Keep the date stamp of output file same as input file." msgstr "Mantém a marca da data do arquivo de saída igual ao do arquivo de entrada." #. type: =item #: dos2unix.pod:340 msgid "B<-L, --license>" msgstr "B<-L, --license>" #. type: textblock #: dos2unix.pod:342 msgid "Display program's license." msgstr "Exibe a licença do programa." #. type: =item #: dos2unix.pod:344 msgid "B<-l, --newline>" msgstr "B<-l, --newline>" #. type: textblock #: dos2unix.pod:346 msgid "Add additional newline." msgstr "Adiciona nova linha adicional." #. type: textblock #: dos2unix.pod:348 msgid "B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks." msgstr "B: Apenas quebras de linha do DOS são alteradas para duas quebras de linha do Unix. No modo Mac, apenas quebras de linha do Mac são alterados para duas quebras de linha do Unix." #. type: textblock #: dos2unix.pod:352 msgid "B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks." msgstr "B: Apenas quebras de linha do Unix são alteradas para duas quebras de linha do DOS. No modo Mac, quebras de linha do Unix são alteradas para duas quebras de linha do Mac." #. type: =item #: dos2unix.pod:355 msgid "B<-m, --add-bom>" msgstr "B<-m, --add-bom>" #. type: textblock #: dos2unix.pod:357 msgid "Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written." msgstr "Escreve uma marca de ordem de byte (BOM) no arquivo de saída. Por padrão, um BOM UTF-8 é escrito." #. type: textblock #: dos2unix.pod:360 msgid "When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM will be written." msgstr "Quando o arquivo de entrada é UTF-16, e a opção C<-u> é usada, um BOM UTF-16 será escrito." #. type: textblock #: dos2unix.pod:363 msgid "Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE." msgstr "Nunca use essa opção quando a codificação de saída é outra além de UTF-8, UTF-16 ou GB18030. Veja também a seção UNICODE." #. type: =item #: dos2unix.pod:367 msgid "B<-n, --newfile INFILE OUTFILE ...>" msgstr "B<-n, --newfile ARQENT ARQSAÍDA ...>" #. type: textblock #: dos2unix.pod:369 msgid "New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files." msgstr "Modo de novo arquivo. Converte o arquivo ARQENT e escreve a saída para o arquivo ARQSAÍDA. Os nomes de arquivos devem ser fornecidos em pares e nome coringa I deveriam ser usados ou você I perder seus arquivos." #. type: textblock #: dos2unix.pod:373 msgid "The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion." msgstr "A pessoa que começa a conversão em modo novo arquivo (pareado) será o dono do arquivo convertido. As permissões de leitura/escrita do novo arquivo serão as permissões do arquivo original menos a umask(1) da pessoa que executa a conversão." #. type: =item #: dos2unix.pod:378 msgid "B<-o, --oldfile FILE ...>" msgstr "B<-o, --oldfile ARQUIVO ...>" #. type: textblock #: dos2unix.pod:380 msgid "Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used." msgstr "Modo arquivo antigo. Converte o arquivo ARQUIVO e o sobrescreve com a saída. O programa, por padrão, executa neste modo. Nomes coringas podem ser usados." #. type: textblock #: dos2unix.pod:383 msgid "In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix." msgstr "No modo de arquivo antigo (no-lugar) o arquivo convertido recebe no mesmo dono, grupo e permissões de leitura/escrita que o arquivo original. Também, quando o arquivo é convertido por outro usuário que tenha permissões de escrita no arquivo (ex.: usuário root). A conversão será abortada quando não for possível preservar os valores originais. Alteração do dono pode significar que o dono original não é mais capaz de ler o arquivo. Alteração do grupo pode ser um risco para a segurança, pois o arquivo pode ficar legível para pessoas cujo acesso não é desejado. Preservação do dono, grupo e permissões de leitura/escrita tem suporte apenas no Unix." #. type: =item #: dos2unix.pod:392 msgid "B<-q, --quiet>" msgstr "B<-q, --quiet>" #. type: textblock #: dos2unix.pod:394 msgid "Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used." msgstr "Modo quieto. Suprime todos os avios e mensagens. O valor retornado é zero. Exceto quando opções de linha de comando erradas forem usadas." #. type: =item #: dos2unix.pod:397 msgid "B<-r, --remove-bom>" msgstr "B<-r, --remove-bom>" #. type: textblock #: dos2unix.pod:399 msgid "Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option C<-b>." msgstr "remove marca de ordem de bytes (BOM). Não escreve um BOM no arquivo de saída. Esse é o comportamento padrão ao converter para quebras de linha Unix. Veja também a opção C<-b>." #. type: =item #: dos2unix.pod:403 msgid "B<-s, --safe>" msgstr "B<-s, --safe>" #. type: textblock #: dos2unix.pod:405 msgid "Skip binary files (default)." msgstr "Ignora arquivo binários (padrão)." #. type: textblock #: dos2unix.pod:407 msgid "The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file." msgstr "A ação de ignorar arquivos binários é feita para evitar equívocos acidentais. Fique ciente de que a detecção de arquivos binários não é 100% à prova de erros. Arquivos de entrada são analisados por símbolos binários que, geralmente, não são encontrados em arquivos textos. É possível que um arquivo binário contenha apenas caracteres de texto normais. tal arquivo binário pode ser acidentalmente visto como um arquivo de texto." #. type: =item #: dos2unix.pod:413 msgid "B<-u, --keep-utf16>" msgstr "B<-u, --keep-utf16>" #. type: textblock #: dos2unix.pod:415 msgid "Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the C<-ascii> option." msgstr "Mantém a codificação UTF-16 original do arquivo de entrada. O arquivo de saída será escrito na mesma codificação UTF-16, em little ou big endian, como o arquivo de entrada. Isso evita transformação para UTF-8. Como consequência, um BOM UTF-16 será escrito. Essa opção pode ser desabilitada com a opção C<-ascii>." #. type: =item #: dos2unix.pod:420 msgid "B<-ul, --assume-utf16le>" msgstr "B<-ul, --assume-utf16le>" #. type: textblock #: dos2unix.pod:422 msgid "Assume that the input file format is UTF-16LE." msgstr "Presume que o formato de arquivo de entrada é UTF-16LE." #. type: textblock #: dos2unix.pod:424 msgid "When there is a Byte Order Mark in the input file the BOM has priority over this option." msgstr "Quando há uma marca de ordem de byte no arquivo de entrada, esta tem prioridade sobre essa opção." #. type: textblock #: dos2unix.pod:427 msgid "When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file." msgstr "Quando você fizer uma presunção equivocada (o arquivo de entrada não estava no formato UTF-16LE) e a conversão funcionar, você terá um arquivo de saída UTF-8 com texto errado. Você pode desfazer a conversão errada com iconv(1) pela conversão do arquivo de saída UTF-8 de volta para UTF-16LE. Isso vai trazer de volta o arquivo para o original." #. type: textblock #: dos2unix.pod:432 msgid "The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off." msgstr "A presunção de UTF-16LE funciona como um I. Ao alternara o modo I padrão, a presunção de UTF-16LE é desativada." #. type: =item #: dos2unix.pod:435 msgid "B<-ub, --assume-utf16be>" msgstr "B<-ub, --assume-utf16be>" #. type: textblock #: dos2unix.pod:437 msgid "Assume that the input file format is UTF-16BE." msgstr "Presume que o formato de arquivo de entrada é UTF-16BE." #. type: textblock #: dos2unix.pod:439 msgid "This option works the same as option C<-ul>." msgstr "Essa opção funciona o mesmo que a opção C<-ul>." #. type: =item #: dos2unix.pod:441 msgid "B<-v, --verbose>" msgstr "B<-v, --verbose>" #. type: textblock #: dos2unix.pod:443 msgid "Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks." msgstr "Exibe mensagens detalhadas. Informação extra é exibida sobre marcas de ordem de byte e a quantidade de quebras de linha convertidas." #. type: =item #: dos2unix.pod:446 msgid "B<-F, --follow-symlink>" msgstr "B<-F, --follow-symlink>" #. type: textblock #: dos2unix.pod:448 msgid "Follow symbolic links and convert the targets." msgstr "Segue ligações simbólicas e converte os alvos." #. type: =item #: dos2unix.pod:450 msgid "B<-R, --replace-symlink>" msgstr "B<-R, --replace-symlink>" #. type: textblock #: dos2unix.pod:452 msgid "Replace symbolic links with converted files (original target files remain unchanged)." msgstr "Substitui ligações simbólicas com arquivos convertidos (arquivos alvo originais permanecem inalterados)." #. type: =item #: dos2unix.pod:455 msgid "B<-S, --skip-symlink>" msgstr "B<-S, --skip-symlink>" #. type: textblock #: dos2unix.pod:457 msgid "Keep symbolic links and targets unchanged (default)." msgstr "Mentém ligações simbólicas e alvos inalterados (padrão)." #. type: =item #: dos2unix.pod:459 msgid "B<-V, --version>" msgstr "B<-V, --version>" #. type: textblock #: dos2unix.pod:461 msgid "Display version information and exit." msgstr "Exibe informação da versão e sai." #. type: =head1 #: dos2unix.pod:465 msgid "MAC MODE" msgstr "MODO MAC" #. type: textblock #: dos2unix.pod:467 msgid "In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted." msgstr "No modo normal, as quebras de linhas são convertidas de DOS para Unix e vice-versa. Quebras de linha do Mac não são convertidas." #. type: textblock #: dos2unix.pod:470 msgid "In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed." msgstr "No modo Mac, quebras de linha são convertidas de Mac para Unix e vice-versa. Quebras de linha do DOS não são alteradas." #. type: textblock #: dos2unix.pod:473 msgid "To run in Mac mode use the command-line option C<-c mac> or use the commands C or C." msgstr "Para executar no modo Mac, use a opção de linha de comando C<-c mac> ou use os comandos C ou C." #. type: =head1 #: dos2unix.pod:476 msgid "CONVERSION MODES" msgstr "MODOS DE CONVERSÃO" #. type: =item #: dos2unix.pod:480 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:482 msgid "In mode C only line breaks are converted. This is the default conversion mode." msgstr "No modo C, apenas as quebras de linha são convertidas. Esse é o modo de conversão padrão." #. type: textblock #: dos2unix.pod:485 msgid "Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files." msgstr "Apesar do nome deste modo ser ASCII, o qual é um padrão de 7 bits, o modo é em verdade 8 bits. Sempre use este modo quando quiser converter arquivos Unicode UTF-8." #. type: =item #: dos2unix.pod:489 msgid "B<7bit>" msgstr "B<7bit>" #. type: textblock #: dos2unix.pod:491 msgid "In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space." msgstr "Neste modo todos os caracteres não-ASCII de 8 bits (com valores entre 128 e 255) são convertidos para um espaço de 7 bits." #. type: =item #: dos2unix.pod:494 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:496 msgid "Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart." msgstr "Caracteres são convertidos entre um conjunto de caracteres do DOS (página de código) e conjunto de caracteres ISO-8859-1 (Latin-1) no Unix. Caracteres de DOS sem um equivalente ISO-8859-1, para os quais a conversão não é possível, são convertidos para um ponto. O mesmo vale para caracteres ISO-8859-1 sem a contraparte DOS." #. type: textblock #: dos2unix.pod:501 msgid "When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings." msgstr "Quando apenas a opção C<-iso> for usada, dos2unix vai tentar determinar a página de código ativa. Quando isso não for possível, dos2unix vai usar a página de código padrão CP437, a qual é usada principalmente nos EUA. Para forçar uma página de código específica, use as opções C<-437> (EUA), C<-850> (Europeu oriental), C<-860> (Português), C<-863> (Franco-canadense) ou C<-865> (Nórdico). Também há suporte à página de código do Windows CP1252 (Europeu ocidental) com a opção C<-1252>. Para outras páginas de código, use dos2unix em combinação cm iconv(1). Iconv pode converter entre uma lista grande de codificações de caracteres." #. type: textblock #: dos2unix.pod:510 msgid "Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files." msgstr "Nunca use conversão ISO em arquivos textos Unicode. Isso vai corromper os arquivos codificados em UTF-8." #. type: textblock #: dos2unix.pod:512 msgid "Some examples:" msgstr "Alguns exemplos:" #. type: textblock #: dos2unix.pod:514 msgid "Convert from DOS default code page to Unix Latin-1:" msgstr "Conversão da página de código padrão do DOS para Latin-1 do Unix:" #. type: verbatim #: dos2unix.pod:516 #, no-wrap msgid "" " dos2unix -iso -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -iso -n entrada.txt saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:518 msgid "Convert from DOS CP850 to Unix Latin-1:" msgstr "Conversão da CP850 do DOS para Latin-1 do Unix:" #. type: verbatim #: dos2unix.pod:520 #, no-wrap msgid "" " dos2unix -850 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -850 -n entrada.txt saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:522 msgid "Convert from Windows CP1252 to Unix Latin-1:" msgstr "Conversão da CP1252 do Windows para Latin-1 do Unix:" #. type: verbatim #: dos2unix.pod:524 #, no-wrap msgid "" " dos2unix -1252 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -1252 -n entrada.txt saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:526 msgid "Convert from Windows CP1252 to Unix UTF-8 (Unicode):" msgstr "Conversão da CP1252 do Windows para UTF-8 (Unicode) do Unix:" #. type: verbatim #: dos2unix.pod:528 #, no-wrap msgid "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" msgstr "" " iconv -f CP1252 -t UTF-8 entrada.txt | dos2unix > saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:530 msgid "Convert from Unix Latin-1 to DOS default code page:" msgstr "Conversão de Latin-1 do Unix para página de código padrão do DOS:" #. type: verbatim #: dos2unix.pod:532 #, no-wrap msgid "" " unix2dos -iso -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -iso -n entrada.txt saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:534 msgid "Convert from Unix Latin-1 to DOS CP850:" msgstr "Conversão do Latin-1 do Unix para CP850 do DOS:" #. type: verbatim #: dos2unix.pod:536 #, no-wrap msgid "" " unix2dos -850 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -850 -n entrada.txt saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:538 msgid "Convert from Unix Latin-1 to Windows CP1252:" msgstr "Conversão do Latin-1 do unix para CP1252 do Windows:" #. type: verbatim #: dos2unix.pod:540 #, no-wrap msgid "" " unix2dos -1252 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -1252 -n entrada.txt saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:542 msgid "Convert from Unix UTF-8 (Unicode) to Windows CP1252:" msgstr "Conversão do UTF-8 (Unicode) do Unix para CP1252 do Windows:" #. type: verbatim #: dos2unix.pod:544 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" msgstr "" " unix2dos < entrada.txt | iconv -f UTF-8 -t CP1252 > saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:546 msgid "See also L and L." msgstr "Veja também L e L." #. type: =head1 #: dos2unix.pod:551 msgid "UNICODE" msgstr "UNICODE" #. type: =head2 #: dos2unix.pod:553 msgid "Encodings" msgstr "Codificações" #. type: textblock #: dos2unix.pod:555 msgid "There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format." msgstr "Exitem codificações Unicode diferentes. No Unix e no Linux, arquivos Unicode são geralmente codificados em UTF-8. No Windows, arquivos texto Unicode podem ser codificados em UTF-8, UTF-16 ou UTF-16 big endian, mas na maioria das vezes são codificados no formato UTF-16." #. type: =head2 #: dos2unix.pod:560 msgid "Conversion" msgstr "Conversão" #. type: textblock #: dos2unix.pod:562 msgid "Unicode text files can have DOS, Unix or Mac line breaks, like regular text files." msgstr "Arquivos texto em Unicode pode ter quebras de linha DOS, Unix ou Mac, como arquivos texto comuns." #. type: textblock #: dos2unix.pod:565 msgid "All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII." msgstr "Todas as versões do dos2unix e unix2dos podem converter arquivos codificados em UTF-8 porque UTF-8 foi projetado para ter compatibilidade reversa com ASCII." #. type: textblock #: dos2unix.pod:568 msgid "Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C." msgstr "Dos2unix e unix2dos com suporte a Unicode UTF-16 podem ler arquivos texto codificados em little e big endian UTF-16. Para ver se dos2unix foi compilado com suporte a UTF-16, digite C." #. type: textblock #: dos2unix.pod:572 msgid "On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped." msgstr "No Unix/Linux, arquivos codificados em UTF-16 são convertidos para a codificação de caracteres do localização. Use o comando locale(1) para descobrir qual é a codificação de caracteres da localização. Quando a conversão não for possível, ocorrerá um erro e o arquivo será ignorado." #. type: textblock #: dos2unix.pod:577 msgid "On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux." msgstr "No Windows, arquivos UTF-16 são convertidos, por padrão, para UTF-8. Arquivos texto formatados em UTF-8 possuem ótimo suporte em ambos Windows e Unix/Linux." #. type: textblock #: dos2unix.pod:580 msgid "UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." msgstr "Codificações UTF-16 e UTF-8 são completamente compatíveis, não havendo qualquer perda de texto na conversão. Quando um erro de conversão UTF-16 para UTF-8 ocorre, por exemplo quando o arquivo de entrada UTF-16 contém um erro, o arquivo será ignorado." #. type: textblock #: dos2unix.pod:584 msgid "When option C<-u> is used, the output file will be written in the same UTF-16 encoding as the input file. Option C<-u> prevents conversion to UTF-8." msgstr "Quando a opção C<-u> é usada, o arquivo de saída será escrito na mesma codificação UTF-16 que o arquivo de saída. A opção C<-u> evita conversão para UTF-8." #. type: textblock #: dos2unix.pod:587 msgid "Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16." msgstr "Dos2unix e unix2dos não possuem opção para converter arquivos UTF-8 para UTF-16." #. type: textblock #: dos2unix.pod:589 msgid "ISO and 7-bit mode conversion do not work on UTF-16 files." msgstr "Modo de conversão ISO e 7 bits não funcionam em arquivos UTF-16." #. type: =head2 #: dos2unix.pod:591 msgid "Byte Order Mark" msgstr "Marca de ordem de byte" #. type: textblock #: dos2unix.pod:593 msgid "On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L." msgstr "No Windows, arquivos Unicode normalmente têm uma Marca de Ordem de Byte (BOM), porque muitos programas (incluindo o Bloco de Notas) adiciona BOMs por padrão. Veja também L." #. type: textblock #: dos2unix.pod:597 msgid "On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding." msgstr "No Unix, arquivos Unicode normalmente não têm BOM. Presume-se que arquivos texto são codificados na codificação de caracteres da localização." #. type: textblock #: dos2unix.pod:600 msgid "Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file." msgstr "Dos2unix pode detectar apenas se um arquivo está no formato UTF-16 se o arquivo tiver BOM. Quando um arquivo UTF-16 não tiver BOM, dos2unix vai ver se o arquivo é um arquivo binário." #. type: textblock #: dos2unix.pod:604 msgid "Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM." msgstr "Use a opção C<-ul> ou C<-ub> para converter um arquivo UTF-16 sem BOM." #. type: textblock #: dos2unix.pod:606 msgid "Dos2unix writes by default no BOM in the output file. With option C<-b> Dos2unix writes a BOM when the input file has a BOM." msgstr "Dos2unix escreve por padrão nenhum BOM no arquivo de saída. Com a opção C<-b>, o Dos2unix escreve um BOM quando o arquivo de entrada possuir BOM." #. type: textblock #: dos2unix.pod:609 msgid "Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option C<-r> to remove the BOM." msgstr "Unix2dos escreve por padrão um BOM no arquivo de saída quando o arquivo de entrada tem BOM. Use a opção C<-m> para remover BOM." #. type: textblock #: dos2unix.pod:612 msgid "Dos2unix and unix2dos write always a BOM when option C<-m> is used." msgstr "Dos2unix e unix2dos sempre escrevem BOM quando a opção C<-m> é usada." #. type: =head2 #: dos2unix.pod:614 msgid "Unicode file names on Windows" msgstr "Nomes de arquivos Unicode no Windows" #. type: textblock #: dos2unix.pod:616 msgid "Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C." msgstr "Dos2unix possui um suporte opcional para leitura e escrita de nomes de arquivos Unicode no Prompt de Comando Windows. Isso significa que dos2unix pode abrir arquivos que possuam caracteres no nome que não são parte da página de código ANSI padrão do sistema. Para ver ser dosunix para Windows foi compilado com suporte a nomes de arquivos Unicode, digite C." #. type: textblock #: dos2unix.pod:622 msgid "There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name." msgstr "Há alguns problemas com a exibição de nomes de arquivos Unicode em um console Windows. Veja a opção C<-D>, C<--display-enc>. Para nomes de arquivos pode ser exibido incorretamente, mas os arquivos serão escritos com o nome correto." #. type: =head2 #: dos2unix.pod:626 msgid "Unicode examples" msgstr "Exemplos de Unicode" #. type: textblock #: dos2unix.pod:628 msgid "Convert from Windows UTF-16 (with BOM) to Unix UTF-8:" msgstr "Conversão de UTF-16 do Windows (com BOM) para UTF-8 do Unix:" #. type: verbatim #: dos2unix.pod:630 #, no-wrap msgid "" " dos2unix -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -n entrada.txt saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:632 msgid "Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:" msgstr "Conversão de UTF-16LE do Windows (sem BOM) para UTF-8 do Unix:" #. type: verbatim #: dos2unix.pod:634 #, no-wrap msgid "" " dos2unix -ul -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -ul -n entrada.txt saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:636 msgid "Convert from Unix UTF-8 to Windows UTF-8 with BOM:" msgstr "Conversão de UTF-8 Unix para UTF-8 do Windows com BOM:" #. type: verbatim #: dos2unix.pod:638 #, no-wrap msgid "" " unix2dos -m -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -m -n entrada.txt saída.txt\n" "\n" #. type: textblock #: dos2unix.pod:640 msgid "Convert from Unix UTF-8 to Windows UTF-16:" msgstr "Conversão de UTF-8 do Unix para UTF-16 do Windows:" #. type: verbatim #: dos2unix.pod:642 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" msgstr "" " unix2dos < entrada.txt | iconv -f UTF-8 -t UTF-16 > saída.txt\n" "\n" #. type: =head1 #: dos2unix.pod:644 msgid "GB18030" msgstr "GB18030" #. type: textblock #: dos2unix.pod:646 msgid "GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also L." msgstr "GB18030 é um padrão governamental chinês. Um subconjunto obrigatório do padrão GB18030 é exigido oficialmente para todos os produtos de software vendidos na China. Veja também L." #. type: textblock #: dos2unix.pod:650 msgid "GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK." msgstr "GB18030 é completamente compatível com Unicode e pode ser considerado um formato de transformação de unicode. Assim como UTF-8, GB18030 é compatível com ASCII. GB18030 também é compatível com a página de código 936 do Windows, também conhecida como GBK." #. type: textblock #: dos2unix.pod:654 msgid "On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command C to get the list of supported locales." msgstr "No Unix/Linux, arquivos UTF-16 são convertidos para GB18030 quando a codificação da localização é definida para GB18030. Note que isso vai funcionar apenas se o sistemas oferecer suporte à localização. Use o comando C para obter a lista de localizações às quais há suporte." #. type: textblock #: dos2unix.pod:658 msgid "On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030." msgstr "No Windows, você precisa usar a opção C<-gb> para converter arquivos UTF-16 para GB18030." #. type: textblock #: dos2unix.pod:660 msgid "GB18030 encoded files can have a Byte Order Mark, like Unicode files." msgstr "Arquivos codificados em GB18030 possuem uma marca de ordem de bytes, como arquivos Unicode." #. type: =head1 #: dos2unix.pod:662 msgid "EXAMPLES" msgstr "EXEMPLOS" #. type: textblock #: dos2unix.pod:664 msgid "Read input from 'stdin' and write output to 'stdout':" msgstr "Lê a entrada da \"stdin\" e escreve a saída para \"stdout\":" #. type: verbatim #: dos2unix.pod:666 #, fuzzy, no-wrap #| msgid "" #| " dos2unix -ic *.txt | xargs dos2unix\n" #| "\n" msgid "" " dos2unix < a.txt\n" " cat a.txt | dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:669 msgid "Convert and replace a.txt. Convert and replace b.txt:" msgstr "Converte e substitui a.txt. Converte e substitui b.txt:" #. type: verbatim #: dos2unix.pod:671 #, no-wrap msgid "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" msgstr "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" #. type: textblock #: dos2unix.pod:674 msgid "Convert and replace a.txt in ascii conversion mode:" msgstr "Converte e substitui a.txt no modo de conversão ascii:" #. type: verbatim #: dos2unix.pod:676 #, no-wrap msgid "" " dos2unix a.txt\n" "\n" msgstr "" " dos2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:678 msgid "Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode:" msgstr "Converte e substitui a.txt no modo de conversão ascii. Converte e substitui b.txt no modo de conversão 7bit:" #. type: verbatim #: dos2unix.pod:681 #, no-wrap msgid "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" msgstr "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" #. type: textblock #: dos2unix.pod:685 msgid "Convert a.txt from Mac to Unix format:" msgstr "Converte a.txt do formato do Mac para Unix:" #. type: verbatim #: dos2unix.pod:687 #, no-wrap msgid "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" msgstr "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:690 msgid "Convert a.txt from Unix to Mac format:" msgstr "Converte a.txt do formato do Unix para Mac:" #. type: verbatim #: dos2unix.pod:692 #, no-wrap msgid "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" msgstr "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" #. type: textblock #: dos2unix.pod:695 msgid "Convert and replace a.txt while keeping original date stamp:" msgstr "Converte e substitui a.txt enquanto mantém a marca de data original:" #. type: verbatim #: dos2unix.pod:697 #, no-wrap msgid "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" msgstr "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" #. type: textblock #: dos2unix.pod:700 msgid "Convert a.txt and write to e.txt:" msgstr "Converte a.txt e escreve para e.txt:" #. type: verbatim #: dos2unix.pod:702 #, no-wrap msgid "" " dos2unix -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:704 msgid "Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:" msgstr "Converte a.txt e escreve para e.txt, mantém a marca de data de e.txt igual a a.txt:" #. type: verbatim #: dos2unix.pod:706 #, no-wrap msgid "" " dos2unix -k -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -k -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:708 msgid "Convert and replace a.txt, convert b.txt and write to e.txt:" msgstr "Converte e substitui a.txt. Converte b.txt e escreve para e.txt:" #. type: verbatim #: dos2unix.pod:710 #, no-wrap msgid "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" msgstr "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:713 msgid "Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt:" msgstr "Converte c.txt e escreve para e.txt. Converte e substitui a.txt. Converte e substitui b.txt. Converte d.txt e escreve para f.txt:" #. type: verbatim #: dos2unix.pod:716 #, no-wrap msgid "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" msgstr "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" #. type: =head1 #: dos2unix.pod:718 msgid "RECURSIVE CONVERSION" msgstr "CONVERSÃO RECURSIVA" #. type: textblock #: dos2unix.pod:720 msgid "Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type:" msgstr "Use dos2unix em combinação com os comandos find(1) e xargs(1) para converter recursivamente arquivos texto em uma estrutura de árvore de diretórios. Por exemplo, para converter todos os arquivos .txt na árvore de diretórios sob o diretório atual, digite:" #. type: verbatim #: dos2unix.pod:724 #, no-wrap msgid "" " find . -name '*.txt' |xargs dos2unix\n" "\n" msgstr "" " find . -name '*.txt' |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:726 msgid "In a Windows Command Prompt the following command can be used:" msgstr "Em um Prompt de Comando do Windows o seguinte comando pode ser usado:" #. type: verbatim #: dos2unix.pod:728 #, no-wrap msgid "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" msgstr "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" #. type: textblock #: dos2unix.pod:730 msgid "PowerShell users can use the following command in Windows PowerShell:" msgstr "Usuários do PowerShell podem usar o seguinte comando no Windows PowerShell:" #. type: verbatim #: dos2unix.pod:732 #, no-wrap msgid "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" msgstr "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" #. type: =head1 #: dos2unix.pod:735 msgid "LOCALIZATION" msgstr "LOCALIZAÇÃO" #. type: =item #: dos2unix.pod:739 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:741 msgid "The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:" msgstr "O idioma primário é selecionado com a variável de ambiente LANG. A variável LANG consiste em várias partes. A primeira parte está em letras pequenas no código do idioma. A segunda parte é opcional e é o código do país em letras maiúsculo, precedido de um ponto. Alguns exemplos para shells do tipo padrão POSIX:" #. type: verbatim #: dos2unix.pod:748 #, no-wrap msgid "" " export LANG=nl Dutch\n" " export LANG=nl_NL Dutch, The Netherlands\n" " export LANG=nl_BE Dutch, Belgium\n" " export LANG=es_ES Spanish, Spain\n" " export LANG=es_MX Spanish, Mexico\n" " export LANG=en_US.iso88591 English, USA, Latin-1 encoding\n" " export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding\n" "\n" msgstr "" " export LANG=nl Holandês\n" " export LANG=nl_NL Holandês, Holanda\n" " export LANG=nl_BE Holandês, Bélgica\n" " export LANG=es_ES Espanhol, Espanha\n" " export LANG=es_MX Espanhol, México\n" " export LANG=en_US.iso88591 Inglês, EUA, codificação Latin-1\n" " export LANG=en_GB.UTF-8 Inglês, Reino Unido, codificação UTF-8\n" "\n" #. type: textblock #: dos2unix.pod:756 msgid "For a complete list of language and country codes see the gettext manual: L" msgstr "Para a lista completa de códigos de idioma e país, veja o manual do gettext: L" #. type: textblock #: dos2unix.pod:759 msgid "On Unix systems you can use the command locale(1) to get locale specific information." msgstr "Nos sistemas Unix, você pode usar o comando locale(1) para obter informação específica da localização." #. type: =item #: dos2unix.pod:762 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:764 msgid "With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than \"C\", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L" msgstr "Com a variável de ambiente LANGUAGE, você pode especificar uma lista de prioridades de idiomas, separada por vírgulas. Dos2unix fornece preferência à LANGUAGE sobre LANG. Por exemplo, primeiro holandês e, então, alemão: C. Você primeiro tem que habilitar localização, definindo LANG (ou LC_ALL) para um valor diferente de \"C\", antes que você possa usar uma lista de prioridade de idioma por meio da variável LANGUAGE. Veja também o manual do gettext: L" #. type: textblock #: dos2unix.pod:772 msgid "If you select a language which is not available you will get the standard English messages." msgstr "Se você selecionou um idioma que não está disponível, você vai terá as mensagens em inglês (padrão)." #. type: =item #: dos2unix.pod:776 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:778 msgid "With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used." msgstr "Com a variável de ambiente DOS2UNIX_LOCALEDIR, o LOCALEDIR definido durante a compilação pode ser sobrescrito. LOCALEDIR é usada para localizar os arquivos de idioma. O valor padrão do GNU é C. A opção B<--version> vai exibir o LOCALEDIR que é usado." #. type: textblock #: dos2unix.pod:783 msgid "Example (POSIX shell):" msgstr "Exemplo (shell POSIX):" #. type: verbatim #: dos2unix.pod:785 #, no-wrap msgid "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" msgstr "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" #. type: =head1 #: dos2unix.pod:790 msgid "RETURN VALUE" msgstr "VALOR RETORNADO" #. type: textblock #: dos2unix.pod:792 msgid "On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned." msgstr "No sucesso, zero é retornado. Quando um erro de sistema ocorre, o último erro de sistema será retornado. Para outros erros, 1 é retornado." #. type: textblock #: dos2unix.pod:795 msgid "The return value is always zero in quiet mode, except when wrong command-line options are used." msgstr "O valor retornado é sempre zero no modo quieto, exceto quando opções de linha de comando erradas são usadas." #. type: =head1 #: dos2unix.pod:798 msgid "STANDARDS" msgstr "PADRÕES" #. type: textblock #: dos2unix.pod:800 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:802 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:804 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:806 msgid "L" msgstr "L" #. type: =head1 #: dos2unix.pod:808 msgid "AUTHORS" msgstr "AUTORES" #. type: textblock #: dos2unix.pod:810 msgid "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer)" msgstr "Benjamin Lin - Bernd Johannes Wuebben (modo mac2unix) - , Christian Wurll (adiciona nova linha extra) - , Erwin Waterlander - (mantenedor)" #. type: textblock #: dos2unix.pod:815 msgid "Project page: L" msgstr "Página do projeto: L" #. type: textblock #: dos2unix.pod:817 msgid "SourceForge page: L" msgstr "Página do SourceForge: L" #. type: =head1 #: dos2unix.pod:819 msgid "SEE ALSO" msgstr "Veja também" #. type: textblock #: dos2unix.pod:821 msgid "file(1) find(1) iconv(1) locale(1) xargs(1)" msgstr "file(1) find(1) iconv(1) locale(1) xargs(1)" #~ msgid "Freecode: L" #~ msgstr "Freecode: L" #~ msgid "The Windows versions of dos2unix and unix2dos convert UTF-16 encoded files always to UTF-8 encoded files. Unix versions of dos2unix/unix2dos convert UTF-16 encoded files to the locale character encoding when it is set to UTF-8. Use the locale(1) command to find out what the locale character encoding is." #~ msgstr "As versões do Windows do dos2unix e unix2dos convertem arquivos codificados em UTF-16 sempre para arquivos UTF-8. Versões Unix do dos2unix/unix2dos convertem arquivos codificados em UTF-16 para a codificação de caracteres da localização quando esta estiver definida para UTF-8. Usa o comando locale(1) para descobrir qual é a codificação de caracteres da localização." #~ msgid "Because UTF-8 formatted text files are well supported on both Windows and Unix, dos2unix and unix2dos have no option to write UTF-16 files. All UTF-16 characters can be encoded in UTF-8. Conversion from UTF-16 to UTF-8 is without loss. UTF-16 files will be skipped on Unix when the locale character encoding is not UTF-8, to prevent accidental loss of text. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." #~ msgstr "Por causa dos arquivos texto formatados em UTF-8 terem bom suporte em tanto Windows e Unix, dos2unix e unix2dos têm a opção de escrever arquivos UTF-16. Todos os caracteres UTF-16 podem ser codificados em UTF-8. Conversão de UTF-16 para UTF-8 não tem perda. Arquivos UTF-16 serão ignorados no Unix quando a codificação de caracteres da localização não for UTF-8, para evitar perda acidental de texto. Quando um erro de conversão entre UTF-16 e UTF-8 ocorre (por exemplo, quando o arquivo de entrada em UTF-16 contém um erro), o arquivo será ignorado." #~ msgid "Dos2unix never writes a BOM in the output file, unless you use option C<-m>." #~ msgstr "Dos2unix nuncas escreve BOM no arquivo de saída, a menos que você use a opção C<-m>." #~ msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris and has similar conversion modes." #~ msgstr "Dos2unix foi modelado após dos2unix sob SunOS/Solaris e tem modos de conversão similares." #~ msgid "Conversion modes I, I<7bit>, and I are similar to those of dos2unix/unix2dos under SunOS/Solaris." #~ msgstr "Modos de conversão I, I<7bit> e I são similares àquelas do dos2unix/unix2dos no SunOS/Solaris." dos2unix-7.3.4/po-man/sv.po0000644000175500010010000020132412721132543014730 0ustar waterlanGeen# Swedish translation for dos2unix-man. # Copyright © 2014-2016 Erwin Waterlander, et al. (msgids) # This file is distributed under the same license as the dos2unix package. # Sebastian Rasmussen , 2014-2016. # msgid "" msgstr "" "Project-Id-Version: dos2unix-man 7.3.3-beta9\n" "POT-Creation-Date: 2016-02-11 20:33+0100\n" "PO-Revision-Date: 2016-02-06 12:02+0100\n" "Last-Translator: Sebastian Rasmussen \n" "Language-Team: Swedish \n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 1.8.6\n" #. type: =head1 #: dos2unix.pod:52 msgid "NAME" msgstr "NAMN" #. type: textblock #: dos2unix.pod:54 msgid "dos2unix - DOS/Mac to Unix and vice versa text file format converter" msgstr "dos2unix - konverterare för textfilsformat från DOS/Mac till Unix och vice versa" #. type: =head1 #: dos2unix.pod:56 msgid "SYNOPSIS" msgstr "SYNOPSIS" #. type: verbatim #: dos2unix.pod:58 #, no-wrap msgid "" " dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]\n" " unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]\n" "\n" msgstr "" " dos2unix [flaggor] [FIL …] [-n INFIL UTFIL …]\n" " unix2dos [flaggor] [FIL …] [-n INFIL UTFIL …]\n" "\n" #. type: =head1 #: dos2unix.pod:61 msgid "DESCRIPTION" msgstr "BESKRIVNING" #. type: textblock #: dos2unix.pod:63 msgid "The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa." msgstr "Paketet Dos2unix inkluderar verktygen C och C som konverterar oformaterade textfiler i DOS- eller Mac-format till Unix-format och vice versa." #. type: textblock #: dos2unix.pod:66 msgid "In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks." msgstr "Textfiler i DOS/Windows har en radbrytning, också känd som nyrad, som är en kombination av två tecken: vagnretur (Carriage Return, CR) åtföljt av radmatning (Line Feed, LF). Textfiler i Unix har en radbrytning som är ett enda tecken: radmatning (Line Feed, LF). Textfiler för Mac, innan Mac OS X, hade en radbrytning som var en enda vagnretur (Carriage Return, CR). Numera använder Mac OS radbrytning i Unix-stil (LF)." #. type: textblock #: dos2unix.pod:72 msgid "Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files." msgstr "Förutom radbrytningar så kan Dos2unix också konvertera filers kodning. Några DOS-teckentabeller kan konverteras till Unix Latin-1. Och filer som använder Windows Unicode (UTF-16) kan konverteras till Unix Unicode (UTF-8)." #. type: textblock #: dos2unix.pod:76 msgid "Binary files are automatically skipped, unless conversion is forced." msgstr "Binära filer hoppas över automatiskt, om inte konvertering tvingas." #. type: textblock #: dos2unix.pod:78 msgid "Non-regular files, such as directories and FIFOs, are automatically skipped." msgstr "Kataloger och FIFOs och andra filer som inte är vanliga filer hoppas över automatiskt." #. type: textblock #: dos2unix.pod:80 msgid "Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows." msgstr "Symboliska länkar och deras mål förblir oförändrade som standard. Symboliska länkar kan valfritt bli ersatta eller så kan utmatningen skrivas till målet för den symboliska länken. På Windows saknas stöd för att skriva till målet för en symbolisk länk." #. type: textblock #: dos2unix.pod:84 msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion." msgstr "Dos2unix modellerades efter dos2unix från SunOS/Solaris. Det finns en viktig skillnad gentemot originalversionen för SunOS/Solaris. Denna versionen gör som standard konverteringen på plats (gammalfilsläge), medan originalversionen från SunOS/Solaris bara hade stöd för parad konvertering (nyfilsläge). Se vidare flaggorna C<-o> och C<-n>. En annan skillnad är att SunOS/Solaris-versionen som standard använder I-lägeskonvertering medan denna version som standard använder I-lägeskonvertering." #. type: =head1 #: dos2unix.pod:92 msgid "OPTIONS" msgstr "FLAGGOR" #. type: =item #: dos2unix.pod:96 msgid "B<-->" msgstr "B<-->" #. type: textblock #: dos2unix.pod:98 msgid "Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named \"-foo\", you can use this command:" msgstr "Behandla alla efterföljande flaggor som filnamn. Använd denna flagga om du vill konvertera filer vars namn börjar med bindestreck. För att till exempel konvertera en fil med namnet “-foo“ kan du använda detta kommando:" #. type: verbatim #: dos2unix.pod:102 #, no-wrap msgid "" " dos2unix -- -foo\n" "\n" msgstr "" " dos2unix -- -foo\n" "\n" #. type: textblock #: dos2unix.pod:104 msgid "Or in new file mode:" msgstr "Eller i nyfilsläge:" #. type: verbatim #: dos2unix.pod:106 #, no-wrap msgid "" " dos2unix -n -- -foo out.txt\n" "\n" msgstr "" " dos2unix -n -- -foo out.txt\n" "\n" #. type: =item #: dos2unix.pod:108 msgid "B<-ascii>" msgstr "B<-ascii>" #. type: textblock #: dos2unix.pod:110 msgid "Convert only line breaks. This is the default conversion mode." msgstr "Konvertera enbart radbrytningar. Detta är standardkonverteringsläget." #. type: =item #: dos2unix.pod:112 msgid "B<-iso>" msgstr "B<-iso>" #. type: textblock #: dos2unix.pod:114 msgid "Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES." msgstr "Konvertering mellan DOS- och ISO-8859-1-teckentabeller. Se vidare stycket KONVERTERINGSLÄGEN." #. type: =item #: dos2unix.pod:117 msgid "B<-1252>" msgstr "B<-1252>" #. type: textblock #: dos2unix.pod:119 msgid "Use Windows code page 1252 (Western European)." msgstr "Använd Windows-teckentabell 1252 (Västeuropeisk)." #. type: =item #: dos2unix.pod:121 msgid "B<-437>" msgstr "B<-437>" #. type: textblock #: dos2unix.pod:123 msgid "Use DOS code page 437 (US). This is the default code page used for ISO conversion." msgstr "Använd DOS-teckentabell 437 (USA). Detta är standardteckentabellen som används för ISO-konvertering." #. type: =item #: dos2unix.pod:125 msgid "B<-850>" msgstr "B<-850>" #. type: textblock #: dos2unix.pod:127 msgid "Use DOS code page 850 (Western European)." msgstr "Använd DOS-teckentabell 850 (Västeuropeisk)." #. type: =item #: dos2unix.pod:129 msgid "B<-860>" msgstr "B<-860>" #. type: textblock #: dos2unix.pod:131 msgid "Use DOS code page 860 (Portuguese)." msgstr "Använd DOS-teckentabell 860 (Portugisisk)." #. type: =item #: dos2unix.pod:133 msgid "B<-863>" msgstr "B<-863>" #. type: textblock #: dos2unix.pod:135 msgid "Use DOS code page 863 (French Canadian)." msgstr "Använd DOS-teckentabell 863 (Fransk-kanadensisk)." #. type: =item #: dos2unix.pod:137 msgid "B<-865>" msgstr "B<-865>" #. type: textblock #: dos2unix.pod:139 msgid "Use DOS code page 865 (Nordic)." msgstr "Använd DOS-teckentabell 865 (Nordisk)." #. type: =item #: dos2unix.pod:141 msgid "B<-7>" msgstr "B<-7>" #. type: textblock #: dos2unix.pod:143 msgid "Convert 8 bit characters to 7 bit space." msgstr "Konvertera 8-bitars tecken till 7-bitars blanksteg." #. type: =item #: dos2unix.pod:145 msgid "B<-b, --keep-bom>" msgstr "B<-b, --keep-bom>" #. type: textblock #: dos2unix.pod:147 msgid "Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option C<-r>." msgstr "Behåll byteordningsmarkering (Byte Order Mark, BOM). Om infilen har en BOM, skriv en BOM i utfilen. Detta är standardbeteendet vid konvertering av DOS-radbrytningar. Se vidare flaggan C<-r>." #. type: =item #: dos2unix.pod:151 msgid "B<-c, --convmode CONVMODE>" msgstr "B<-c, --convmode KONVERTERINGSLÄGE>" #. type: textblock #: dos2unix.pod:153 msgid "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default." msgstr "Ställer in konverteringsläge. Där KONVERTERINGSLÄGE är en av: I, I<7bit>, I, I där ascii är standard." #. type: =item #: dos2unix.pod:157 msgid "B<-D, --display-enc ENCODING>" msgstr "B<-D, --display-enc KODNING>" #. type: textblock #: dos2unix.pod:159 msgid "Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default." msgstr "Ställ in kodning för visad text. Där KODNING är en av: I, I, I, I, I där ansi är standardvalet." #. type: textblock #: dos2unix.pod:163 msgid "This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed." msgstr "Denna flagga finns bara tillgänglig i dos2unix för Windows med stöd för Unicode-filnamn. Denna flagga har ingen effekt på själva filnamnen som läses och skrivs, bara på hur de visas." #. type: textblock #: dos2unix.pod:167 msgid "There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages." msgstr "Det finns flera metoder för att visa text i en Windows-konsol baserad på vilken kodning texten har. De har alla för- och nackdelar." #. type: =item #: dos2unix.pod:173 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:175 msgid "Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page." msgstr "Dos2unix standardmetod är att använda ANSI-kodad text. Fördelen är att den är bakåtkompatibel. Det fungerar med raster- och TrueType-teckensnitt. I vissa regioner kan du behöva ändra den aktiva DOS OEM-teckentabellen till Windows-systemets ANSI-teckentabell genom att använda kommandot C, eftersom dos2unix använder Windows-systemets teckentabell." #. type: textblock #: dos2unix.pod:181 msgid "The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK." msgstr "Nackdelen med ansi är att internationella filnamn med tecken som inte finns i systemets standardteckentabell inte visas korrekt. Du kommer att se frågetecken, eller en felaktig symbol istället. När du inte arbetar med utländska filnamn är denna metoden OK." #. type: =item #: dos2unix.pod:186 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:188 msgid "The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it." msgstr "Fördelen med unicode-kodning (Windows-namnet för UTF-16) är att text vanligtvis visas korrekt. Det finns inget behov av att ändra den aktiva teckentabellen. Du kan behöva ställa in konsolens teckensnitt till ett TrueType-teckensnitt för att få internationella tecken att visas korrekt. När ett tecken inte finns inkluderat i TrueType-teckensnittet kommer du vanligtvis att se en liten ruta, ibland med ett frågetecken inuti." #. type: textblock #: dos2unix.pod:194 msgid "When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font." msgstr "När du använder ConEmu-konsolen kommer all text att visas korrekt eftersom ConEmu automatiskt väljer ett bra teckensnitt." #. type: textblock #: dos2unix.pod:197 msgid "The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program." msgstr "Nackdelen med unicode är att den inte är kompatibel med ASCII. Utmatningen är inte lätt att hantera när du omdirigerar den till ett annat program eller en fil." #. type: textblock #: dos2unix.pod:200 msgid "When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "När metod C används kommer Unicode-texten att föregås av en BOM (byteordningsmarkering, Byte Order Mark). En BOM krävs för korrekt omdirigering eller rörledning i PowerShell." #. type: =item #: dos2unix.pod:205 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:207 msgid "The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding." msgstr "Fördelen med utf8 är att den är kompatibel med ASCII. Du måste ställa in konsolens teckensnitt till ett TrueType-teckensnitt. Med ett TrueType-teckensnitt kommer text att visas på liknande sätt som med C-kodningen." #. type: textblock #: dos2unix.pod:211 msgid "The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed." msgstr "Nackdelen är att när du använder standardrasterteckensnittet kommer alla icke-ASCII tecken att visas fel. Inte enbart unicode-filnamn, utan också översatta meddelanden kommer att bli oläsbara. Under Windows som konfigurerats för Östasien kan man komma att se många blinkningar i konsolen när meddelanden visas." #. type: textblock #: dos2unix.pod:217 msgid "In a ConEmu console the utf8 encoding method works well." msgstr "I ConEmu-konsolen fungerar utf8-kodningsmetoden väl." #. type: textblock #: dos2unix.pod:219 msgid "When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "När metod C används kommer UTF-8-texten att föregås av en BOM (byteordningsmarkering, Byte Order Mark). En BOM krävs för korrekt omdirigering eller rörledning i PowerShell." #. type: textblock #: dos2unix.pod:226 msgid "The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C." msgstr "Standardkodningen kan ändras via miljövariabeln DOS2UNIX_DISPLAY_ENC genom att sätta den till C, C, C or C." #. type: =item #: dos2unix.pod:229 msgid "B<-f, --force>" msgstr "B<-f, --force>" #. type: textblock #: dos2unix.pod:231 msgid "Force conversion of binary files." msgstr "Tvinga konvertering av binära filer." #. type: =item #: dos2unix.pod:233 msgid "B<-gb, --gb18030>" msgstr "B<-gb, --gb18030>" #. type: textblock #: dos2unix.pod:235 msgid "On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030." msgstr "Under Windows konverteras UTF-16-filer som standard till UTF-8, oavsett vilken lokalinställning som är gjord. Använd denna flagga för att konvertera UTF-16-filer till GB18030. Denna flagga finns bara tillgänglig i Windows. Se vidare i avsnittet GB18030." #. type: =item #: dos2unix.pod:239 msgid "B<-h, --help>" msgstr "B<-h, --help>" #. type: textblock #: dos2unix.pod:241 msgid "Display help and exit." msgstr "Visa hjälptext och avsluta." #. type: =item #: dos2unix.pod:243 msgid "B<-i[FLAGS], --info[=FLAGS] FILE ...>" msgstr "B<-i[FLAGGOR], --info[=FLAGGOR] FIL ...>" #. type: textblock #: dos2unix.pod:245 msgid "Display file information. No conversion is done." msgstr "Visa filinformation. Ingen konvertering görs." #. type: textblock #: dos2unix.pod:247 msgid "The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name." msgstr "Följande information skrivs ut, i denna ordningen: antal DOS-radbrytningar, antal Unix-radbrytningar, antal Mac-radbrytningar, byteordningsmarkeringen, text eller binär, filnamn." #. type: textblock #: dos2unix.pod:251 msgid "Example output:" msgstr "Exempelutmatning:" #. type: verbatim #: dos2unix.pod:253 #, no-wrap msgid "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" msgstr "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binär dos2unix.exe\n" "\n" #. type: textblock #: dos2unix.pod:262 msgid "Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>." msgstr "Notera att en binärfil ibland kan misstas för en textfil. Se vidare flaggan C<-s>." #. type: textblock #: dos2unix.pod:264 msgid "Optionally extra flags can be set to change the output. One or more flags can be added." msgstr "Extra flaggor kan användas valfritt för att ändra utmatningen. En eller fler flaggor kan läggas till." #. type: =item #: dos2unix.pod:269 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:271 msgid "Print number of DOS line breaks." msgstr "Skriv ut antal DOS-radbrytningar." #. type: =item #: dos2unix.pod:273 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:275 msgid "Print number of Unix line breaks." msgstr "Skriv ut antal Unix-radbrytningar." #. type: =item #: dos2unix.pod:277 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:279 msgid "Print number of Mac line breaks." msgstr "Skriv ut antal Mac-radbrytningar." #. type: =item #: dos2unix.pod:281 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:283 msgid "Print the byte order mark." msgstr "Skriv ut byteordningsmarkeringen." #. type: =item #: dos2unix.pod:285 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:287 msgid "Print if file is text or binary." msgstr "Skriv ut om filen är text eller binär." #. type: =item #: dos2unix.pod:289 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:291 msgid "Print only the files that would be converted." msgstr "Skriv bara ut filerna som skulle ha konverterats." #. type: textblock #: dos2unix.pod:293 msgid "With the C flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks." msgstr "Med C-flaggan kommer dos2unix att skriva ut filerna som innehåller DOS-radbrytningar, unix2dos kommer bara att skriva ut filnamn som har Unix-radbrytningar." #. type: =item #: dos2unix.pod:296 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:298 msgid "Print a header." msgstr "Skriv ut rubrik." #. type: =item #: dos2unix.pod:300 msgid "B

" msgstr "B

" #. type: textblock #: dos2unix.pod:302 msgid "Show file names without path." msgstr "Visa filnamn utan sökväg." #. type: textblock #: dos2unix.pod:306 msgid "Examples:" msgstr "Exempel:" #. type: textblock #: dos2unix.pod:308 msgid "Show information for all *.txt files:" msgstr "Visa information för alla *.txt-filer:" #. type: verbatim #: dos2unix.pod:310 #, no-wrap msgid "" " dos2unix -i *.txt\n" "\n" msgstr "" " dos2unix -i *.txt\n" "\n" #. type: textblock #: dos2unix.pod:312 msgid "Show only the number of DOS line breaks and Unix line breaks:" msgstr "Visa bara antalet DOS-radbrytningar och Unix-radbrytningar:" #. type: verbatim #: dos2unix.pod:314 #, no-wrap msgid "" " dos2unix -idu *.txt\n" "\n" msgstr "" " dos2unix -idu *.txt\n" "\n" #. type: textblock #: dos2unix.pod:316 msgid "Show only the byte order mark:" msgstr "Visa bara byteordningsmarkeringen:" #. type: verbatim #: dos2unix.pod:318 #, no-wrap msgid "" " dos2unix --info=b *.txt\n" "\n" msgstr "" " dos2unix --info=b *.txt\n" "\n" #. type: textblock #: dos2unix.pod:320 msgid "List the files that have DOS line breaks:" msgstr "Lista filerna som har DOS-radbrytningar:" #. type: verbatim #: dos2unix.pod:322 #, no-wrap msgid "" " dos2unix -ic *.txt\n" "\n" msgstr "" " dos2unix -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:324 msgid "List the files that have Unix line breaks:" msgstr "Lista filerna som har Unix-radbrytningar:" #. type: verbatim #: dos2unix.pod:326 #, no-wrap msgid "" " unix2dos -ic *.txt\n" "\n" msgstr "" " unix2dos -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:328 msgid "Convert only files that have DOS line breaks and leave the other files untouched:" msgstr "Konvertera endast filer som har DOS-radbrytningar och lämna övriga filer orörda:" #. type: verbatim #: dos2unix.pod:330 #, no-wrap msgid "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:332 msgid "Find text files that have DOS line breaks:" msgstr "Hitta textfiler som har DOS-radbrytningar:" #. type: verbatim #: dos2unix.pod:334 #, no-wrap msgid "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" msgstr "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" #. type: =item #: dos2unix.pod:336 msgid "B<-k, --keepdate>" msgstr "B<-k, --keepdate>" #. type: textblock #: dos2unix.pod:338 msgid "Keep the date stamp of output file same as input file." msgstr "Behåll infilens datumstämpel för utfilen." #. type: =item #: dos2unix.pod:340 msgid "B<-L, --license>" msgstr "B<-L, --license>" #. type: textblock #: dos2unix.pod:342 msgid "Display program's license." msgstr "Visa programmets licens." #. type: =item #: dos2unix.pod:344 msgid "B<-l, --newline>" msgstr "B<-l, --newline>" #. type: textblock #: dos2unix.pod:346 msgid "Add additional newline." msgstr "Lägg till ytterligare nyrad." #. type: textblock #: dos2unix.pod:348 msgid "B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks." msgstr "B: Endast DOS-radbrytningar ändras till två Unix-radbrytningar. I Mac-läge ändras endast Mac-radbrytningar till två Unix-radbrytningar." #. type: textblock #: dos2unix.pod:352 msgid "B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks." msgstr "B: Endast Unix-radbrytningar ändras till två DOS-radbrytningar. I Mac-läge ändras Unix-radbrytningar till två Mac-radbrytningar." #. type: =item #: dos2unix.pod:355 msgid "B<-m, --add-bom>" msgstr "B<-m, --add-bom>" #. type: textblock #: dos2unix.pod:357 msgid "Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written." msgstr "Skriv en byteordningsmarkering (Byte Order Mark, BOM) i utfilen. Som standard skrivs en UTF-8 BOM." #. type: textblock #: dos2unix.pod:360 msgid "When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM will be written." msgstr "När infilen är UTF-16, och flaggan C<-u> används, kommer en UTF-16 BOM att skrivas." #. type: textblock #: dos2unix.pod:363 msgid "Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE." msgstr "Använd aldrig denna flagga när kodningen för utmatning är något annat än UTF-8, UTF-16 eller GB18030. Se vidare i avsnittet UNICODE." #. type: =item #: dos2unix.pod:367 msgid "B<-n, --newfile INFILE OUTFILE ...>" msgstr "B<-n, --newfile INFIL UTFIL …>" #. type: textblock #: dos2unix.pod:369 msgid "New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files." msgstr "Nyfilsläge. Konvertera filen INFIL och skriv utfilen UTFIL. Filnamnen måste ange i par och jokertecken i namnen ska I användas annars I du att förlora filer." #. type: textblock #: dos2unix.pod:373 msgid "The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion." msgstr "Användaren som påbörjar konverteringen i nyfilsläge (parat läge) kommer att bli ägaren till den konverterade filen. Läs-/skrivbehörigheter för den nya filen kommer att vara samma behörigheter som för originalfilen minus umask(1) för användaren som kör konverteringen." #. type: =item #: dos2unix.pod:378 msgid "B<-o, --oldfile FILE ...>" msgstr "B<-o, --oldfile FIL …>" #. type: textblock #: dos2unix.pod:380 msgid "Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used." msgstr "Gammalfilsläge. Konvertera filen FIL och skriv över den med utmatningen. Programmet kör i detta läge som standard. Jokertecken i filnamn får användas." #. type: textblock #: dos2unix.pod:383 msgid "In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix." msgstr "I gammalfilsläge (på-plats läge) kommer den konverterade filen att få samma ägare, grupp samt läs-/skrivbehörigheter som originalfilen. Även då filen konverteras av en annan användare som har skrivbehörighet för filen (t.ex. användaren root). Konverteringen kommer att avbrytas när det inte är möjligt att bevara originalvärdena. Byte av ägare skulle kunna innebära att originalägaren inte längre kan läsa filen. Byte av grupp skulle kunna vara en säkerhetsrisk, filen skulle kunna bli läsbar för användare som den inte är avsedd för. Stöd för bevarande av ägare, grupp och läs-/skrivbehörigheter finns bara i Unix." #. type: =item #: dos2unix.pod:392 msgid "B<-q, --quiet>" msgstr "B<-q, --quiet>" #. type: textblock #: dos2unix.pod:394 msgid "Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used." msgstr "Tyst drift. Undertryck alla varningar och meddelanden. Returvärdet är noll. Utom när felaktiga kommandoradsflaggor används." #. type: =item #: dos2unix.pod:397 msgid "B<-r, --remove-bom>" msgstr "B<-r, --remove-bom>" #. type: textblock #: dos2unix.pod:399 msgid "Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option C<-b>." msgstr "Ta bort byteordningsmarkering (Byte Order Mark, BOM). Skriv inte en BOM i utfilen. Detta är standardbeteende vid konvertering av Unix-radbrytningar. Se vidare flaggan C<-b>." #. type: =item #: dos2unix.pod:403 msgid "B<-s, --safe>" msgstr "B<-s, --safe>" #. type: textblock #: dos2unix.pod:405 msgid "Skip binary files (default)." msgstr "Hoppa över binära filer (standard)." #. type: textblock #: dos2unix.pod:407 msgid "The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file." msgstr "Binärfiler hoppas över för att undvika oavsiktliga misstag. Var medveten om att detektering av binärfiler inte är 100% säker. Infiler genomsöks efter binära symboler som typiskt inte återfinns i textfiler. Det är möjligt att en binärfil enbart innehåller texttecken. En sådan binärfil kommer oavsiktligt att ses som en textfil." #. type: =item #: dos2unix.pod:413 msgid "B<-u, --keep-utf16>" msgstr "B<-u, --keep-utf16>" #. type: textblock #: dos2unix.pod:415 msgid "Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the C<-ascii> option." msgstr "Behåll infilens original UTF-16-kodning. Utfilen kommer att skrivas med samma UTF-16-kodning som infilen, omvänd eller rak byteordning (little eller big endian). Detta förhindrar transformation till UTF-8. En UTF-16 BOM kommer att skrivas i enlighet med detta. Denna flagga kan inaktiveras med C<-ascii>-flaggan." #. type: =item #: dos2unix.pod:420 msgid "B<-ul, --assume-utf16le>" msgstr "B<-ul, --assume-utf16le>" #. type: textblock #: dos2unix.pod:422 msgid "Assume that the input file format is UTF-16LE." msgstr "Antag att infilsformatet är UTF-16LE." #. type: textblock #: dos2unix.pod:424 msgid "When there is a Byte Order Mark in the input file the BOM has priority over this option." msgstr "När det finns en byteordningsmarkering (Byte Order Mark) i infilen så har BOM:en högre prioritet än denna flagga." #. type: textblock #: dos2unix.pod:427 msgid "When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file." msgstr "När du har gjort fel antagande (infilen var inte i UTF-16LE-format) och konverteringens lyckas, kommer du att få en UTF-8 utfil med felaktig text. Du kan göra denna konvertering ogjord med iconv(1) genom att konvertera UTF-8 utfilen tillbaka till UTF-16LE. Detta kommer att återskapa originalfilen." #. type: textblock #: dos2unix.pod:432 msgid "The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off." msgstr "Antagandet om UTF-16LE fungerar som ett I. Genom att växla till standard I-läget kommer UTF-16LE antagandet att stängas av." #. type: =item #: dos2unix.pod:435 msgid "B<-ub, --assume-utf16be>" msgstr "B<-ub, --assume-utf16be>" #. type: textblock #: dos2unix.pod:437 msgid "Assume that the input file format is UTF-16BE." msgstr "Antag att infilsformatet är UTF-16BE." #. type: textblock #: dos2unix.pod:439 msgid "This option works the same as option C<-ul>." msgstr "Denna flagga fungerar på samma sätt som flaggan C<-ul>." #. type: =item #: dos2unix.pod:441 msgid "B<-v, --verbose>" msgstr "B<-v, --verbose>" #. type: textblock #: dos2unix.pod:443 msgid "Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks." msgstr "Visa utförliga meddelanden. Extra information visas om byteordningsmarkeringar och antalet konverterade radbrytningar." #. type: =item #: dos2unix.pod:446 msgid "B<-F, --follow-symlink>" msgstr "B<-F, --follow-symlink>" #. type: textblock #: dos2unix.pod:448 msgid "Follow symbolic links and convert the targets." msgstr "Följ symboliska länkar och konvertera målen." #. type: =item #: dos2unix.pod:450 msgid "B<-R, --replace-symlink>" msgstr "B<-R, --replace-symlink>" #. type: textblock #: dos2unix.pod:452 msgid "Replace symbolic links with converted files (original target files remain unchanged)." msgstr "Ersätt symboliska länkar med konverterade filer (originalmålfilerna förblir oförändrade)." #. type: =item #: dos2unix.pod:455 msgid "B<-S, --skip-symlink>" msgstr "B<-S, --skip-symlink>" #. type: textblock #: dos2unix.pod:457 msgid "Keep symbolic links and targets unchanged (default)." msgstr "Behåll symboliska länkar och mål oförändrade (standard)." #. type: =item #: dos2unix.pod:459 msgid "B<-V, --version>" msgstr "B<-V, --version>" #. type: textblock #: dos2unix.pod:461 msgid "Display version information and exit." msgstr "Visa versionsinformation och avsluta." #. type: =head1 #: dos2unix.pod:465 msgid "MAC MODE" msgstr "MAC-LÄGE" #. type: textblock #: dos2unix.pod:467 msgid "In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted." msgstr "I normalläge konverteras radbrytningar från DOS till Unix och vice versa. Mac-radbrytningar konverteras inte." #. type: textblock #: dos2unix.pod:470 msgid "In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed." msgstr "I Mac-läge konverteras radbrytningar från Mac till Unix och vice versa. DOS-radbrytningar ändras ej." #. type: textblock #: dos2unix.pod:473 msgid "To run in Mac mode use the command-line option C<-c mac> or use the commands C or C." msgstr "För att köra i Mac-läge använd kommandoradsflaggan C<-c mac> eller använd kommandona C eller C." #. type: =head1 #: dos2unix.pod:476 msgid "CONVERSION MODES" msgstr "KONVERTERINGSLÄGEN" #. type: =item #: dos2unix.pod:480 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:482 msgid "In mode C only line breaks are converted. This is the default conversion mode." msgstr "I läget C konverteras enbart radbrytningar. Detta är standardkonverteringsläget." #. type: textblock #: dos2unix.pod:485 msgid "Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files." msgstr "Även om namnet på detta läge är ASCII, vilket är en 7-bitarsstandard, så är det läget egentligen ett 8-bitarsläge. Använd alltid detta läge vid konvertering av Unicode UTF-8-filer." #. type: =item #: dos2unix.pod:489 msgid "B<7bit>" msgstr "B<7bit>" #. type: textblock #: dos2unix.pod:491 msgid "In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space." msgstr "I detta läge konverteras alla 8-bitars icke-ASCII tecken (med värden från 128 till 255) till ett 7-bitars blanksteg." #. type: =item #: dos2unix.pod:494 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:496 msgid "Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart." msgstr "Tecken konverteras mellan DOS teckenuppsättning (teckentabell) och ISO teckenuppsättning ISO-8859-1 (Latin-1) på Unix. DOS tecken utan motsvarande ISO-8859-1 tecken, för vilka konvertering är omöjligt, kommer att ersättas med en punkt. Detsamma gäller för ISO-8859-1 tecken utan motsvarighet i DOS." #. type: textblock #: dos2unix.pod:501 msgid "When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings." msgstr "När enbart flaggan C<-iso> används kommer dos2unix att försöka avgöra den aktiva teckentabellen. När detta inte är möjligt kommer dos2unix att använda standardteckentabellen CP437, vilken huvudsakligen används i USA. För att tvinga en specifik teckentabell använd flaggorna C<-437> (USA), C<-850> (Västeuropeisk), C<-860> (Portugisisk), C<-863> (Fransk-kanadensisk) eller C<-865> (Nordisk). Det finns också stöd för Windows-teckentabell CP-1252 (Västeuropeisk) via flaggan C<-1252>. För andra teckentabeller använd dos2unix i kombination med iconv(1). iconv kan konvertera mellan en lång lista av teckenkodningar." #. type: textblock #: dos2unix.pod:510 msgid "Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files." msgstr "Använd aldrig ISO-konvertering på Unicode-textfiler. Det kommer att korrumpera UTF-8-kodade filer." #. type: textblock #: dos2unix.pod:512 msgid "Some examples:" msgstr "Några exempel:" #. type: textblock #: dos2unix.pod:514 msgid "Convert from DOS default code page to Unix Latin-1:" msgstr "Konvertera från DOS standardteckentabell till Unix Latin-1:" #. type: verbatim #: dos2unix.pod:516 #, no-wrap msgid "" " dos2unix -iso -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -iso -n in.txt ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:518 msgid "Convert from DOS CP850 to Unix Latin-1:" msgstr "Konvertera från DOS CP850 till Unix Latin-1:" #. type: verbatim #: dos2unix.pod:520 #, no-wrap msgid "" " dos2unix -850 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -850 -n in.txt ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:522 msgid "Convert from Windows CP1252 to Unix Latin-1:" msgstr "Konvertera från Windows CP1252 till Unix Latin-1:" #. type: verbatim #: dos2unix.pod:524 #, no-wrap msgid "" " dos2unix -1252 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -1252 -n in.txt ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:526 msgid "Convert from Windows CP1252 to Unix UTF-8 (Unicode):" msgstr "Konvertera från Windows CP1252 till Unix UTF-8 (Unicode):" #. type: verbatim #: dos2unix.pod:528 #, no-wrap msgid "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" msgstr "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:530 msgid "Convert from Unix Latin-1 to DOS default code page:" msgstr "Konvertera från Unix Latin-1 till DOS-standardteckentabell:" #. type: verbatim #: dos2unix.pod:532 #, no-wrap msgid "" " unix2dos -iso -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -iso -n in.txt ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:534 msgid "Convert from Unix Latin-1 to DOS CP850:" msgstr "Konvertera från Unix Latin-1 till DOS CP850:" #. type: verbatim #: dos2unix.pod:536 #, no-wrap msgid "" " unix2dos -850 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -850 -n in.txt ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:538 msgid "Convert from Unix Latin-1 to Windows CP1252:" msgstr "Konvertera från Unix Latin-1 till Windows CP1252:" #. type: verbatim #: dos2unix.pod:540 #, no-wrap msgid "" " unix2dos -1252 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -1252 -n in.txt ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:542 msgid "Convert from Unix UTF-8 (Unicode) to Windows CP1252:" msgstr "Konvertera från Unix UTF-8 (Unicode) till Windows CP1252:" #. type: verbatim #: dos2unix.pod:544 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:546 msgid "See also L and L." msgstr "Se även L och L." #. type: =head1 #: dos2unix.pod:551 msgid "UNICODE" msgstr "UNICODE" #. type: =head2 #: dos2unix.pod:553 msgid "Encodings" msgstr "Kodningar" #. type: textblock #: dos2unix.pod:555 msgid "There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format." msgstr "Det finns flera olika Unicode kodningar. I Unix och Linux kodas filer vanligtvis med UTF-8-kodning. I Windows kan Unicode-textfiler kodas i UTF-8, UTF-16 eller UTF-16 rak byteordning (big endian), men kodas mestadels i UTF-16-format." #. type: =head2 #: dos2unix.pod:560 msgid "Conversion" msgstr "Konvertering" #. type: textblock #: dos2unix.pod:562 msgid "Unicode text files can have DOS, Unix or Mac line breaks, like regular text files." msgstr "Unicode-textfiler kan ha DOS, Unix eller Mac-radbrytningar precis som vanliga textfiler." #. type: textblock #: dos2unix.pod:565 msgid "All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII." msgstr "Alla versioner av dos2unix och unix2dos kan konvertera UTF-8-kodade filer, eftersom UTF-8 designades för bakåtkompatibilitet med ASCII." #. type: textblock #: dos2unix.pod:568 msgid "Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C." msgstr "Dos2unix och unix2dos med Unicode-UTF-16-stöd, kan läsa UTF-16-kodade textfiler i omvänd och rak byteordning (little och big endian). För att se om dos2unix byggts med UTF-16-stöd skriv C." #. type: textblock #: dos2unix.pod:572 msgid "On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped." msgstr "Under Unix/Linux kommer UTF-16-kodade filer att konverteras till lokalens teckenkodning. Använd kommandot locale(1) för att ta reda på vilken lokalens teckenkodning är. När konvertering inte är möjlig kommer ett konverteringsfel att inträffa och filen kommer att hoppas över." #. type: textblock #: dos2unix.pod:577 msgid "On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux." msgstr "Under Windows konverteras UTF-16-filer som standard till UTF-8. UTF-8-formaterade textfiler har bra stöd både under Windows och Unix/Linux." #. type: textblock #: dos2unix.pod:580 msgid "UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." msgstr "UTF-16- och UTF-8-kodning är fullt kompatibla, ingen text kommer att gå förlorad i konverteringen. När ett UTF-16 till UTF-8-konverteringsfel uppstår, till exempel när infilen i UTF-16-format innehåller ett fel, kommer att filen att hoppas över." #. type: textblock #: dos2unix.pod:584 msgid "When option C<-u> is used, the output file will be written in the same UTF-16 encoding as the input file. Option C<-u> prevents conversion to UTF-8." msgstr "När flaggan C<-u> används kommer utfilen att skrivas med samma UTF-16-kodning som infilen. Flaggan C<-u> förhindrar konvertering till UTF-8." #. type: textblock #: dos2unix.pod:587 msgid "Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16." msgstr "Dos2unix och unix2dos har ingen flagga för att konvertera UTF-8-filer till UTF-16." #. type: textblock #: dos2unix.pod:589 msgid "ISO and 7-bit mode conversion do not work on UTF-16 files." msgstr "ISO- och 7-bitarslägeskonvertering fungerar inte på UTF-16-filer." #. type: =head2 #: dos2unix.pod:591 msgid "Byte Order Mark" msgstr "Byteordningsmarkering (Byte Order Mark)" #. type: textblock #: dos2unix.pod:593 msgid "On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L." msgstr "I Windows har Unicode-textfiler typiskt en byteordningsmarkering (Byte Order Mark, BOM) eftersom många Windows-program (inklusive Notepad) lägger till BOM:ar som standard. Se även L." #. type: textblock #: dos2unix.pod:597 msgid "On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding." msgstr "I Unix har Unicode-textfiler typiskt ingen BOM. Filer antas vara kodade i den lokala teckenuppsättningen." #. type: textblock #: dos2unix.pod:600 msgid "Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file." msgstr "Dos2Unix kan bara detektera om en fil är i UTF-16-format om filen har en BOM. När en UTF-16-fil inte har en BOM så kommer dos2unix att de filen som en binärfil." #. type: textblock #: dos2unix.pod:604 msgid "Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM." msgstr "Använd flaggan C<-ul> eller C<-ub> för att konvertera en UTF-16-fil utan BOM." #. type: textblock #: dos2unix.pod:606 msgid "Dos2unix writes by default no BOM in the output file. With option C<-b> Dos2unix writes a BOM when the input file has a BOM." msgstr "Dos2unix skriver som standard ingen BOM i utfilen. Med flaggan C<-b> kommer Dos2unix att skriva en BOM när infilen har en BOM." #. type: textblock #: dos2unix.pod:609 msgid "Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option C<-r> to remove the BOM." msgstr "Unix2dos skriver som standard en BOM i utfilen när infilen har en BOM. Använd flaggan C<-r> för att ta bort BOM:en." #. type: textblock #: dos2unix.pod:612 msgid "Dos2unix and unix2dos write always a BOM when option C<-m> is used." msgstr "Dos2unix och unix2dos skriver alltid en BOM när flaggan C<-m> används." #. type: =head2 #: dos2unix.pod:614 msgid "Unicode file names on Windows" msgstr "Unicode-filnamn under Windows" #. type: textblock #: dos2unix.pod:616 msgid "Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C." msgstr "Dos2unix har valfritt stöd för läsning och skrivning av Unicode-filnamn i Windows kommandoprompt. Detta innebär att dos2unix kan öppna filer som har tecken i sina namn som inte är en del av systemets atandard ANSI-teckentabell. För att se om dos2unix för Windows byggdes med stöd för Unicode-filnamn skriv C." #. type: textblock #: dos2unix.pod:622 msgid "There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name." msgstr "Det finns en del problem med att visa Unicode-filnamn i en Windows-konsol. Se vidare flaggan C<-D>, C<--display-enc>. Filnamnen kan visas felaktigt i konsolen, men filerna som skrivs kommer att ha de korrekta namnen." #. type: =head2 #: dos2unix.pod:626 msgid "Unicode examples" msgstr "Unicode-exempel" #. type: textblock #: dos2unix.pod:628 msgid "Convert from Windows UTF-16 (with BOM) to Unix UTF-8:" msgstr "Konvertera från Windows UTF-16 (med BOM) till Unix UTF-8:" #. type: verbatim #: dos2unix.pod:630 #, no-wrap msgid "" " dos2unix -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -n in.txt ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:632 msgid "Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:" msgstr "Konvertera från Windows UTF-16LE (utan BOM) till Unix UTF-8:" #. type: verbatim #: dos2unix.pod:634 #, no-wrap msgid "" " dos2unix -ul -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -ul -n in.txt ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:636 msgid "Convert from Unix UTF-8 to Windows UTF-8 with BOM:" msgstr "Konvertera från Unix UTF-8 till Windows UTF-8 med BOM:" #. type: verbatim #: dos2unix.pod:638 #, no-wrap msgid "" " unix2dos -m -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -m -n in.txt ut.txt\n" "\n" #. type: textblock #: dos2unix.pod:640 msgid "Convert from Unix UTF-8 to Windows UTF-16:" msgstr "Konvertera från Unix UTF-8 till Windows UTF-16:" #. type: verbatim #: dos2unix.pod:642 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > ut.txt\n" "\n" #. type: =head1 #: dos2unix.pod:644 msgid "GB18030" msgstr "GB18030" #. type: textblock #: dos2unix.pod:646 msgid "GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also L." msgstr "GB18030 är en standard från Kinesiska regeringen. En obligatorisk delmängd av standarden GB18030 krävs officiellt för alla programvaruprodukter som säljs i Kina. Se vidare L." #. type: textblock #: dos2unix.pod:650 msgid "GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK." msgstr "GB18030 är fullständigt kompatibel med Unicode och kan anses vara ett överföringsformat för unicode. Precis som UTF-8 är GB18030 kompatibel med ASCII. GB18030 är också kompatibel med Windows-teckentabell 936, också känd som GBK." #. type: textblock #: dos2unix.pod:654 msgid "On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command C to get the list of supported locales." msgstr "Under Unix/Linux kommer UTF-16-filer att konverteras till GB18030 när lokalens teckenkodning är inställd på GB18030. Notera att detta endast kommer att fungera om lokalen har stöd i systemet. Använd kommandot C för att få en lista över de lokaler som stöds." #. type: textblock #: dos2unix.pod:658 msgid "On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030." msgstr "Under Windows måste du använda flaggan C<-gb> för att konvertera UTF-16-filer till GB18030." #. type: textblock #: dos2unix.pod:660 msgid "GB18030 encoded files can have a Byte Order Mark, like Unicode files." msgstr "GB18030-kodade filer kan ha en byteordningsmarkering, precis som Unicode-filer." #. type: =head1 #: dos2unix.pod:662 msgid "EXAMPLES" msgstr "EXEMPEL" #. type: textblock #: dos2unix.pod:664 msgid "Read input from 'stdin' and write output to 'stdout':" msgstr "Läsa inmatning från “stdin“ och skriv utmatning till “stdout“:" #. type: verbatim #: dos2unix.pod:666 #, fuzzy, no-wrap #| msgid "" #| " dos2unix -ic *.txt | xargs dos2unix\n" #| "\n" msgid "" " dos2unix < a.txt\n" " cat a.txt | dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:669 msgid "Convert and replace a.txt. Convert and replace b.txt:" msgstr "Konvertera och ersätta a.txt. Konvertera och ersätt b.txt:" #. type: verbatim #: dos2unix.pod:671 #, no-wrap msgid "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" msgstr "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" #. type: textblock #: dos2unix.pod:674 msgid "Convert and replace a.txt in ascii conversion mode:" msgstr "Konvertera och ersätt a.txt i ascii-konverteringsläge:" #. type: verbatim #: dos2unix.pod:676 #, no-wrap msgid "" " dos2unix a.txt\n" "\n" msgstr "" " dos2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:678 msgid "Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode:" msgstr "Konvertera och ersätt a.txt i ascii-konverteringsläge, konvertera och ersätt b.txt i 7bit-konverteringsläge:" #. type: verbatim #: dos2unix.pod:681 #, no-wrap msgid "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" msgstr "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" #. type: textblock #: dos2unix.pod:685 msgid "Convert a.txt from Mac to Unix format:" msgstr "Konvertera a.txt från Mac- till Unix-format:" #. type: verbatim #: dos2unix.pod:687 #, no-wrap msgid "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" msgstr "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:690 msgid "Convert a.txt from Unix to Mac format:" msgstr "Konvertera a.txt från Unix- till Mac-format:" #. type: verbatim #: dos2unix.pod:692 #, no-wrap msgid "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" msgstr "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" #. type: textblock #: dos2unix.pod:695 msgid "Convert and replace a.txt while keeping original date stamp:" msgstr "Konvertera och ersätt a.txt medan originalet tidsstämpel behålls:" #. type: verbatim #: dos2unix.pod:697 #, no-wrap msgid "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" msgstr "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" #. type: textblock #: dos2unix.pod:700 msgid "Convert a.txt and write to e.txt:" msgstr "Konvertera a.txt och skriv till e.txt:" #. type: verbatim #: dos2unix.pod:702 #, no-wrap msgid "" " dos2unix -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:704 msgid "Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:" msgstr "Konvertera a.txt och skriv till e.txt, låt e.txt behålla tidsstämpeln från a.txt:" #. type: verbatim #: dos2unix.pod:706 #, no-wrap msgid "" " dos2unix -k -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -k -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:708 msgid "Convert and replace a.txt, convert b.txt and write to e.txt:" msgstr "Konvertera och ersätt a.txt, konvertera b.txt och skriv till e.txt:" #. type: verbatim #: dos2unix.pod:710 #, no-wrap msgid "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" msgstr "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:713 msgid "Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt:" msgstr "Konvertera c.txt och skriv till e.txt, konvertera och ersätt a.txt, konvertera och ersätt b.txt, konvertera d.txt och skriv till f.txt:" #. type: verbatim #: dos2unix.pod:716 #, no-wrap msgid "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" msgstr "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" #. type: =head1 #: dos2unix.pod:718 msgid "RECURSIVE CONVERSION" msgstr "REKURSIV KONVERTERING" #. type: textblock #: dos2unix.pod:720 msgid "Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type:" msgstr "Använd dos2unix i kombination med kommandona find(1) och xargs(1) för att rekursivt konvertera filer i en katalogstruktur. För att till exempel konvertera alla .txt-filer i katalogträdet under den aktuella katalogen skriv:" #. type: verbatim #: dos2unix.pod:724 #, no-wrap msgid "" " find . -name '*.txt' |xargs dos2unix\n" "\n" msgstr "" " find . -name '*.txt' |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:726 msgid "In a Windows Command Prompt the following command can be used:" msgstr "I en Windows-kommandoprompt kan följande kommando användas:" #. type: verbatim #: dos2unix.pod:728 #, no-wrap msgid "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" msgstr "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" #. type: textblock #: dos2unix.pod:730 msgid "PowerShell users can use the following command in Windows PowerShell:" msgstr "PowerShell-användare kan använda följande kommando i Windows PowerShell:" #. type: verbatim #: dos2unix.pod:732 #, no-wrap msgid "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" msgstr "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" #. type: =head1 #: dos2unix.pod:735 msgid "LOCALIZATION" msgstr "LOKALISERING" #. type: =item #: dos2unix.pod:739 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:741 msgid "The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:" msgstr "Det primära språket väljs med miljövariabeln LANG. LANG-variabeln består av flera delas. Den första delen är språkkoden i gemener. Den andra delen är valfri och utgör landskoden i versaler, föregången av ett understreck. Det finns också en valfri tredje del: teckenkodning, föregången av en punkt. Ett par exempel för skal av POSIX-standard-typ:" #. type: verbatim #: dos2unix.pod:748 #, no-wrap msgid "" " export LANG=nl Dutch\n" " export LANG=nl_NL Dutch, The Netherlands\n" " export LANG=nl_BE Dutch, Belgium\n" " export LANG=es_ES Spanish, Spain\n" " export LANG=es_MX Spanish, Mexico\n" " export LANG=en_US.iso88591 English, USA, Latin-1 encoding\n" " export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding\n" "\n" msgstr "" " export LANG=nl Nederländska\n" " export LANG=nl_NL Nederländska, Nederländerna\n" " export LANG=nl_BE Nederländska, Belgien\n" " export LANG=es_ES Spanska, Spanien\n" " export LANG=es_MX Spanska, Mexiko\n" " export LANG=en_US.iso88591 Engelska, USA, Latin-1-kodning\n" " export LANG=en_GB.UTF-8 Engelska, UK, UTF-8-kodning\n" "\n" #. type: textblock #: dos2unix.pod:756 msgid "For a complete list of language and country codes see the gettext manual: L" msgstr "För en fullständig lista över språk och landskoder se vidare i gettext-manualen: L" #. type: textblock #: dos2unix.pod:759 msgid "On Unix systems you can use the command locale(1) to get locale specific information." msgstr "På Unix-system kan du använda kommando locale(1) för att få lokal-specifik information." #. type: =item #: dos2unix.pod:762 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:764 msgid "With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than \"C\", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L" msgstr "Med miljövariabeln LANGUAGE kan du ange en prioritetslista över språk, separerade med kolon. Dos2unix kommer att ge företräde till LANGAUGE över LANG. Exempelvis först nederländska och sedan tyska: C. Du måste först ha aktiverat lokalisering, genom att sätta LANG (eller LC_ALL) till ett värde annat än “C“, innan du kan använda en prioritetslista för språk via LANGUAGE-variabeln. Se vidare i gettext-manualen: L" #. type: textblock #: dos2unix.pod:772 msgid "If you select a language which is not available you will get the standard English messages." msgstr "Om du väljer ett språk som inte är tillgänglig kommer du att få engelska meddelanden som standard." #. type: =item #: dos2unix.pod:776 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:778 msgid "With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used." msgstr "Med miljövariabeln DOS2UNIX_LOCALEDIR kan LOCALEDIR som ställts in vid kompilering åsidosättas. LOCALEDIR används för att hitta språkfiler. Standardvärdet för GNU-program är C. Flaggan B<--version> kommer att visa vilken LOCALEDIR som används." #. type: textblock #: dos2unix.pod:783 msgid "Example (POSIX shell):" msgstr "Exempel (POSIX-skal):" #. type: verbatim #: dos2unix.pod:785 #, no-wrap msgid "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" msgstr "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" #. type: =head1 #: dos2unix.pod:790 msgid "RETURN VALUE" msgstr "RETURVÄRDE" #. type: textblock #: dos2unix.pod:792 msgid "On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned." msgstr "Om allt går bra kommer noll att returneras. När ett systemfel uppstår kommer det senaste systemfelet att returneras. För andra fel kommer 1 att returneras." #. type: textblock #: dos2unix.pod:795 msgid "The return value is always zero in quiet mode, except when wrong command-line options are used." msgstr "Returvärdet är alltid noll i tyst läge, utom när felaktiga kommandoradsflaggor används." #. type: =head1 #: dos2unix.pod:798 msgid "STANDARDS" msgstr "STANDARDER" #. type: textblock #: dos2unix.pod:800 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:802 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:804 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:806 msgid "L" msgstr "L" #. type: =head1 #: dos2unix.pod:808 msgid "AUTHORS" msgstr "FÖRFATTARE" #. type: textblock #: dos2unix.pod:810 msgid "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer)" msgstr "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix-läge) - , Christian Wurll (lägg till en extra radbrytning) - , Erwin Waterlander - (upphovsman)" #. type: textblock #: dos2unix.pod:815 msgid "Project page: L" msgstr "Projektsida: L" #. type: textblock #: dos2unix.pod:817 msgid "SourceForge page: L" msgstr "SourceForge-sida: L" #. type: =head1 #: dos2unix.pod:819 msgid "SEE ALSO" msgstr "SE ÄVEN" #. type: textblock #: dos2unix.pod:821 msgid "file(1) find(1) iconv(1) locale(1) xargs(1)" msgstr "file(1) find(1) iconv(1) locale(1) xargs(1)" #~ msgid "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgstr "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" dos2unix-7.3.4/po-man/uk.po0000644000175500010010000026305712721132543014732 0ustar waterlanGeen# Ukrainian translation of dos2unix-man # Copyright (C) 2014 Erwin Waterlander (msgids) # Copyright (C) 2014 Free Software Foundation, Inc. # This file is distributed under the same license as the dos2unix package. # # Yuri Chornoivan , 2014, 2015, 2016. msgid "" msgstr "" "Project-Id-Version: dos2unix-man 7.3.3-beta9\n" "POT-Creation-Date: 2016-02-11 20:33+0100\n" "PO-Revision-Date: 2016-02-06 14:39+0200\n" "Last-Translator: Yuri Chornoivan \n" "Language-Team: Ukrainian \n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Lokalize 1.5\n" #. type: =head1 #: dos2unix.pod:52 msgid "NAME" msgstr "НАЗВА" #. type: textblock #: dos2unix.pod:54 msgid "dos2unix - DOS/Mac to Unix and vice versa text file format converter" msgstr "dos2unix - програма для перетворення даних у текстовому форматі DOS/Mac у формат Unix, і навпаки" #. type: =head1 #: dos2unix.pod:56 msgid "SYNOPSIS" msgstr "КОРОТКИЙ ОПИС" #. type: verbatim #: dos2unix.pod:58 #, no-wrap msgid "" " dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]\n" " unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]\n" "\n" msgstr "" " dos2unix [параметри] [ФАЙЛ ...] [-n ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...]\n" " unix2dos [параметри] [ФАЙЛ ...] [-n ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...]\n" "\n" #. type: =head1 #: dos2unix.pod:61 msgid "DESCRIPTION" msgstr "ОПИС" #. type: textblock #: dos2unix.pod:63 msgid "The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa." msgstr "До складу пакунка Dos2unix включено програми C та C, призначені для перетворення звичайних текстових даних у форматі DOS або Mac на дані у форматі Unix, і навпаки." #. type: textblock #: dos2unix.pod:66 msgid "In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks." msgstr "У текстових файлах DOS/Windows розрив рядка або перехід на новий рядок здійснюється за допомогою комбінації двох символів: повернення каретки (CR) і переведення рядка (LF). У текстових файлах Unix за перехід на новий рядок відповідає один символ: переведення рядка (LF). У текстових файлах Mac, до Mac OS X, за розрив рядка відповідав один символ: повернення каретки (CR). У сучасних версіях Mac OS використовується типовий для Unix розрив рядка (LF)." #. type: textblock #: dos2unix.pod:72 msgid "Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files." msgstr "Окрім символів розриву рядка, програма Dos2unix здатна виконувати перетворення кодування файлів. Можна перетворити дані у декількох кодуваннях DOS на файли у кодуванні Latin-1 Unix. Також можна перетворити дані у файлах Windows Unicode (UTF-16) на дані у кодуванні Unix Unicode (UTF-8)." #. type: textblock #: dos2unix.pod:76 msgid "Binary files are automatically skipped, unless conversion is forced." msgstr "Під час перетворення програма пропускатиме двійкові файли, якщо ви не накажете їй виконати перетворення таких файлів безпосередньо." #. type: textblock #: dos2unix.pod:78 msgid "Non-regular files, such as directories and FIFOs, are automatically skipped." msgstr "Програма автоматично пропускатиме файли, які не є звичайними файлами, зокрема каталоги та канали FIFO." #. type: textblock #: dos2unix.pod:80 msgid "Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows." msgstr "Типово, програма не вноситиме змін до символічних посилань та об’єктів посилань. Якщо потрібно, програма може замінити символічні посилання або записати перетворені дані до файла-призначення символічного посилання. У Windows запису до об’єкта символічного посилання не передбачено." #. type: textblock #: dos2unix.pod:84 msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion." msgstr "Програму dos2unix було створено за зразком програми dos2unix для SunOS/Solaris. Втім, існує одна важлива відмінність від оригінальної версії для SunOS/Solaris. Ця версія типово виконує заміну файлів під час перетворення (старий режим обробки файлів), а у оригінальній версії для SunOS/Solaris передбачено підтримку лише парного перетворення (новий режим обробки файлів). Див. також параметри C<-o> та C<-n>. Ще однією відмінністю є те, що у версії для SunOS/Solaris типово використовувався режим перетворення I, а у цій версії типовим є режим перетворення I." #. type: =head1 #: dos2unix.pod:92 msgid "OPTIONS" msgstr "ПАРАМЕТРИ" #. type: =item #: dos2unix.pod:96 msgid "B<-->" msgstr "B<-->" #. type: textblock #: dos2unix.pod:98 msgid "Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named \"-foo\", you can use this command:" msgstr "Вважати усі наступні параметри назвами файлів. Цим параметром слід користуватися, якщо вам потрібно виконати перетворення файлів, чиї назви містять дефіси. Наприклад, щоб виконати перетворення файла «-foo», скористайтеся такою командою:" #. type: verbatim #: dos2unix.pod:102 #, no-wrap msgid "" " dos2unix -- -foo\n" "\n" msgstr "" " dos2unix -- -foo\n" "\n" #. type: textblock #: dos2unix.pod:104 msgid "Or in new file mode:" msgstr "Або у новому режимі файлів:" #. type: verbatim #: dos2unix.pod:106 #, no-wrap msgid "" " dos2unix -n -- -foo out.txt\n" "\n" msgstr "" " dos2unix -n -- -foo out.txt\n" "\n" #. type: =item #: dos2unix.pod:108 msgid "B<-ascii>" msgstr "B<-ascii>" #. type: textblock #: dos2unix.pod:110 msgid "Convert only line breaks. This is the default conversion mode." msgstr "Виконати лише перетворення символів розриву рядків. Типовий режим перетворення." #. type: =item #: dos2unix.pod:112 msgid "B<-iso>" msgstr "B<-iso>" #. type: textblock #: dos2unix.pod:114 msgid "Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES." msgstr "Виконати перетворення з кодування DOS на кодування ISO-8859-1. Див. розділ щодо режимів перетворення." #. type: =item #: dos2unix.pod:117 msgid "B<-1252>" msgstr "B<-1252>" #. type: textblock #: dos2unix.pod:119 msgid "Use Windows code page 1252 (Western European)." msgstr "Використати кодову таблицю 1252 Windows (західноєвропейські мови)." #. type: =item #: dos2unix.pod:121 msgid "B<-437>" msgstr "B<-437>" #. type: textblock #: dos2unix.pod:123 msgid "Use DOS code page 437 (US). This is the default code page used for ISO conversion." msgstr "Використовувати кодову сторінку DOS 437 (США). Це типова кодова сторінка для перетворення ISO." #. type: =item #: dos2unix.pod:125 msgid "B<-850>" msgstr "B<-850>" #. type: textblock #: dos2unix.pod:127 msgid "Use DOS code page 850 (Western European)." msgstr "Використовувати кодову сторінку DOS 850 (західноєвропейські мови)." #. type: =item #: dos2unix.pod:129 msgid "B<-860>" msgstr "B<-860>" #. type: textblock #: dos2unix.pod:131 msgid "Use DOS code page 860 (Portuguese)." msgstr "Використовувати сторінку DOS 860 (португальська)." #. type: =item #: dos2unix.pod:133 msgid "B<-863>" msgstr "B<-863>" #. type: textblock #: dos2unix.pod:135 msgid "Use DOS code page 863 (French Canadian)." msgstr "Використовувати сторінку DOS 863 (канадська французька)." #. type: =item #: dos2unix.pod:137 msgid "B<-865>" msgstr "B<-865>" #. type: textblock #: dos2unix.pod:139 msgid "Use DOS code page 865 (Nordic)." msgstr "Використовувати сторінку DOS 865 (скандинавські мови)." #. type: =item #: dos2unix.pod:141 msgid "B<-7>" msgstr "B<-7>" #. type: textblock #: dos2unix.pod:143 msgid "Convert 8 bit characters to 7 bit space." msgstr "Перетворювати 8-бітові символи на 7-бітові." #. type: =item #: dos2unix.pod:145 msgid "B<-b, --keep-bom>" msgstr "B<-b, --keep-bom>" #. type: textblock #: dos2unix.pod:147 msgid "Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option C<-r>." msgstr "Зберегти позначку порядку байтів (BOM). Якщо у файлі вхідних даних є BOM, записати BOM до файла результатів. Це типова поведінка під час перетворення у формат із символами розриву рядків DOS. Див. також параметр C<-r>." #. type: =item #: dos2unix.pod:151 msgid "B<-c, --convmode CONVMODE>" msgstr "B<-c, --convmode РЕЖИМ>" #. type: textblock #: dos2unix.pod:153 msgid "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default." msgstr "Встановити режим перетворення. Значенням аргументу РЕЖИМ може бути один з таких рядків: I, I<7bit>, I, I. Типовим є режим ascii." #. type: =item #: dos2unix.pod:157 msgid "B<-D, --display-enc ENCODING>" msgstr "B<-D, --display-enc КОДУВАННЯ>" #. type: textblock #: dos2unix.pod:159 msgid "Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default." msgstr "Встановити кодування показаного тексту. Можливі варіанти значень параметра КОДУВАННЯ: I, I, I, I, I, типовим є ansi." #. type: textblock #: dos2unix.pod:163 msgid "This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed." msgstr "Цей параметр доступний лише у dos2unix для Windows з підтримкою назв файлів у Unicode. Цей параметр не впливає на справжнє читання та запис назв файлів, лише на те, як буде показано ці назви." #. type: textblock #: dos2unix.pod:167 msgid "There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages." msgstr "Існує декілька способів показу тексту у консолі Windows, заснованих на кодуванні тексту. Усі ці способи мають свої переваги і недоліки." #. type: =item #: dos2unix.pod:173 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:175 msgid "Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page." msgstr "Типовим способом для dos2unix є кодування тексту у форматі ANSI. Перевагою є зворотна сумісність. Цей варіант працює з растровими шрифтами та шрифтами TrueType. У деяких регіонах, ймовірно, вам доведеться змінити активну кодову сторінку DOS OEM на системну кодову сторінку ANSI Windows за допомогою команди C, оскільки dos2unix використовує системну кодову сторінку Windows." #. type: textblock #: dos2unix.pod:181 msgid "The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK." msgstr "Недоліком ansi є те, що назви файлів із символами, яких немає у типовому системному кодуванні, буде показано неправильно. Замість цих символів ви побачите знак питання або не той символ. Якщо у вашій системі немає файлів із назвами, які містять нетипові символи, можна скористатися цим варіантом." #. type: =item #: dos2unix.pod:186 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:188 msgid "The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it." msgstr "Перевагою кодування unicode (назва у Windows кодування UTF-16) є те, що зазвичай текст буде показано правильно. Змінювати активну кодову сторінку не потрібно. Ймовірно, вам потрібно встановити шрифт консолі TrueType для належного показу нестандартних символів. Якщо символ не передбачено у шрифті TrueType, зазвичай ви побачите невеличкий квадратик замість символу, іноді із знаком питання у ньому." #. type: textblock #: dos2unix.pod:194 msgid "When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font." msgstr "Якщо ви користуєтеся консоллю ConEmu, весь текст буде показано належним чином, оскільки ConEmu автоматично вибирає належний шрифт." #. type: textblock #: dos2unix.pod:197 msgid "The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program." msgstr "Недоліком unicode є те, що це кодування несумісне з ASCII. Обробка виведених даних є непростою, якщо ви передаватимете ці дані до іншої програми або файла." #. type: textblock #: dos2unix.pod:200 msgid "When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "Якщо використовується метод C, текст у кодуванні Unicode буде оброблено з урахуванням BOM (позначки порядку байтів). BOM потрібна для правильного переспрямовування або тунелювання даних у PowerShell." #. type: =item #: dos2unix.pod:205 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:207 msgid "The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding." msgstr "Перевагою utf8 є те, що це кодування сумісне з ASCII. Вам слід встановити шрифт консолі TrueType. Якщо використано шрифт TrueType, текст буде показано подібно до того, як його показано, якщо визначено кодування C." #. type: textblock #: dos2unix.pod:211 msgid "The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed." msgstr "Недоліком є те, що якщо ви скористаєтеся типовим растровим шрифтом, усі символи поза ASCII буде показано неправильно. Не лише назви файлів у unicode, а й перекладені повідомлення стануть непридатними до читання. У Windows, налаштованому на роботі у східно-азійському регіоні, ви можете помітити значне блимання під час показу повідомлень." #. type: textblock #: dos2unix.pod:217 msgid "In a ConEmu console the utf8 encoding method works well." msgstr "У консолі ConEmu добре працює спосіб кодування utf8." #. type: textblock #: dos2unix.pod:219 msgid "When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "Якщо використовується метод C, текст у кодуванні UTF-8 буде оброблено з урахуванням BOM (позначки порядку байтів). BOM потрібна для правильного переспрямовування або тунелювання даних у PowerShell." #. type: textblock #: dos2unix.pod:226 msgid "The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C." msgstr "Типове кодування можна змінити за допомогою змінної середовища DOS2UNIX_DISPLAY_ENC встановленням для неї значення C, C, C або C." #. type: =item #: dos2unix.pod:229 msgid "B<-f, --force>" msgstr "B<-f, --force>" #. type: textblock #: dos2unix.pod:231 msgid "Force conversion of binary files." msgstr "Примусове перетворення двійкових файлів." #. type: =item #: dos2unix.pod:233 msgid "B<-gb, --gb18030>" msgstr "B<-gb, --gb18030>" #. type: textblock #: dos2unix.pod:235 msgid "On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030." msgstr "У Windows файли в UTF-16 типово перетворюються на файли в UTF-8, незалежно від встановленої локалі. За допомогою цього параметра ви можете наказати програмі перетворювати файли в UTF-16 на файли у GB18030. Цим параметром можна скористатися лише у Windows. Див. також розділ, присвячений GB18030." #. type: =item #: dos2unix.pod:239 msgid "B<-h, --help>" msgstr "B<-h, --help>" #. type: textblock #: dos2unix.pod:241 msgid "Display help and exit." msgstr "Показати довідкові дані і завершити роботу." #. type: =item #: dos2unix.pod:243 msgid "B<-i[FLAGS], --info[=FLAGS] FILE ...>" msgstr "B<-i[ПРАПОРЦІ], --info[=ПРАПОРЦІ] ФАЙЛ ...>" #. type: textblock #: dos2unix.pod:245 msgid "Display file information. No conversion is done." msgstr "Вивести дані щодо файла. Не виконувати перетворення." #. type: textblock #: dos2unix.pod:247 msgid "The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name." msgstr "Буде виведено такі дані, у вказаному порядку: кількість розривів рядків у форматі DOS, кількість розривів рядків у форматі Unix, кількість розривів рядків у форматі Mac, позначка порядку байтів, текстовим чи бінарним є файл та назву файла." #. type: textblock #: dos2unix.pod:251 msgid "Example output:" msgstr "Приклад результатів:" #. type: verbatim #: dos2unix.pod:253 #, no-wrap msgid "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" msgstr "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" #. type: textblock #: dos2unix.pod:262 msgid "Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>." msgstr "Зауважте, що іноді бінарні файли помилково розпізнаються як текстові. Див. також параметр C<-s>." #. type: textblock #: dos2unix.pod:264 msgid "Optionally extra flags can be set to change the output. One or more flags can be added." msgstr "Крім того, можна вказати додаткові прапорці для внесення змін у виведені дані. Можна використовувати один або декілька таких прапорців." #. type: =item #: dos2unix.pod:269 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:271 msgid "Print number of DOS line breaks." msgstr "Вивести кількість символів розривів рядка DOS." #. type: =item #: dos2unix.pod:273 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:275 msgid "Print number of Unix line breaks." msgstr "Вивести кількість символів розривів рядка Unix." #. type: =item #: dos2unix.pod:277 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:279 msgid "Print number of Mac line breaks." msgstr "Вивести кількість символів розривів рядка Mac." #. type: =item #: dos2unix.pod:281 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:283 msgid "Print the byte order mark." msgstr "Вивести позначку порядку байтів." #. type: =item #: dos2unix.pod:285 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:287 msgid "Print if file is text or binary." msgstr "Вивести дані щодо того, є файл текстовим чи бінарним." #. type: =item #: dos2unix.pod:289 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:291 msgid "Print only the files that would be converted." msgstr "Вивести дані лише тих файлів, які було б перетворено." #. type: textblock #: dos2unix.pod:293 msgid "With the C flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks." msgstr "Із прапорцем C dos2unix виведе лише назви файлів, у яких містяться розриви рядків DOS. unix2dos виведе лише назви файлів, у яких містяться розриви рядків Unix." #. type: =item #: dos2unix.pod:296 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:298 msgid "Print a header." msgstr "Вивести заголовок." #. type: =item #: dos2unix.pod:300 msgid "B

" msgstr "B

" #. type: textblock #: dos2unix.pod:302 msgid "Show file names without path." msgstr "Показувати назви файлів без шляхів." #. type: textblock #: dos2unix.pod:306 msgid "Examples:" msgstr "Приклади:" #. type: textblock #: dos2unix.pod:308 msgid "Show information for all *.txt files:" msgstr "Вивести дані щодо усіх файлів *.txt:" #. type: verbatim #: dos2unix.pod:310 #, no-wrap msgid "" " dos2unix -i *.txt\n" "\n" msgstr "" " dos2unix -i *.txt\n" "\n" #. type: textblock #: dos2unix.pod:312 msgid "Show only the number of DOS line breaks and Unix line breaks:" msgstr "Вивести кількість розривів рядків у форматі DOS і розривів рядків у форматі Unix:" #. type: verbatim #: dos2unix.pod:314 #, no-wrap msgid "" " dos2unix -idu *.txt\n" "\n" msgstr "" " dos2unix -idu *.txt\n" "\n" #. type: textblock #: dos2unix.pod:316 msgid "Show only the byte order mark:" msgstr "Вивести лише позначку порядку байтів:" #. type: verbatim #: dos2unix.pod:318 #, no-wrap msgid "" " dos2unix --info=b *.txt\n" "\n" msgstr "" " dos2unix --info=b *.txt\n" "\n" #. type: textblock #: dos2unix.pod:320 msgid "List the files that have DOS line breaks:" msgstr "Вивести список файлів, у яких є символи розриву рядків DOS:" #. type: verbatim #: dos2unix.pod:322 #, no-wrap msgid "" " dos2unix -ic *.txt\n" "\n" msgstr "" " dos2unix -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:324 msgid "List the files that have Unix line breaks:" msgstr "Вивести список файлів, у яких використано символи розриву рядків Unix:" #. type: verbatim #: dos2unix.pod:326 #, no-wrap msgid "" " unix2dos -ic *.txt\n" "\n" msgstr "" " unix2dos -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:328 msgid "Convert only files that have DOS line breaks and leave the other files untouched:" msgstr "Перетворити лише файли із розривами рядків DOS і не чіпати інших файлів:" #. type: verbatim #: dos2unix.pod:330 #, no-wrap msgid "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:332 msgid "Find text files that have DOS line breaks:" msgstr "Знайти текстові файли і розривами рядків DOS:" #. type: verbatim #: dos2unix.pod:334 #, no-wrap msgid "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" msgstr "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" #. type: =item #: dos2unix.pod:336 msgid "B<-k, --keepdate>" msgstr "B<-k, --keepdate>" #. type: textblock #: dos2unix.pod:338 msgid "Keep the date stamp of output file same as input file." msgstr "Зберегти часову позначку файла вхідних даних у файлі результатів перетворення." #. type: =item #: dos2unix.pod:340 msgid "B<-L, --license>" msgstr "B<-L, --license>" #. type: textblock #: dos2unix.pod:342 msgid "Display program's license." msgstr "Вивести умови ліцензування програми." #. type: =item #: dos2unix.pod:344 msgid "B<-l, --newline>" msgstr "B<-l, --newline>" #. type: textblock #: dos2unix.pod:346 msgid "Add additional newline." msgstr "Вставити додатковий символ розриву рядка." #. type: textblock #: dos2unix.pod:348 msgid "B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks." msgstr "B: перетворення на два символи розриву рядків Unix відбуватиметься лише для комбінацій розриву рядків DOS. У режимі Mac виконуватиметься перетворення на два розриви рядків Unix лише символів розриву рядків Mac." #. type: textblock #: dos2unix.pod:352 msgid "B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks." msgstr "B: перетворення на дві комбінації розриву рядків DOS відбуватиметься лише для символів розриву рядків DOS. У режимі Mac виконуватиметься перетворення на два розриви рядків Mac лише символів розриву рядків Unix." #. type: =item #: dos2unix.pod:355 msgid "B<-m, --add-bom>" msgstr "B<-m, --add-bom>" #. type: textblock #: dos2unix.pod:357 msgid "Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written." msgstr "Записати до файла результатів позначку порядку байтів (BOM). Типово буде записано позначку порядку байтів UTF-8." #. type: textblock #: dos2unix.pod:360 msgid "When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM will be written." msgstr "Якщо дані початкового файла закодовано у UTF-16 і використано параметр C<-u>, буде дописано позначку порядку байтів UTF-16." #. type: textblock #: dos2unix.pod:363 msgid "Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE." msgstr "Не використовуйте цей параметр для кодувань результатів, відмінних від UTF-8, UTF-16 або GB18030. Див. також розділ щодо UNICODE." #. type: =item #: dos2unix.pod:367 msgid "B<-n, --newfile INFILE OUTFILE ...>" msgstr "B<-n, --newfile ВХІДНИЙ_ФАЙЛ ВИХІДНИЙ_ФАЙЛ ...>" #. type: textblock #: dos2unix.pod:369 msgid "New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files." msgstr "Новий режим обробки файлів. Перетворити дані з файла ВХІДНИЙ_ФАЙЛ і записати результати до файла ВИХІДНИЙ_ФАЙЛ. Назви файлів слід вказувати парами, I<не слід> використовувати шаблони заміни, інакше вміст файлів I<буде втрачено>." #. type: textblock #: dos2unix.pod:373 msgid "The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion." msgstr "Власником перетвореного файла буде призначено користувача, яким було розпочато перетворення у режимі нового файла (парному режимі). Права доступу на читання або запис нового файла буде визначено на основі прав доступу до початкового файла мінус umask(1) для користувача, яким було розпочато перетворення." #. type: =item #: dos2unix.pod:378 msgid "B<-o, --oldfile FILE ...>" msgstr "B<-o, --oldfile ФАЙЛ ...>" #. type: textblock #: dos2unix.pod:380 msgid "Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used." msgstr "Застарілий режим обробки. Виконати перетворення файла ФАЙЛ і перезаписати його вміст. Типово, програма працює у цьому режимі. Можна використовувати шаблони заміни." #. type: textblock #: dos2unix.pod:383 msgid "In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix." msgstr "У застарілому режимі (режимі заміщення) перетворений файл належатиме тому самому власнику і групі і матиме ті самі права доступу на читання або запис, що і початковий файл. Крім того, якщо перетворення файла виконується іншим користувачем, який має права доступу на запис до файла (наприклад користувачем root), перетворення буде перервано, якщо зберегти початкові значення не вдасться. Зміна власника може означати неможливість читання файла для його початкового власника. Зміна групи може призвести до проблем із безпекою, оскільки файл може стати доступним для читання користувачам, які не повинні мати такі права доступу. Можливість збереження прав власності та прав доступу до файла передбачено лише у Unix." #. type: =item #: dos2unix.pod:392 msgid "B<-q, --quiet>" msgstr "B<-q, --quiet>" #. type: textblock #: dos2unix.pod:394 msgid "Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used." msgstr "Режим без виведення повідомлень. Програма не виводитиме жодних попереджень або повідомлень про помилки. Повернутим значенням завжди буде нуль, якщо вказано правильні параметри командного рядка." #. type: =item #: dos2unix.pod:397 msgid "B<-r, --remove-bom>" msgstr "B<-r, --remove-bom>" #. type: textblock #: dos2unix.pod:399 msgid "Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option C<-b>." msgstr "Вилучити позначку порядку байтів (BOM). Не записувати BOM до файла результатів. Це типова поведінка під час перетворення файлів з форматом розриву рядків Unix. Див. також параметр C<-b>." #. type: =item #: dos2unix.pod:403 msgid "B<-s, --safe>" msgstr "B<-s, --safe>" #. type: textblock #: dos2unix.pod:405 msgid "Skip binary files (default)." msgstr "Пропускати двійкові файли (типово)." #. type: textblock #: dos2unix.pod:407 msgid "The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file." msgstr "Пропускання бінарних файлів реалізовано для того, щоб уникнути випадкових помилок. Майте на увазі, що визначення бінарних файлів не є 100% точним. Програма просто шукає у файлах бінарні символи, які типово не трапляються у текстових файлах. Може так статися, що у бінарному файлі містяться лише звичайні текстові символи. Такий бінарний файл буде помилково сприйнято програмою як текстовий." #. type: =item #: dos2unix.pod:413 msgid "B<-u, --keep-utf16>" msgstr "B<-u, --keep-utf16>" #. type: textblock #: dos2unix.pod:415 msgid "Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the C<-ascii> option." msgstr "Зберегти початкове кодування UTF-16. Файл результатів буде записано у тому самому кодуванні UTF-16, із прямим або зворотним порядком байтів, що і початковий файл. Таким чином можна запобігти перетворенню даних у кодування UTF-8. До файла буде записано відповідну позначку порядку байтів UTF-16. Вимкнути цей параметр можна за допомогою параметра C<-ascii>." #. type: =item #: dos2unix.pod:420 msgid "B<-ul, --assume-utf16le>" msgstr "B<-ul, --assume-utf16le>" #. type: textblock #: dos2unix.pod:422 msgid "Assume that the input file format is UTF-16LE." msgstr "Припускати, що кодуванням вхідних файлів є UTF-16LE." #. type: textblock #: dos2unix.pod:424 msgid "When there is a Byte Order Mark in the input file the BOM has priority over this option." msgstr "Якщо у початковому файлі є позначка порядку байтів (BOM), її буде використано у файлі-результаті, незалежно від використання цього параметра." #. type: textblock #: dos2unix.pod:427 msgid "When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file." msgstr "Якщо вами було зроблено помилкове припущення щодо формату файла (файл вхідних даних насправді не є файлом у форматі UTF-16LE), і дані вдасться успішно перетворити, ви отримаєте файл у кодуванні UTF-8 з помилковим вмістом. Скасувати таке помилкове перетворення можна за допомогою зворотного перетворення iconv(1) з даних у форматі UTF-8 на дані у форматі UTF-16LE. Таким чином ви повернетеся до початкового кодування даних у файлі." #. type: textblock #: dos2unix.pod:432 msgid "The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off." msgstr "Припущення щодо форматування UTF-16LE працює як визначення I<режиму перетворення>. Перемиканням на типовий режим I можна вимкнути припущення щодо форматування UTF-16LE." #. type: =item #: dos2unix.pod:435 msgid "B<-ub, --assume-utf16be>" msgstr "B<-ub, --assume-utf16be>" #. type: textblock #: dos2unix.pod:437 msgid "Assume that the input file format is UTF-16BE." msgstr "Припускати, що вхідним форматом є UTF-16BE." #. type: textblock #: dos2unix.pod:439 msgid "This option works the same as option C<-ul>." msgstr "Цей параметр працює у спосіб, тотожний до параметра C<-ul>." #. type: =item #: dos2unix.pod:441 msgid "B<-v, --verbose>" msgstr "B<-v, --verbose>" #. type: textblock #: dos2unix.pod:443 msgid "Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks." msgstr "Виводити докладні повідомлення. Буде показано додаткові дані щодо позначок порядку байтів та кількості перетворених символів розриву рядків." #. type: =item #: dos2unix.pod:446 msgid "B<-F, --follow-symlink>" msgstr "B<-F, --follow-symlink>" #. type: textblock #: dos2unix.pod:448 msgid "Follow symbolic links and convert the targets." msgstr "Переходити за символічними посиланням і перетворювати файли, на які вони вказують." #. type: =item #: dos2unix.pod:450 msgid "B<-R, --replace-symlink>" msgstr "B<-R, --replace-symlink>" #. type: textblock #: dos2unix.pod:452 msgid "Replace symbolic links with converted files (original target files remain unchanged)." msgstr "Замінити символічні посилання перетвореними файлами (початкові файли, на які вони вказують, змінено не буде)." #. type: =item #: dos2unix.pod:455 msgid "B<-S, --skip-symlink>" msgstr "B<-S, --skip-symlink>" #. type: textblock #: dos2unix.pod:457 msgid "Keep symbolic links and targets unchanged (default)." msgstr "Не змінювати символічні посилання та файли, на які вони посилаються (типово)." #. type: =item #: dos2unix.pod:459 msgid "B<-V, --version>" msgstr "B<-V, --version>" #. type: textblock #: dos2unix.pod:461 msgid "Display version information and exit." msgstr "Вивести дані щодо версії і завершити роботу." #. type: =head1 #: dos2unix.pod:465 msgid "MAC MODE" msgstr "РЕЖИМ MAC" #. type: textblock #: dos2unix.pod:467 msgid "In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted." msgstr "У звичайному режимі розриви рядків DOS перетворюються на розриви рядків Unix, і навпаки. Розриви рядків Mac перетворенню не підлягають." #. type: textblock #: dos2unix.pod:470 msgid "In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed." msgstr "У режимі Mac розриви рядків Mac перетворюються на розриви рядків Unix, і навпаки. Розриви рядків DOS перетворенню не підлягають." #. type: textblock #: dos2unix.pod:473 msgid "To run in Mac mode use the command-line option C<-c mac> or use the commands C or C." msgstr "Щоб запустити програму у режимі перетворення Mac, скористайтеся параметром командного рядка C<-c mac> або програмами C та C." #. type: =head1 #: dos2unix.pod:476 msgid "CONVERSION MODES" msgstr "РЕЖИМИ ПЕРЕТВОРЕННЯ" #. type: =item #: dos2unix.pod:480 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:482 msgid "In mode C only line breaks are converted. This is the default conversion mode." msgstr "У режимі C виконуватиметься лише перетворення символів розриву рядків. Цей режим є типовим режимом перетворення." #. type: textblock #: dos2unix.pod:485 msgid "Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files." msgstr "Хоча цей режим і називається режимом ASCII (стандарту 7-бітового кодування), насправді кодування символів у ньому є 8-бітовим. Завжди користуйтеся цим режимом для перетворення файлів у кодуванні UTF-8 (Unicode)." #. type: =item #: dos2unix.pod:489 msgid "B<7bit>" msgstr "B<7bit>" #. type: textblock #: dos2unix.pod:491 msgid "In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space." msgstr "У цьому режимі усі 8-бітові символи, які не є частиною ASCII, (з номерами від 128 до 255) буде перетворено на відповідні 7-бітові символи." #. type: =item #: dos2unix.pod:494 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:496 msgid "Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart." msgstr "Перетворення символів буде виконано з кодування (кодової сторінки) DOS до кодування ISO-8859-1 (Latin-1) у Unix. Символи DOS, які не мають еквівалентів у ISO-8859-1 і перетворення яких неможливе, буде перетворено на символ крапки. Те саме стосується символів ISO-8859-1, які не мають еквівалентів у DOS." #. type: textblock #: dos2unix.pod:501 msgid "When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings." msgstr "Якщо буде використано лише параметр C<-iso>, програма dos2unix спробує визначити активне кодування. Якщо це виявиться неможливим, dos2unix використає типове кодування CP437, яке здебільшого використовується у США. Щоб примусово визначити кодування, скористайтеся параметром C<-437> (США), C<-850> (західноєвропейські мови), C<-860> (португальська), C<-863> (канадська французька) або C<-865> (скандинавські мови). Використати кодування Windows CP1252 (західноєвропейські мови) можна за допомогою параметра C<-1252>. Для інших кодувань використовуйте поєднання dos2unix з iconv(1). Програма iconv здатна виконувати перетворення даних у доволі широкому спектрі кодувань символів." #. type: textblock #: dos2unix.pod:510 msgid "Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files." msgstr "Ніколи не користуйтеся перетворенням ISO для текстових файлів у форматі Unicode. Використання подібного перетворення призведе до ушкодження вмісту файлів у кодуванні UTF-8." #. type: textblock #: dos2unix.pod:512 msgid "Some examples:" msgstr "Декілька прикладів:" #. type: textblock #: dos2unix.pod:514 msgid "Convert from DOS default code page to Unix Latin-1:" msgstr "Перетворити дані у типовому кодуванні DOS на дані у кодуванні Latin-1 Unix:" #. type: verbatim #: dos2unix.pod:516 #, no-wrap msgid "" " dos2unix -iso -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -iso -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:518 msgid "Convert from DOS CP850 to Unix Latin-1:" msgstr "Перетворити дані у кодуванні DOS CP850 на дані у кодуванні Latin-1 Unix:" #. type: verbatim #: dos2unix.pod:520 #, no-wrap msgid "" " dos2unix -850 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -850 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:522 msgid "Convert from Windows CP1252 to Unix Latin-1:" msgstr "Перетворити дані у кодуванні CP1252 Windows на дані у кодуванні Latin-1 Unix:" #. type: verbatim #: dos2unix.pod:524 #, no-wrap msgid "" " dos2unix -1252 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -1252 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:526 msgid "Convert from Windows CP1252 to Unix UTF-8 (Unicode):" msgstr "Перетворити дані у кодуванні CP252 Windows на дані у кодуванні UTF-8 Unix (Unicode):" #. type: verbatim #: dos2unix.pod:528 #, no-wrap msgid "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" msgstr "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" #. type: textblock #: dos2unix.pod:530 msgid "Convert from Unix Latin-1 to DOS default code page:" msgstr "Перетворити дані у кодуванні Latin-1 Unix на дані у типовому кодуванні DOS:" #. type: verbatim #: dos2unix.pod:532 #, no-wrap msgid "" " unix2dos -iso -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -iso -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:534 msgid "Convert from Unix Latin-1 to DOS CP850:" msgstr "Перетворити дані у кодуванні Latin-1 Unix на дані у кодуванні DOS CP850:" #. type: verbatim #: dos2unix.pod:536 #, no-wrap msgid "" " unix2dos -850 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -850 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:538 msgid "Convert from Unix Latin-1 to Windows CP1252:" msgstr "Перетворити дані у кодуванні Latin-1 Unix на дані у кодуванні Windows CP1252:" #. type: verbatim #: dos2unix.pod:540 #, no-wrap msgid "" " unix2dos -1252 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -1252 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:542 msgid "Convert from Unix UTF-8 (Unicode) to Windows CP1252:" msgstr "Перетворити дані у кодуванні UTF-8 Unix (Unicode) на дані у кодуванні Windows CP1252:" #. type: verbatim #: dos2unix.pod:544 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" #. type: textblock #: dos2unix.pod:546 msgid "See also L and L." msgstr "Див. також L та L." #. type: =head1 #: dos2unix.pod:551 msgid "UNICODE" msgstr "UNICODE" #. type: =head2 #: dos2unix.pod:553 msgid "Encodings" msgstr "Кодування" #. type: textblock #: dos2unix.pod:555 msgid "There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format." msgstr "Існує декілька різних кодувань Unicode. У Unix та Linux у файлах Unicode здебільшого використовується кодування UTF-8. У Windows для текстових файлів Unicode може бути використано кодування UTF-8, UTF-16 або UTF-16 зі зворотним порядком байтів. Втім, здебільшого, використовується формат UTF-16." #. type: =head2 #: dos2unix.pod:560 msgid "Conversion" msgstr "Перетворення" #. type: textblock #: dos2unix.pod:562 msgid "Unicode text files can have DOS, Unix or Mac line breaks, like regular text files." msgstr "У текстових файлах Unicode, як і у звичайних текстових файлах, може бути використано розриви рядків DOS, Unix або Mac." #. type: textblock #: dos2unix.pod:565 msgid "All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII." msgstr "Усі версії dos2unix та unix2dos здатні виконувати перетворення у кодуванні UTF-8, оскільки UTF-8 було розроблено так, що зворотну сумісність з ASCII збережено." #. type: textblock #: dos2unix.pod:568 msgid "Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C." msgstr "Програми dos2unix та unix2dos, зібрані з підтримкою Unicode UTF-16, можуть читати текстові файли у кодуванні UTF-16 з прямим та зворотним порядком байтів. Щоб дізнатися про те, чи було dos2unix зібрано з підтримкою UTF-16, віддайте команду C." #. type: textblock #: dos2unix.pod:572 msgid "On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped." msgstr "У Unix/Linux файли у кодуванні UTF-16 перетворюються на файли у кодуванні локалі. Для визначення поточного кодування символів локалі скористайтеся командою locale(1). Якщо перетворення виявиться неможливим, програма повідомить про помилку перетворення і пропустить відповідний файл." #. type: textblock #: dos2unix.pod:577 msgid "On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux." msgstr "У Windows файли UTF-16 типово буде перетворено на файли UTF-8. Обидва типи систем, Windows та Unix/Linux, мають непогані можливості з підтримки файлів у форматуванні UTF-8." #. type: textblock #: dos2unix.pod:580 msgid "UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." msgstr "Кодування UTF-16 та UTF-8 є повністю сумісними. Під час перетворення не буде втрачено жодної інформації. Якщо під час перетворення даних у кодуванні UTF-16 на дані у кодуванні UTF-8 трапиться помилка, наприклад, якщо у вхідному файлі UTF-16 міститиметься якась помилка, файл буде пропущено." #. type: textblock #: dos2unix.pod:584 msgid "When option C<-u> is used, the output file will be written in the same UTF-16 encoding as the input file. Option C<-u> prevents conversion to UTF-8." msgstr "Якщо використано параметр C<-u>, файл результатів буде записано у тому самому кодуванні UTF-16, що і початковий файл. Використання параметра Option C<-u> запобігає перетворенню даних у кодування UTF-8." #. type: textblock #: dos2unix.pod:587 msgid "Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16." msgstr "У dos2unix та unix2dos не передбачено параметра для перетворення даних у кодуванні UTF-8 на дані у кодуванні UTF-16." #. type: textblock #: dos2unix.pod:589 msgid "ISO and 7-bit mode conversion do not work on UTF-16 files." msgstr "Режим перетворення ISO та 7-бітовий режим не працюють для файлів UTF-16." #. type: =head2 #: dos2unix.pod:591 msgid "Byte Order Mark" msgstr "Позначка порядку байтів" #. type: textblock #: dos2unix.pod:593 msgid "On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L." msgstr "У Windows до текстових файлів у кодуванні Unicode типово дописується позначка порядку байтів (BOM), оскільки багато програм Windows (зокрема Notepad) додають таку позначку автоматично. Див. також L." #. type: textblock #: dos2unix.pod:597 msgid "On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding." msgstr "У Unix файли у кодуванні Unicode типово не містять позначки порядку байтів. Вважається, що кодуванням текстових файлів є те кодування, яке визначається поточною локаллю." #. type: textblock #: dos2unix.pod:600 msgid "Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file." msgstr "Програма dos2unix може визначити, чи є кодуванням файла UTF-16, лише якщо у файлі міститься позначка порядку байтів. Якщо у файлі, де використано кодування UTF-16, немає такої позначки, dos2unix вважатиме такий файл двійковим (бінарним)." #. type: textblock #: dos2unix.pod:604 msgid "Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM." msgstr "Для перетворення файлів UTF-16 без позначки порядку байтів скористайтеся параметром C<-ul> або C<-ub>." #. type: textblock #: dos2unix.pod:606 msgid "Dos2unix writes by default no BOM in the output file. With option C<-b> Dos2unix writes a BOM when the input file has a BOM." msgstr "Типово dos2unix не записує до файлів результатів перетворення позначки порядку байтів (BOM). Якщо використано параметр C<-b>, dos2unix запише до файла результатів BOM, якщо BOM була у файлі початкових даних." #. type: textblock #: dos2unix.pod:609 msgid "Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option C<-r> to remove the BOM." msgstr "Типово unix2dos записує позначку порядку байтів (BOM) до файла результатів, якщо BOM є у початковому файлі. Скористайтеся параметром C<-r>, щоб вилучити BOM." #. type: textblock #: dos2unix.pod:612 msgid "Dos2unix and unix2dos write always a BOM when option C<-m> is used." msgstr "Dos2unix та unix2dos завжди записують до файла результатів позначку порядку байтів (BOM), якщо використано параметр C<-m>." #. type: =head2 #: dos2unix.pod:614 msgid "Unicode file names on Windows" msgstr "Назви файлів у Unicode у Windows" #. type: textblock #: dos2unix.pod:616 msgid "Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C." msgstr "У dos2unix передбачено підтримку читання і запису назв файлів Unicode у командному рядку Windows. Це означає, що dos2unix може відкривати файли, у назвах яких є символи, які не є частиною типової системної кодової сторінки ANSI. Щоб визначити, чи зібрано dos2unix для Windows з підтримкою назв файлів у кодуванні Unicode, скористайтеся командою C." #. type: textblock #: dos2unix.pod:622 msgid "There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name." msgstr "Із показом назв файлів у кодуванні Unicode у консолі Windows пов’язано декілька проблем. Див. параметр C<-D>, C<--display-enc>. Назви файлів може бути некоректно показано у консолі, але запис цих назв відбуватиметься належним чином." #. type: =head2 #: dos2unix.pod:626 msgid "Unicode examples" msgstr "Приклади для Unicode" #. type: textblock #: dos2unix.pod:628 msgid "Convert from Windows UTF-16 (with BOM) to Unix UTF-8:" msgstr "Перетворити дані з Windows UTF-16 (з позначкою порядку байтів (BOM)) у формат Unix UTF-8:" #. type: verbatim #: dos2unix.pod:630 #, no-wrap msgid "" " dos2unix -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:632 msgid "Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:" msgstr "Перетворити дані у форматі Windows UTF-16LE (без BOM) на дані у форматі UTF-8 Unix:" #. type: verbatim #: dos2unix.pod:634 #, no-wrap msgid "" " dos2unix -ul -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -ul -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:636 msgid "Convert from Unix UTF-8 to Windows UTF-8 with BOM:" msgstr "Перетворити дані у кодуванні UTF-8 Unix на дані у кодуванні Windows UTF-8 без BOM:" #. type: verbatim #: dos2unix.pod:638 #, no-wrap msgid "" " unix2dos -m -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -m -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:640 msgid "Convert from Unix UTF-8 to Windows UTF-16:" msgstr "Перетворити дані у кодуванні UTF-8 Unix на дані у кодуванні Windows UTF-16:" #. type: verbatim #: dos2unix.pod:642 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" #. type: =head1 #: dos2unix.pod:644 msgid "GB18030" msgstr "GB18030" #. type: textblock #: dos2unix.pod:646 msgid "GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also L." msgstr "GB18030 є китайським урядовим стандартом. Підтримка обов’язкової підмножини стандарту GB18030 є неодмінною вимогою до будь-яких програмних продуктів, які продаються у Китаї. Див. також L." #. type: textblock #: dos2unix.pod:650 msgid "GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK." msgstr "Кодування GB18030 є повністю сумісним із Unicode. Його можна розглядати як формат перетворення unicode. Подібно до UTF-8, GB18030 є сумісним із ASCII. GB18030 також є сумісним із кодовою сторінкою Windows 936, яку ще називають GBK." #. type: textblock #: dos2unix.pod:654 msgid "On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command C to get the list of supported locales." msgstr "У Unix/Linux файли UTF-16 буде перетворено до кодування GB18030, якщо кодуванням локалі є GB18030. Зауважте, що це спрацює, лише якщо підтримку локалі передбачено у системі. Щоб отримати список підтримуваних локалей, скористайтеся командою C." #. type: textblock #: dos2unix.pod:658 msgid "On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030." msgstr "У Windows для перетворення файлів UTF-16 на файли GB18030 слід вказати параметр C<-gb>." #. type: textblock #: dos2unix.pod:660 msgid "GB18030 encoded files can have a Byte Order Mark, like Unicode files." msgstr "У файлах у кодуванні GB18030 може міститися позначка порядку байтів, так само, як у файлах у кодуванні Unicode." #. type: =head1 #: dos2unix.pod:662 msgid "EXAMPLES" msgstr "ПРИКЛАДИ" #. type: textblock #: dos2unix.pod:664 msgid "Read input from 'stdin' and write output to 'stdout':" msgstr "Прочитати вхідні дані зі стандартного джерела (stdin) і записати результат до стандартного виведення (stdout):" #. type: verbatim #: dos2unix.pod:666 #, fuzzy, no-wrap #| msgid "" #| " dos2unix -ic *.txt | xargs dos2unix\n" #| "\n" msgid "" " dos2unix < a.txt\n" " cat a.txt | dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:669 msgid "Convert and replace a.txt. Convert and replace b.txt:" msgstr "Перетворити дані у a.txt і замістити цей файл. Перетворити дані у b.txt і замістити цей файл:" #. type: verbatim #: dos2unix.pod:671 #, no-wrap msgid "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" msgstr "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" #. type: textblock #: dos2unix.pod:674 msgid "Convert and replace a.txt in ascii conversion mode:" msgstr "Перетворити дані у a.txt і замістити файл у режимі перетворення ascii:" #. type: verbatim #: dos2unix.pod:676 #, no-wrap msgid "" " dos2unix a.txt\n" "\n" msgstr "" " dos2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:678 msgid "Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode:" msgstr "Перетворити дані у a.txt і замістити файл у режимі перетворення ascii. Перетворити дані у b.txt і замістити цей файл у режимі 7-бітового перетворення:" #. type: verbatim #: dos2unix.pod:681 #, no-wrap msgid "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" msgstr "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" #. type: textblock #: dos2unix.pod:685 msgid "Convert a.txt from Mac to Unix format:" msgstr "Перетворити файл a.txt з формату Mac на формат Unix:" #. type: verbatim #: dos2unix.pod:687 #, no-wrap msgid "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" msgstr "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:690 msgid "Convert a.txt from Unix to Mac format:" msgstr "Перетворити файл a.txt з формату Unix на формат Mac:" #. type: verbatim #: dos2unix.pod:692 #, no-wrap msgid "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" msgstr "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" #. type: textblock #: dos2unix.pod:695 msgid "Convert and replace a.txt while keeping original date stamp:" msgstr "Перетворити дані у a.txt, замістити цей файл і зберегти часову позначку початкового файла:" #. type: verbatim #: dos2unix.pod:697 #, no-wrap msgid "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" msgstr "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" #. type: textblock #: dos2unix.pod:700 msgid "Convert a.txt and write to e.txt:" msgstr "Перетворити дані у файлі a.txt і записати результати до файла e.txt:" #. type: verbatim #: dos2unix.pod:702 #, no-wrap msgid "" " dos2unix -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:704 msgid "Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:" msgstr "Перетворити дані у файлі a.txt і записати результати до файла e.txt. Скопіювати часову позначку файла a.txt для файла e.txt:" #. type: verbatim #: dos2unix.pod:706 #, no-wrap msgid "" " dos2unix -k -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -k -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:708 msgid "Convert and replace a.txt, convert b.txt and write to e.txt:" msgstr "Перетворити дані у a.txt і замістити цей файл. Перетворити дані у b.txt і записати результат до e.txt:" #. type: verbatim #: dos2unix.pod:710 #, no-wrap msgid "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" msgstr "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:713 msgid "Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt:" msgstr "Перетворити дані у c.txt і записати результати до e.txt. Перетворити дані у a.txt і замістити ними цей файл. Перетворити дані у b.txt і замістити ними цей файл. Перетворити дані у d.txt і записати результати до f.txt:" #. type: verbatim #: dos2unix.pod:716 #, no-wrap msgid "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" msgstr "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" #. type: =head1 #: dos2unix.pod:718 msgid "RECURSIVE CONVERSION" msgstr "РЕКУРСИВНЕ ПЕРЕТВОРЕННЯ" #. type: textblock #: dos2unix.pod:720 msgid "Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type:" msgstr "Для рекурсивного перетворення текстових файлів у ієрархії каталогів слід використовувати dos2unix у поєднанні з програмами find(1) та xargs(1). Наприклад, щоб виконати перетворення усіх файлів .txt у структурі підкаталогів поточного каталогу, віддайте таку команду:" #. type: verbatim #: dos2unix.pod:724 #, no-wrap msgid "" " find . -name '*.txt' |xargs dos2unix\n" "\n" msgstr "" " find . -name '*.txt' |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:726 msgid "In a Windows Command Prompt the following command can be used:" msgstr "У командному рядку Windows можна скористатися такою командою:" #. type: verbatim #: dos2unix.pod:728 #, no-wrap msgid "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" msgstr "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" #. type: textblock #: dos2unix.pod:730 msgid "PowerShell users can use the following command in Windows PowerShell:" msgstr "Користувачі PowerShell можуть скористатися такою командою у Windows PowerShell:" #. type: verbatim #: dos2unix.pod:732 #, no-wrap msgid "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" msgstr "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" #. type: =head1 #: dos2unix.pod:735 msgid "LOCALIZATION" msgstr "ЛОКАЛІЗАЦІЯ" #. type: =item #: dos2unix.pod:739 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:741 msgid "The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:" msgstr "Основна мова визначається за допомогою змінної середовища LANG. Значення змінної LANG складається з декількох частин. Перша частина записується малими літерами і визначає код мови. Друга частина є необов’язковою, визначає код країни і записується прописними літерами, відокремлюється від першої частини символом підкреслювання. Передбачено також необов’язкову третю частину: кодування. Ця частина відокремлюється від другої частини крапкою. Ось декілька прикладів для командних оболонок стандартного типу POSIX:" #. type: verbatim #: dos2unix.pod:748 #, no-wrap msgid "" " export LANG=nl Dutch\n" " export LANG=nl_NL Dutch, The Netherlands\n" " export LANG=nl_BE Dutch, Belgium\n" " export LANG=es_ES Spanish, Spain\n" " export LANG=es_MX Spanish, Mexico\n" " export LANG=en_US.iso88591 English, USA, Latin-1 encoding\n" " export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding\n" "\n" msgstr "" " export LANG=uk українська\n" " export LANG=uk_UA українська, Україна\n" " export LANG=ru_UA російська, Україна\n" " export LANG=es_ES іспанська, Іспанія\n" " export LANG=es_MX іспанська, Мексика\n" " export LANG=en_US.iso88591 англійська, США, кодування Latin-1\n" " export LANG=en_GB.UTF-8 англійська, Великобританія, кодування UTF-8\n" "\n" #. type: textblock #: dos2unix.pod:756 msgid "For a complete list of language and country codes see the gettext manual: L" msgstr "Повний список мов та кодів країн наведено у підручнику з gettext: L" #. type: textblock #: dos2unix.pod:759 msgid "On Unix systems you can use the command locale(1) to get locale specific information." msgstr "У системах Unix для отримання даних щодо локалі можна скористатися командою locale(1)." #. type: =item #: dos2unix.pod:762 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:764 msgid "With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than \"C\", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L" msgstr "За допомогою змінної середовища LANGUAGE ви можете вказати список пріоритеності мов. Записи у списку слід відокремлювати двокрапками. Програма dos2unix надає перевагу LANGUAGE над LANG. Наприклад, перша голландська, далі німецька: C. Спочатку вам слід увімкнути локалізацію, встановивши для змінної LANG (або LC_ALL) значення, відмінне від «C». Далі ви зможете використовувати список пріоритетності мов за допомогою змінної LANGUAGE. Додаткові відомості можна знайти у підручнику з gettext: L" #. type: textblock #: dos2unix.pod:772 msgid "If you select a language which is not available you will get the standard English messages." msgstr "Якщо вами буде вибрано мову, перекладу якою немає, буде показано стандартні повідомлення англійською мовою." #. type: =item #: dos2unix.pod:776 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:778 msgid "With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used." msgstr "Змінну LOCALEDIR, встановлену під час збирання програми, можна змінити за допомогою змінної середовища DOS2UNIX_LOCALEDIR. LOCALEDIR використовується для пошуку файлів перекладів. Типовим значенням у системах GNU є C. Переглянути поточне значення змінної LOCALEDIR можна переглянути за допомогою параметра B<--version>." #. type: textblock #: dos2unix.pod:783 msgid "Example (POSIX shell):" msgstr "Приклад (командна оболонка POSIX):" #. type: verbatim #: dos2unix.pod:785 #, no-wrap msgid "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" msgstr "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" #. type: =head1 #: dos2unix.pod:790 msgid "RETURN VALUE" msgstr "ПОВЕРНУТЕ ЗНАЧЕННЯ" #. type: textblock #: dos2unix.pod:792 msgid "On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned." msgstr "Якщо завдання вдасться успішно виконати, програма поверне нульовий код виходу. Якщо станеться системна помилка, буде повернуто код цієї помилки. Якщо станеться якась інша помилка, буде повернуто код 1." #. type: textblock #: dos2unix.pod:795 msgid "The return value is always zero in quiet mode, except when wrong command-line options are used." msgstr "У режимі без повідомлень повернутим значенням завжди буде нуль, якщо вказано правильні параметри командного рядка." #. type: =head1 #: dos2unix.pod:798 msgid "STANDARDS" msgstr "СТАНДАРТИ" #. type: textblock #: dos2unix.pod:800 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:802 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:804 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:806 msgid "L" msgstr "L" #. type: =head1 #: dos2unix.pod:808 msgid "AUTHORS" msgstr "АВТОРИ" #. type: textblock #: dos2unix.pod:810 msgid "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer)" msgstr "Benjamin Lin - , Bernd Johannes Wuebben (режим mac2unix) - , Christian Wurll (додатковий новий рядок) - , Erwin Waterlander - (супровідник)" #. type: textblock #: dos2unix.pod:815 msgid "Project page: L" msgstr "Сторінка проекту: L" #. type: textblock #: dos2unix.pod:817 msgid "SourceForge page: L" msgstr "Сторінка на SourceForge: L" #. type: =head1 #: dos2unix.pod:819 msgid "SEE ALSO" msgstr "ТАКОЖ ПЕРЕГЛЯНЬТЕ" #. type: textblock #: dos2unix.pod:821 msgid "file(1) find(1) iconv(1) locale(1) xargs(1)" msgstr "file(1) find(1) iconv(1) locale(1) xargs(1)" #~ msgid "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgstr "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgid "Freecode: L" #~ msgstr "Freecode: L" #~ msgid "The Windows versions of dos2unix and unix2dos convert UTF-16 encoded files always to UTF-8 encoded files. Unix versions of dos2unix/unix2dos convert UTF-16 encoded files to the locale character encoding when it is set to UTF-8. Use the locale(1) command to find out what the locale character encoding is." #~ msgstr "Версії dos2unix та unix2dos для Windows завжди виконують перетворення файлів у кодуванні UTF-16 до кодування UTF-8. Версії dos2unix та unix2dos для Unix виконують перетворення файлів у кодуванні UTF-16 до файлів у кодуванні локалі. Для визначення поточного кодування локалі скористайтеся командою locale(1)." #~ msgid "Because UTF-8 formatted text files are well supported on both Windows and Unix, dos2unix and unix2dos have no option to write UTF-16 files. All UTF-16 characters can be encoded in UTF-8. Conversion from UTF-16 to UTF-8 is without loss. UTF-16 files will be skipped on Unix when the locale character encoding is not UTF-8, to prevent accidental loss of text. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." #~ msgstr "Оскільки підтримку текстових файлів у кодуванні UTF-8 доволі добре реалізовано у Windows та Unix, у dos2unix та unix2dos не передбачено можливості запису файлів у кодуванні UTF-16. Усі символи UTF-16 можна знайти і у кодуванні UTF-8. Перетворення даних з кодування UTF-16 до кодування UTF-8, і навпаки, відбувається без втрат. Файли у кодуванні UTF-16 буде пропущено у Unix, якщо кодуванням локалі не є UTF-8, щоб запобігти випадковій втраті даних. Якщо під час перетворення даних у кодуванні UTF-16 на дані у кодуванні UTF-8 станеться помилка, наприклад, помилка міститиметься у файлі вхідних даних UTF-16, файл буде пропущено під час обробки." #~ msgid "Dos2unix never writes a BOM in the output file, unless you use option C<-m>." #~ msgstr "Dos2unix ніколи не записує позначку порядку байтів (BOM) до файла результатів, якщо не вказано параметра C<-m>." #~ msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris and has similar conversion modes." #~ msgstr "Зразком для dos2unix слугувала програма dos2unix для SunOS/Solaris, отже, у програмі передбачено подібні режими перетворення даних." #~ msgid "Conversion modes I, I<7bit>, and I are similar to those of dos2unix/unix2dos under SunOS/Solaris." #~ msgstr "Режими перетворення I, I<7bit> та I є подібними до таких самих режимів перетворення у програмах dos2unix/unix2dos для SunOS/Solaris." dos2unix-7.3.4/po-man/zh_CN.po0000644000175500010010000017721012721132543015307 0ustar waterlanGeen# Chinese (simplified) translations for dos2unix-man. # Copyright (C) 2014 Erwin Waterlander (msgids) # This file is distributed under the same license as the dos2unix package. # Tianze Wang , 2015, 2016. msgid "" msgstr "" "Project-Id-Version: dos2unix-man-7.3.3-beta9\n" "POT-Creation-Date: 2016-02-11 20:33+0100\n" "PO-Revision-Date: 2016-02-06 19:48+0800\n" "Last-Translator: Tianze Wang \n" "Language-Team: Chinese (simplified) \n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 1.8.6\n" #. type: =head1 #: dos2unix.pod:52 msgid "NAME" msgstr "名称" #. type: textblock #: dos2unix.pod:54 msgid "dos2unix - DOS/Mac to Unix and vice versa text file format converter" msgstr "dos2unix - DOS/Mac - Unix文件格式转换器" #. type: =head1 #: dos2unix.pod:56 msgid "SYNOPSIS" msgstr "概要" #. type: verbatim #: dos2unix.pod:58 #, no-wrap msgid "" " dos2unix [options] [FILE ...] [-n INFILE OUTFILE ...]\n" " unix2dos [options] [FILE ...] [-n INFILE OUTFILE ...]\n" "\n" msgstr "" " dos2unix [选项] [文件 …] [-n 输入文件 输出文件 ...]\n" " unix2dos [选项] [文件 …] [-n 输入文件 输出文件 ...]\n" "\n" #. type: =head1 #: dos2unix.pod:61 msgid "DESCRIPTION" msgstr "说明" #. type: textblock #: dos2unix.pod:63 msgid "The Dos2unix package includes utilities C and C to convert plain text files in DOS or Mac format to Unix format and vice versa." msgstr "Dos2unix软件包包括工具C 和 C,用于将纯文本文件在DOS或Mac格式与Unix格式之间相互转换。" #. type: textblock #: dos2unix.pod:66 msgid "In DOS/Windows text files a line break, also known as newline, is a combination of two characters: a Carriage Return (CR) followed by a Line Feed (LF). In Unix text files a line break is a single character: the Line Feed (LF). In Mac text files, prior to Mac OS X, a line break was single Carriage Return (CR) character. Nowadays Mac OS uses Unix style (LF) line breaks." msgstr "DOS/Windows的文本文件中,断行符是由两个字符共同表示的:回车符(CR)和换行符(LF)。Unix的文本文件中,换行符则由单个换行符(LF)表示。而Mac的文本文件则由单个回车符(CR,用于Mac OS X之前的系统)或单个换行符(LF,用于当下的新Mac OS)表示。" #. type: textblock #: dos2unix.pod:72 msgid "Besides line breaks Dos2unix can also convert the encoding of files. A few DOS code pages can be converted to Unix Latin-1. And Windows Unicode (UTF-16) files can be converted to Unix Unicode (UTF-8) files." msgstr "除了断行符,Dos2unix还可以转换文件编码。一些DOS编码页可以被转换为Unix Latin-1,Windows Unicode(UTF-16)文件也可以被转换为Unix Unicode(UTF-8)文件。" #. type: textblock #: dos2unix.pod:76 msgid "Binary files are automatically skipped, unless conversion is forced." msgstr "二进制文件则会被自动跳过,除非指定了强制转换选项。" #. type: textblock #: dos2unix.pod:78 msgid "Non-regular files, such as directories and FIFOs, are automatically skipped." msgstr "特殊文件,如目录和队列,会被自动跳过。" #. type: textblock #: dos2unix.pod:80 msgid "Symbolic links and their targets are by default kept untouched. Symbolic links can optionally be replaced, or the output can be written to the symbolic link target. Writing to a symbolic link target is not supported on Windows." msgstr "符号链接和其所指向的目标默认不会被转换。可以用选项来指定替换符号链接,或者将输出写入到链接目标。Windows下不支持写入到符号链接的目标。" #. type: textblock #: dos2unix.pod:84 msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris. There is one important difference with the original SunOS/Solaris version. This version does by default in-place conversion (old file mode), while the original SunOS/Solaris version only supports paired conversion (new file mode). See also options C<-o> and C<-n>. Another difference is that the SunOS/Solaris version uses by default I mode conversion while this version uses by default I mode conversion." msgstr "Dos2unix由SunOS/Solaris下的版本改写而成。这两个版本间有一个重大差异:本版本默认进行原位转换(旧文件模式),而原来SunOS/Solaris下的版本只支持配对转换(新文件模式),参见选项 C<-o> 和 C<-n>。还有一个区别是SunOS/Solaris下的版本默认使用 I 模式,而本版本默认使用 I 模式。" #. type: =head1 #: dos2unix.pod:92 msgid "OPTIONS" msgstr "选项" #. type: =item #: dos2unix.pod:96 msgid "B<-->" msgstr "B<-->" #. type: textblock #: dos2unix.pod:98 msgid "Treat all following options as file names. Use this option if you want to convert files whose names start with a dash. For instance to convert a file named \"-foo\", you can use this command:" msgstr "将后面所有的选项当作文件名。如果你希望转换一个文件名以破折号开头的文件,可以使用这个选项。例如,要转换一个名为“-foo”的文件,你可以用这个命令:" #. type: verbatim #: dos2unix.pod:102 #, no-wrap msgid "" " dos2unix -- -foo\n" "\n" msgstr "" " dos2unix -- -foo\n" "\n" #. type: textblock #: dos2unix.pod:104 msgid "Or in new file mode:" msgstr "或者在新文件模式中:" #. type: verbatim #: dos2unix.pod:106 #, no-wrap msgid "" " dos2unix -n -- -foo out.txt\n" "\n" msgstr "" " dos2unix -n -- -foo out.txt\n" "\n" #. type: =item #: dos2unix.pod:108 msgid "B<-ascii>" msgstr "B<-ascii>" #. type: textblock #: dos2unix.pod:110 msgid "Convert only line breaks. This is the default conversion mode." msgstr "只转换断行符。这是默认的转换模式。" #. type: =item #: dos2unix.pod:112 msgid "B<-iso>" msgstr "B<-iso>" #. type: textblock #: dos2unix.pod:114 msgid "Conversion between DOS and ISO-8859-1 character set. See also section CONVERSION MODES." msgstr "在DOS和ISO-8859-1字符集之间转换。参见 CONVERSION MODES 一节。" #. type: =item #: dos2unix.pod:117 msgid "B<-1252>" msgstr "B<-1252>" #. type: textblock #: dos2unix.pod:119 msgid "Use Windows code page 1252 (Western European)." msgstr "使用Windows 1252 编码页(西欧)。" #. type: =item #: dos2unix.pod:121 msgid "B<-437>" msgstr "B<-437>" #. type: textblock #: dos2unix.pod:123 msgid "Use DOS code page 437 (US). This is the default code page used for ISO conversion." msgstr "使用DOS 437 编码页(美国)。这是ISO转换时的默认编码页。" #. type: =item #: dos2unix.pod:125 msgid "B<-850>" msgstr "B<-850>" #. type: textblock #: dos2unix.pod:127 msgid "Use DOS code page 850 (Western European)." msgstr "使用DOS 850 编码页(西欧)。" #. type: =item #: dos2unix.pod:129 msgid "B<-860>" msgstr "B<-860>" #. type: textblock #: dos2unix.pod:131 msgid "Use DOS code page 860 (Portuguese)." msgstr "使用DOS 860 编码页(葡萄牙)。" #. type: =item #: dos2unix.pod:133 msgid "B<-863>" msgstr "B<-863>" #. type: textblock #: dos2unix.pod:135 msgid "Use DOS code page 863 (French Canadian)." msgstr "使用DOS 863 编码页(加拿大法语)。" #. type: =item #: dos2unix.pod:137 msgid "B<-865>" msgstr "B<-865>" #. type: textblock #: dos2unix.pod:139 msgid "Use DOS code page 865 (Nordic)." msgstr " 使用DOS 865 编码页(北欧)。" #. type: =item #: dos2unix.pod:141 msgid "B<-7>" msgstr "B<-7>" #. type: textblock #: dos2unix.pod:143 msgid "Convert 8 bit characters to 7 bit space." msgstr "将8位字符转换到7位空间。" #. type: =item #: dos2unix.pod:145 msgid "B<-b, --keep-bom>" msgstr "B<-b, --keep-bom>" #. type: textblock #: dos2unix.pod:147 msgid "Keep Byte Order Mark (BOM). When the input file has a BOM, write a BOM in the output file. This is the default behavior when converting to DOS line breaks. See also option C<-r>." msgstr "保留字节序标记(BOM)。当输入文件含有BOM头时,也向输出文件写入BOM。这是转换到DOS断行符时的默认行为。参见选项 C<-r>。" #. type: =item #: dos2unix.pod:151 msgid "B<-c, --convmode CONVMODE>" msgstr "B<-c, --convmode 转换模式>" #. type: textblock #: dos2unix.pod:153 msgid "Set conversion mode. Where CONVMODE is one of: I, I<7bit>, I, I with ascii being the default." msgstr "改变转换模式。转换模式可以为:I、I<7bit>、I或I,默认为ascii。" #. type: =item #: dos2unix.pod:157 msgid "B<-D, --display-enc ENCODING>" msgstr "B<-D, --display-enc ENCODAGE>" #. type: textblock #: dos2unix.pod:159 msgid "Set encoding of displayed text. Where ENCODING is one of: I, I, I, I, I with ansi being the default." msgstr "设置显示文本的编码。编码可以为:I、I、I、I、I,默认为 ansi。" #. type: textblock #: dos2unix.pod:163 msgid "This option is only available in dos2unix for Windows with Unicode file name support. This option has no effect on the actual file names read and written, only on how they are displayed." msgstr "这一选项只对支持Unicode文件名的Windows版dos2unix有效。它对文件名的读写无效,只影响它们的显示结果。" #. type: textblock #: dos2unix.pod:167 msgid "There are several methods for displaying text in a Windows console based on the encoding of the text. They all have their own advantages and disadvantages." msgstr "在Windows控制台中,有几种可以根据文本编码来显示文本的方法。它们各有利弊。" #. type: =item #: dos2unix.pod:173 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:175 msgid "Dos2unix's default method is to use ANSI encoded text. The advantage is that it is backwards compatible. It works with raster and TrueType fonts. In some regions you may need to change the active DOS OEM code page to the Windows system ANSI code page using the C command, because dos2unix uses the Windows system code page." msgstr "dos2unix默认使用ANSI编码文本。优点是它能提供向后兼容性,并能用于raster和TrueType字体。在一些地方,你可能需要使用 C 命令将活动DOS OEM编码页设置为Windows系统ANSI编码页,因为dos2unix使用Windows系统编码页。" #. type: textblock #: dos2unix.pod:181 msgid "The disadvantage of ansi is that international file names with characters not inside the system default code page are not displayed properly. You will see a question mark, or a wrong symbol instead. When you don't work with foreign file names this method is OK." msgstr "ansi的缺点是含有非系统默认编码页中字符的国际化文件名将无法被正确显示。你会看到一些问号或其他错误的字符。如果你不需要处理外文文件名,这一方法是不错的选择。" #. type: =item #: dos2unix.pod:186 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:188 msgid "The advantage of unicode (the Windows name for UTF-16) encoding is that text is usually properly displayed. There is no need to change the active code page. You may need to set the console's font to a TrueType font to have international characters displayed properly. When a character is not included in the TrueType font you usually see a small square, sometimes with a question mark in it." msgstr "Unicode编码(Windows中对UTF-16的称呼)的优点是文本可以被正确显示,也无需改变活动编码页。你可能需要设置终端字体为TrueType以便正确显示国际化字符。如果TrueType字体中不包含某个字符,你会看到一个小方块,有时方块中还会有一个问号。" #. type: textblock #: dos2unix.pod:194 msgid "When you use the ConEmu console all text is displayed properly, because ConEmu automatically selects a good font." msgstr "当你使用ConEmu终端时,所以的文本将会被正确显示,因为ConEmu会自动选择合适的字体。" #. type: textblock #: dos2unix.pod:197 msgid "The disadvantage of unicode is that it is not compatible with ASCII. The output is not easy to handle when you redirect it to another program." msgstr "Unicode的缺点在于它与ASCII不兼容。当你将输出重定向到其他程序或文件时,它可能不那么容易控制" #. type: textblock #: dos2unix.pod:200 msgid "When method C is used the Unicode text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "当使用 C 方法时,将会在Unicode文本前添加一个BOM(字节序标记)。在PowerShell中,需要根据BOM来进行正确的重定向或管道输出。" #. type: =item #: dos2unix.pod:205 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:207 msgid "The advantage of utf8 is that it is compatible with ASCII. You need to set the console's font to a TrueType font. With a TrueType font the text is displayed similar as with the C encoding." msgstr "utf8的优点在于它与ASCII兼容。你需要设置终端的字体为TrueType字体。使用TrueType字体可以使得文本得以正确显示,就像使用 C 编码时那样。" #. type: textblock #: dos2unix.pod:211 msgid "The disadvantage is that when you use the default raster font all non-ASCII characters are displayed wrong. Not only unicode file names, but also translated messages become unreadable. On Windows configured for an East-Asian region you may see a lot of flickering of the console when the messages are displayed." msgstr "缺点是当你使用默认的raster字体时,所有的非ASCII字符将无法被正确显示。不仅是unicode文件名,连翻译的消息也无法被读取。在配置为东亚地区的Windows中,当终端中显示这些消息时你可能会看到闪烁现象。" #. type: textblock #: dos2unix.pod:217 msgid "In a ConEmu console the utf8 encoding method works well." msgstr "在ConEmu终端中,utf编码方式可以正常工作。" #. type: textblock #: dos2unix.pod:219 msgid "When method C is used the UTF-8 text will be preceded with a BOM (Byte Order Mark). A BOM is required for correct redirection or piping in PowerShell." msgstr "当使用 C 方法时,将会在Unicode文本前添加一个BOM(字节序标记)。在PowerShell中,需要根据BOM来进行正确的重定向或管道输出。" #. type: textblock #: dos2unix.pod:226 msgid "The default encoding can be changed with environment variable DOS2UNIX_DISPLAY_ENC by setting it to C, C, C, or C." msgstr "默认的编码方式可以通过设置 DOS2UNIX_DISPLAY_ENC 环境变量为 C 、C、C 或 C 来改变。" #. type: =item #: dos2unix.pod:229 msgid "B<-f, --force>" msgstr "B<-f, --force>" #. type: textblock #: dos2unix.pod:231 msgid "Force conversion of binary files." msgstr "强制转换二进制文件。" #. type: =item #: dos2unix.pod:233 msgid "B<-gb, --gb18030>" msgstr "B<-gb, --gb18030>" #. type: textblock #: dos2unix.pod:235 msgid "On Windows UTF-16 files are by default converted to UTF-8, regardless of the locale setting. Use this option to convert UTF-16 files to GB18030. This option is only available on Windows. See also section GB18030." msgstr "在Windows中,UTF-16默认被转换为UTF-8格式,无论区域设置为何。请使用这一选项将UTF-16文件转换为GB18030格式。此选项只在Windows下有效。参加 GB18030 一节。" #. type: =item #: dos2unix.pod:239 msgid "B<-h, --help>" msgstr "B<-h, --help>" #. type: textblock #: dos2unix.pod:241 msgid "Display help and exit." msgstr "显示帮助,然后退出。" #. type: =item #: dos2unix.pod:243 msgid "B<-i[FLAGS], --info[=FLAGS] FILE ...>" msgstr "B<-i[标志], --info[=标志] 文件 …>" #. type: textblock #: dos2unix.pod:245 msgid "Display file information. No conversion is done." msgstr "显示文件信息。不进行转换。" #. type: textblock #: dos2unix.pod:247 msgid "The following information is printed, in this order: number of DOS line breaks, number of Unix line breaks, number of Mac line breaks, byte order mark, text or binary, file name." msgstr "将会显示下列信息(按顺序):DOS断行符的数量、Unix断行符的数量、Mac断行符的数量、是否有BOM、文本/二进制、文件名。" #. type: textblock #: dos2unix.pod:251 msgid "Example output:" msgstr "输出示例:" #. type: verbatim #: dos2unix.pod:253 #, no-wrap msgid "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" msgstr "" " 6 0 0 no_bom text dos.txt\n" " 0 6 0 no_bom text unix.txt\n" " 0 0 6 no_bom text mac.txt\n" " 6 6 6 no_bom text mixed.txt\n" " 50 0 0 UTF-16LE text utf16le.txt\n" " 0 50 0 no_bom text utf8unix.txt\n" " 50 0 0 UTF-8 text utf8dos.txt\n" " 2 418 219 no_bom binary dos2unix.exe\n" "\n" #. type: textblock #: dos2unix.pod:262 msgid "Note that sometimes a binary file can be mistaken for a text file. See also option C<-s>." msgstr "注意,二进制文件有时会被误判为文本文件。参见选项 C<-s>。" #. type: textblock #: dos2unix.pod:264 msgid "Optionally extra flags can be set to change the output. One or more flags can be added." msgstr "可以为输出设置额外的标志(一个或多个)。" #. type: =item #: dos2unix.pod:269 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:271 msgid "Print number of DOS line breaks." msgstr "显示DOS断行符的数量。" #. type: =item #: dos2unix.pod:273 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:275 msgid "Print number of Unix line breaks." msgstr "显示Unix断行符的数量。" #. type: =item #: dos2unix.pod:277 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:279 msgid "Print number of Mac line breaks." msgstr "显示Mac断行符的数量。" #. type: =item #: dos2unix.pod:281 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:283 msgid "Print the byte order mark." msgstr "显示BOM状况。" #. type: =item #: dos2unix.pod:285 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:287 msgid "Print if file is text or binary." msgstr "显示文件为文本或二进制。" #. type: =item #: dos2unix.pod:289 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:291 msgid "Print only the files that would be converted." msgstr "只显示将会被转换的文件。" #. type: textblock #: dos2unix.pod:293 msgid "With the C flag dos2unix will print only the files that contain DOS line breaks, unix2dos will print only file names that have Unix line breaks." msgstr "若设置了 C标志,dos2unix将只显示含有DOS断行符的文件,unix2dos将只显示含有Unix断行符的文件。" #. type: =item #: dos2unix.pod:296 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:298 msgid "Print a header." msgstr "显示头部。" #. type: =item #: dos2unix.pod:300 msgid "B

" msgstr "B

" #. type: textblock #: dos2unix.pod:302 msgid "Show file names without path." msgstr "显示不含路径的文件名。" #. type: textblock #: dos2unix.pod:306 msgid "Examples:" msgstr "示例:" #. type: textblock #: dos2unix.pod:308 msgid "Show information for all *.txt files:" msgstr "显示所有 *.txt 文件的信息:" #. type: verbatim #: dos2unix.pod:310 #, no-wrap msgid "" " dos2unix -i *.txt\n" "\n" msgstr "" " dos2unix -i *.txt\n" "\n" #. type: textblock #: dos2unix.pod:312 msgid "Show only the number of DOS line breaks and Unix line breaks:" msgstr "只显示DOS断行符和Unix断行符的数量:" #. type: verbatim #: dos2unix.pod:314 #, no-wrap msgid "" " dos2unix -idu *.txt\n" "\n" msgstr "" " dos2unix -idu *.txt\n" "\n" #. type: textblock #: dos2unix.pod:316 msgid "Show only the byte order mark:" msgstr "只显示BOM状况:" #. type: verbatim #: dos2unix.pod:318 #, no-wrap msgid "" " dos2unix --info=b *.txt\n" "\n" msgstr "" " dos2unix --info=b *.txt\n" "\n" #. type: textblock #: dos2unix.pod:320 msgid "List the files that have DOS line breaks:" msgstr "列出含有DOS断行符的文件:" #. type: verbatim #: dos2unix.pod:322 #, no-wrap msgid "" " dos2unix -ic *.txt\n" "\n" msgstr "" " dos2unix -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:324 msgid "List the files that have Unix line breaks:" msgstr "列出含有Unix断行符的文件:" #. type: verbatim #: dos2unix.pod:326 #, no-wrap msgid "" " unix2dos -ic *.txt\n" "\n" msgstr "" " unix2dos -ic *.txt\n" "\n" #. type: textblock #: dos2unix.pod:328 msgid "Convert only files that have DOS line breaks and leave the other files untouched:" msgstr "只转换含有DOS断行符的文件,保持其他文件不变:" #. type: verbatim #: dos2unix.pod:330 #, no-wrap msgid "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:332 msgid "Find text files that have DOS line breaks:" msgstr "查找含有DOS断行符的文本文件:" #. type: verbatim #: dos2unix.pod:334 #, no-wrap msgid "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" msgstr "" " find -name '*.txt' | xargs dos2unix -ic\n" "\n" #. type: =item #: dos2unix.pod:336 msgid "B<-k, --keepdate>" msgstr "B<-k, --keepdate>" #. type: textblock #: dos2unix.pod:338 msgid "Keep the date stamp of output file same as input file." msgstr "将输入文件的时间戳应用到输出文件。" #. type: =item #: dos2unix.pod:340 msgid "B<-L, --license>" msgstr "B<-L, --license>" #. type: textblock #: dos2unix.pod:342 msgid "Display program's license." msgstr "显示程序许可证。" #. type: =item #: dos2unix.pod:344 msgid "B<-l, --newline>" msgstr "B<-l, --newline>" #. type: textblock #: dos2unix.pod:346 msgid "Add additional newline." msgstr "添加额外的新行。" #. type: textblock #: dos2unix.pod:348 msgid "B: Only DOS line breaks are changed to two Unix line breaks. In Mac mode only Mac line breaks are changed to two Unix line breaks." msgstr "B:只有DOS断行符会被转换为两个Unix断行符。在Mac模式下,只有Mac断行符会被转换为Unix断行符。" #. type: textblock #: dos2unix.pod:352 msgid "B: Only Unix line breaks are changed to two DOS line breaks. In Mac mode Unix line breaks are changed to two Mac line breaks." msgstr "B:只有Unix断行符会被转换为两个DOS断行符。在Mac模式下,Unix断行符会被转换为两个Mac断行符。" #. type: =item #: dos2unix.pod:355 msgid "B<-m, --add-bom>" msgstr "B<-m, --add-bom>" #. type: textblock #: dos2unix.pod:357 msgid "Write a Byte Order Mark (BOM) in the output file. By default an UTF-8 BOM is written." msgstr "将字节序标记(BOM)写入到输出文件。默认情况下将写入UTF-8 BOM。" #. type: textblock #: dos2unix.pod:360 msgid "When the input file is UTF-16, and the option C<-u> is used, an UTF-16 BOM will be written." msgstr "当输入文件为UTF-16格式,并且使用了 C<-u>选项,将写入UTF-16 BOM。" #. type: textblock #: dos2unix.pod:363 msgid "Never use this option when the output encoding is other than UTF-8, UTF-16, or GB18030. See also section UNICODE." msgstr "当输出文件不是UTF-8、UTF-16或GB18030格式时,请不要使用此选项。参加 UNICODE 一节。" #. type: =item #: dos2unix.pod:367 msgid "B<-n, --newfile INFILE OUTFILE ...>" msgstr "B<-n, --newline 输入文件 输出文件 ...>" #. type: textblock #: dos2unix.pod:369 msgid "New file mode. Convert file INFILE and write output to file OUTFILE. File names must be given in pairs and wildcard names should I be used or you I lose your files." msgstr "新文件模式。转换输入文件并写入到输出文件。文件名必须成对给出,并且 I<不能> 使用通配符,否则你 I<将会>丢失文件。" #. type: textblock #: dos2unix.pod:373 msgid "The person who starts the conversion in new file (paired) mode will be the owner of the converted file. The read/write permissions of the new file will be the permissions of the original file minus the umask(1) of the person who runs the conversion." msgstr "使用新文件(配对)模式转换时,命令执行者必须为文件的所有者。新文件的读/写权限将由源文件的权限减去命令执行者的 umask(1) 得到。" #. type: =item #: dos2unix.pod:378 msgid "B<-o, --oldfile FILE ...>" msgstr "B<-o, --oldfile 文件 ...>" #. type: textblock #: dos2unix.pod:380 msgid "Old file mode. Convert file FILE and overwrite output to it. The program defaults to run in this mode. Wildcard names may be used." msgstr "旧文件模式。转换并将输出覆盖到源文件。程序默认使用此模式,允许使用通配符。" #. type: textblock #: dos2unix.pod:383 msgid "In old file (in-place) mode the converted file gets the same owner, group, and read/write permissions as the original file. Also when the file is converted by another user who has write permissions on the file (e.g. user root). The conversion will be aborted when it is not possible to preserve the original values. Change of owner could mean that the original owner is not able to read the file any more. Change of group could be a security risk, the file could be made readable for persons for whom it is not intended. Preservation of owner, group, and read/write permissions is only supported on Unix." msgstr "在旧文件(替换)模式下,被转换的文件的所有者、组和读/写权限保持不变。当文件被其他具有写权限的用户(如root)转换时,情况也是如此。如果无法保持这些值不变,转换将会终止。改变源文件的所有者可能造成其无法读取该文件,而改变组则可能带来安全隐患,使文件被不法分子读取。只有Unix才支持转换时保留所有者、组和读/写权限。" #. type: =item #: dos2unix.pod:392 msgid "B<-q, --quiet>" msgstr "B<-q, --quiet>" #. type: textblock #: dos2unix.pod:394 msgid "Quiet mode. Suppress all warnings and messages. The return value is zero. Except when wrong command-line options are used." msgstr "安静模式。不显示任何警告或信息。返回值为0,除非命令行选项有误。" #. type: =item #: dos2unix.pod:397 msgid "B<-r, --remove-bom>" msgstr "B<-r, --remove-bom>" #. type: textblock #: dos2unix.pod:399 msgid "Remove Byte Order Mark (BOM). Do not write a BOM in the output file. This is the default behavior when converting to Unix line breaks. See also option C<-b>." msgstr "移除字节序标记(BOM),不写入BOM到输出文件。这是转换到Unix断行符时的默认行为。参见选项 C<-b>。" #. type: =item #: dos2unix.pod:403 msgid "B<-s, --safe>" msgstr "B<-s, --safe>" #. type: textblock #: dos2unix.pod:405 msgid "Skip binary files (default)." msgstr "跳过二进制文件(默认)。" #. type: textblock #: dos2unix.pod:407 msgid "The skipping of binary files is done to avoid accidental mistakes. Be aware that the detection of binary files is not 100% foolproof. Input files are scanned for binary symbols which are typically not found in text files. It is possible that a binary file contains only normal text characters. Such a binary file will mistakenly be seen as a text file." msgstr "跳过二进制文件是为了避免可能的错误。请注意,对二进制文件的探测并不能做到100%准确。程序通过扫描二进制文件所特有的标记来将其与文本文件区分开来,但有的二进制文件可能只包含普通的文本字符,这样的文件就会被误判为文本文件。" #. type: =item #: dos2unix.pod:413 msgid "B<-u, --keep-utf16>" msgstr "B<-u, --keep-utf16>" #. type: textblock #: dos2unix.pod:415 msgid "Keep the original UTF-16 encoding of the input file. The output file will be written in the same UTF-16 encoding, little or big endian, as the input file. This prevents transformation to UTF-8. An UTF-16 BOM will be written accordingly. This option can be disabled with the C<-ascii> option." msgstr "保留输入文件的UTF-16编码。输出文件也使用UTF-16编码和相同的尾序。这将阻止转换到UTF-8。相应也会写入UTF-16 BOM。可以用 C<-ascii>选项来禁止。" #. type: =item #: dos2unix.pod:420 msgid "B<-ul, --assume-utf16le>" msgstr "B<-ul, --assume-utf16le>" #. type: textblock #: dos2unix.pod:422 msgid "Assume that the input file format is UTF-16LE." msgstr "假定输入文件格式为UTF-16LE。" #. type: textblock #: dos2unix.pod:424 msgid "When there is a Byte Order Mark in the input file the BOM has priority over this option." msgstr "输入文件中有BOM时,将会覆盖此选项。" #. type: textblock #: dos2unix.pod:427 msgid "When you made a wrong assumption (the input file was not in UTF-16LE format) and the conversion succeeded, you will get an UTF-8 output file with wrong text. You can undo the wrong conversion with iconv(1) by converting the UTF-8 output file back to UTF-16LE. This will bring back the original file." msgstr "如果你做了错误的假设(输入文件不为UTF-16LE格式),并且转换成功,你将会得到一个错误的UTF-8格式的文件。你可以用 iconv(1) 来撤销转换,将其从UTF-8转换回UTF-16LE。这样做可以恢复源文件。" #. type: textblock #: dos2unix.pod:432 msgid "The assumption of UTF-16LE works as a I. By switching to the default I mode the UTF-16LE assumption is turned off." msgstr "对UTF-16LE的假定将根据 l<转换模式> 来工作。若改变了默认的 l 模式,则这一假定将会被关闭。" #. type: =item #: dos2unix.pod:435 msgid "B<-ub, --assume-utf16be>" msgstr "B<-ub, --assume-utf16be>" #. type: textblock #: dos2unix.pod:437 msgid "Assume that the input file format is UTF-16BE." msgstr "假定输入文件格式为UTF-16BE。" #. type: textblock #: dos2unix.pod:439 msgid "This option works the same as option C<-ul>." msgstr "这一选项与 C<-ul> 类似。" #. type: =item #: dos2unix.pod:441 msgid "B<-v, --verbose>" msgstr "B<-v, --verbose>" #. type: textblock #: dos2unix.pod:443 msgid "Display verbose messages. Extra information is displayed about Byte Order Marks and the amount of converted line breaks." msgstr "显示更多信息。将会显示有关BOM和转换统计的额外信息。" #. type: =item #: dos2unix.pod:446 msgid "B<-F, --follow-symlink>" msgstr "B<-F, --follow-symlink>" #. type: textblock #: dos2unix.pod:448 msgid "Follow symbolic links and convert the targets." msgstr "追踪符号链接并转换其目标。" #. type: =item #: dos2unix.pod:450 msgid "B<-R, --replace-symlink>" msgstr "B<-R, --replace-symlink>" #. type: textblock #: dos2unix.pod:452 msgid "Replace symbolic links with converted files (original target files remain unchanged)." msgstr "将符号链接的目标替换为转换后的文件(原来的目标文件保持不变)。" #. type: =item #: dos2unix.pod:455 msgid "B<-S, --skip-symlink>" msgstr "B<-S, --skip-symlink>" #. type: textblock #: dos2unix.pod:457 msgid "Keep symbolic links and targets unchanged (default)." msgstr "保持符号链接和其目标文件不变(默认)。" #. type: =item #: dos2unix.pod:459 msgid "B<-V, --version>" msgstr "B<-V, --version>" #. type: textblock #: dos2unix.pod:461 msgid "Display version information and exit." msgstr "显示版本信息,然后退出。" #. type: =head1 #: dos2unix.pod:465 msgid "MAC MODE" msgstr "Mac模式" #. type: textblock #: dos2unix.pod:467 msgid "In normal mode line breaks are converted from DOS to Unix and vice versa. Mac line breaks are not converted." msgstr "普通模式下,断行符将被转换为DOS格式,或相反。Mac格式的断行符将不会被转换。" #. type: textblock #: dos2unix.pod:470 msgid "In Mac mode line breaks are converted from Mac to Unix and vice versa. DOS line breaks are not changed." msgstr "Mac模式下,Mac断行符将被转换为Unix格式,或相反。DOS断行符将不会被转换。" #. type: textblock #: dos2unix.pod:473 msgid "To run in Mac mode use the command-line option C<-c mac> or use the commands C or C." msgstr "若要以Mac模式运行,请使用命令行选项 C<-c mac>,或使用命令 C 或 C。" #. type: =head1 #: dos2unix.pod:476 msgid "CONVERSION MODES" msgstr "转换模式" #. type: =item #: dos2unix.pod:480 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:482 msgid "In mode C only line breaks are converted. This is the default conversion mode." msgstr "在 C 模式下,只转换断行符。 这是默认的转换模式。" #. type: textblock #: dos2unix.pod:485 msgid "Although the name of this mode is ASCII, which is a 7 bit standard, the actual mode is 8 bit. Use always this mode when converting Unicode UTF-8 files." msgstr "尽管此模式名叫“ASCII”(7位编码标准),实际上转换按照8位编码进行。转换UTF-8编码文件时请务必使用此模式。" #. type: =item #: dos2unix.pod:489 msgid "B<7bit>" msgstr "B<7bit>" #. type: textblock #: dos2unix.pod:491 msgid "In this mode all 8 bit non-ASCII characters (with values from 128 to 255) are converted to a 7 bit space." msgstr "在此模式下,所以的8位非ASCII字符(取值范围128-255)将被转换到7位编码空间。" #. type: =item #: dos2unix.pod:494 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:496 msgid "Characters are converted between a DOS character set (code page) and ISO character set ISO-8859-1 (Latin-1) on Unix. DOS characters without ISO-8859-1 equivalent, for which conversion is not possible, are converted to a dot. The same counts for ISO-8859-1 characters without DOS counterpart." msgstr "Unix下,将在DOS字符集(编码页)和ISO字符集 ISO-8859-1(Latin-1)之间进行转换。不具有 ISO-8859-1 中对等字符的DOS字符将会被转换为点号(“.”)。当 ISO-8859-1 字符集中没有DOS中的对等字符时也是如此。" #. type: textblock #: dos2unix.pod:501 msgid "When only option C<-iso> is used dos2unix will try to determine the active code page. When this is not possible dos2unix will use default code page CP437, which is mainly used in the USA. To force a specific code page use options C<-437> (US), C<-850> (Western European), C<-860> (Portuguese), C<-863> (French Canadian), or C<-865> (Nordic). Windows code page CP1252 (Western European) is also supported with option C<-1252>. For other code pages use dos2unix in combination with iconv(1). Iconv can convert between a long list of character encodings." msgstr "" "当只指定了 C<-iso> 选项时,dos2unix将尝试确定当前活动代码页。若无法确定,则使用默认代码页 CP437(普遍用于美国)。若要强制指定代码页,请使用选项 C<-437>(美国)、C<-850>(西欧)、C<-860>(葡萄牙)、C<-863>(法国、加拿大)或C<-865>(北欧)。\n" "Windows CP1252代码页(西欧)也可以通过选项 C<-1252> 获得支持。若要使用其他代码页,可以结合 iconv(1) 使用dos2unix。iconv可以在很多字符编码间进行转换。" #. type: textblock #: dos2unix.pod:510 msgid "Never use ISO conversion on Unicode text files. It will corrupt UTF-8 encoded files." msgstr "不对Unicode编码文本使用ISO转换。因这一转换会导致UTF-8编码文件损坏。" #. type: textblock #: dos2unix.pod:512 msgid "Some examples:" msgstr "一些示例:" #. type: textblock #: dos2unix.pod:514 msgid "Convert from DOS default code page to Unix Latin-1:" msgstr "从DOS默认编码页转换到Unix Latin-1:" #. type: verbatim #: dos2unix.pod:516 #, no-wrap msgid "" " dos2unix -iso -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -iso -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:518 msgid "Convert from DOS CP850 to Unix Latin-1:" msgstr "从DOS CP850转换到Unix Latin-1:" #. type: verbatim #: dos2unix.pod:520 #, no-wrap msgid "" " dos2unix -850 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -850 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:522 msgid "Convert from Windows CP1252 to Unix Latin-1:" msgstr "从Windows CP1252转换到Unix Latin-1:" #. type: verbatim #: dos2unix.pod:524 #, no-wrap msgid "" " dos2unix -1252 -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -1252 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:526 msgid "Convert from Windows CP1252 to Unix UTF-8 (Unicode):" msgstr "从WIndows CP1252转换到Unix UTF-8(Unicode):" #. type: verbatim #: dos2unix.pod:528 #, no-wrap msgid "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" msgstr "" " iconv -f CP1252 -t UTF-8 in.txt | dos2unix > out.txt\n" "\n" #. type: textblock #: dos2unix.pod:530 msgid "Convert from Unix Latin-1 to DOS default code page:" msgstr "从Unix Latin-1转换到DOS默认编码页:" #. type: verbatim #: dos2unix.pod:532 #, no-wrap msgid "" " unix2dos -iso -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -iso -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:534 msgid "Convert from Unix Latin-1 to DOS CP850:" msgstr "从Unix Latin-1转换到DOS CP850:" #. type: verbatim #: dos2unix.pod:536 #, no-wrap msgid "" " unix2dos -850 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -850 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:538 msgid "Convert from Unix Latin-1 to Windows CP1252:" msgstr "从Unix Latin-1转换到Windows CP1252:" #. type: verbatim #: dos2unix.pod:540 #, no-wrap msgid "" " unix2dos -1252 -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -1252 -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:542 msgid "Convert from Unix UTF-8 (Unicode) to Windows CP1252:" msgstr "从Unix UTF-8(Unicode)转换到Windows CP1252:" #. type: verbatim #: dos2unix.pod:544 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t CP1252 > out.txt\n" "\n" #. type: textblock #: dos2unix.pod:546 msgid "See also L and L." msgstr "参见 L et L。" #. type: =head1 #: dos2unix.pod:551 msgid "UNICODE" msgstr "UNICODE" #. type: =head2 #: dos2unix.pod:553 msgid "Encodings" msgstr "编码" #. type: textblock #: dos2unix.pod:555 msgid "There exist different Unicode encodings. On Unix and Linux Unicode files are typically encoded in UTF-8 encoding. On Windows Unicode text files can be encoded in UTF-8, UTF-16, or UTF-16 big endian, but are mostly encoded in UTF-16 format." msgstr "有几种不同的Unicode编码。对于Unix和Linux中的Unicode文件,通常为UTF-8编码。Windows中的文本文件可以是UTF-8、UTF-16或UTF-16BE编码,但大多采用UTF-16格式。" #. type: =head2 #: dos2unix.pod:560 msgid "Conversion" msgstr "转换" #. type: textblock #: dos2unix.pod:562 msgid "Unicode text files can have DOS, Unix or Mac line breaks, like regular text files." msgstr "Unicode文本文件可以含有DOS、Unix或Mac断行符,就像普通文本文件一样。" #. type: textblock #: dos2unix.pod:565 msgid "All versions of dos2unix and unix2dos can convert UTF-8 encoded files, because UTF-8 was designed for backward compatibility with ASCII." msgstr "所有版本的dos2unix和unix2dos都可以转换UTF-8文件,因为UTF-8向后兼容ASCII。" #. type: textblock #: dos2unix.pod:568 msgid "Dos2unix and unix2dos with Unicode UTF-16 support, can read little and big endian UTF-16 encoded text files. To see if dos2unix was built with UTF-16 support type C." msgstr "含有Unicode UTF-16支持的dos2unix和unix2dos可以读取小尾序或大尾序的UTF-16编码文本。输入 C 来确定dos2unix在编译是是否启用了UTF-16支持。" #. type: textblock #: dos2unix.pod:572 msgid "On Unix/Linux UTF-16 encoded files are converted to the locale character encoding. Use the locale(1) command to find out what the locale character encoding is. When conversion is not possible a conversion error will occur and the file will be skipped." msgstr "在Unix/Linux中,UTF-16编码文件将被转换为区域字符编码所指定的编码。可以使用 locale(1) 命令来查看当前的区域字符编码。若无法转换,程序将报告转换错误并跳过此文件。" #. type: textblock #: dos2unix.pod:577 msgid "On Windows UTF-16 files are by default converted to UTF-8. UTF-8 formatted text files are well supported on both Windows and Unix/Linux." msgstr "在Windows中,UTF-16文件被默认转换为UTF-8格式。Windows和Unix/Linux均支持UTF-8格式的文本文件。" #. type: textblock #: dos2unix.pod:580 msgid "UTF-16 and UTF-8 encoding are fully compatible, there will no text be lost in the conversion. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." msgstr "UTF-16和UTF-8编码相互兼容,所以彼此转换时不会丢失文本。倘若转换中出错,比如UTF-16格式的输入文件含有错误,那么该文件将被跳过。" #. type: textblock #: dos2unix.pod:584 msgid "When option C<-u> is used, the output file will be written in the same UTF-16 encoding as the input file. Option C<-u> prevents conversion to UTF-8." msgstr "若使用了 C<-u> 选项,输出文件将会使用和输入文件相同的UTF-16编码。C<-u>选项将阻止程序转换到UTF-8。" #. type: textblock #: dos2unix.pod:587 msgid "Dos2unix and unix2dos have no option to convert UTF-8 files to UTF-16." msgstr "dos2unix和unix2dos没有用于转换UTF-8到UTF-16的选项。" #. type: textblock #: dos2unix.pod:589 msgid "ISO and 7-bit mode conversion do not work on UTF-16 files." msgstr "ISO和7位编码模式的转换无法用于UTF-16文件。" #. type: =head2 #: dos2unix.pod:591 msgid "Byte Order Mark" msgstr "字节序标记" #. type: textblock #: dos2unix.pod:593 msgid "On Windows Unicode text files typically have a Byte Order Mark (BOM), because many Windows programs (including Notepad) add BOMs by default. See also L." msgstr "在Windows中,文本文件一般含有字节序标记(BOM),因为很多Windows程序(包括记事本)默认添加BOM。参见 L。" #. type: textblock #: dos2unix.pod:597 msgid "On Unix Unicode files typically don't have a BOM. It is assumed that text files are encoded in the locale character encoding." msgstr "在Unix中,Unicode文件一般不含BOM。假定文本文件使用区域字符编码设置所指定的编码。" #. type: textblock #: dos2unix.pod:600 msgid "Dos2unix can only detect if a file is in UTF-16 format if the file has a BOM. When an UTF-16 file doesn't have a BOM, dos2unix will see the file as a binary file." msgstr "dos2unix只能检测含有BOM文件的UTF-16格式。若UTF-16文件不含BOM,dos2unix会将其视作二进制文件。" #. type: textblock #: dos2unix.pod:604 msgid "Use option C<-ul> or C<-ub> to convert an UTF-16 file without BOM." msgstr "请使用选项 C<-ul> 或 C<-ub> 来转换不含BOM的UTF-16文件。" #. type: textblock #: dos2unix.pod:606 msgid "Dos2unix writes by default no BOM in the output file. With option C<-b> Dos2unix writes a BOM when the input file has a BOM." msgstr "dos2unix默认不输出BOM。使用 C<-b> 选项可以让dos2unix将BOM添加到输出文件,如果输入文件也含有BOM的话。" #. type: textblock #: dos2unix.pod:609 msgid "Unix2dos writes by default a BOM in the output file when the input file has a BOM. Use option C<-r> to remove the BOM." msgstr "unix2dos默认输出BOM,如果输入文件也含有BOM的话。使用 C<-r> 可以移除BOM。" #. type: textblock #: dos2unix.pod:612 msgid "Dos2unix and unix2dos write always a BOM when option C<-m> is used." msgstr "若使用了 C<-m> 选项,dos2unix和unix2dos将总是输出BOM。" #. type: =head2 #: dos2unix.pod:614 msgid "Unicode file names on Windows" msgstr "Windows中Unicode文件的文件名" #. type: textblock #: dos2unix.pod:616 msgid "Dos2unix has optional support for reading and writing Unicode file names in the Windows Command Prompt. That means that dos2unix can open files that have characters in the name that are not part of the default system ANSI code page. To see if dos2unix for Windows was built with Unicode file name support type C." msgstr "dos2unix对于Windows命令提示符中读取和写入Unicode文件名有额外的支持。这意味着dos2unix可以打开那些包含非默认系统ANSI编码页字符的文件。若要查看Windows版dos2unix在编译时是否加入了Unicode文件名支持,请输入 C。" #. type: textblock #: dos2unix.pod:622 msgid "There are some issues with displaying Unicode file names in a Windows console. See option C<-D>, C<--display-enc>. The file names may be displayed wrongly in the console, but the files will be written with the correct name." msgstr "在Windows终端中显示Unicode文件名有一些需要注意的问题。请参见 C<-D> 和 C<--display-enc> 选项。文件名在终端中可能无法被正确显示,但写入文件时文件名仍然是正确的。" #. type: =head2 #: dos2unix.pod:626 msgid "Unicode examples" msgstr "Unicode示例" #. type: textblock #: dos2unix.pod:628 msgid "Convert from Windows UTF-16 (with BOM) to Unix UTF-8:" msgstr "转换Windows UTF-16到Unix UTF-8:" #. type: verbatim #: dos2unix.pod:630 #, no-wrap msgid "" " dos2unix -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:632 msgid "Convert from Windows UTF-16LE (without BOM) to Unix UTF-8:" msgstr "转换Windows UTF-16LE(不含BOM)到Unix UTF-8:" #. type: verbatim #: dos2unix.pod:634 #, no-wrap msgid "" " dos2unix -ul -n in.txt out.txt\n" "\n" msgstr "" " dos2unix -ul -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:636 msgid "Convert from Unix UTF-8 to Windows UTF-8 with BOM:" msgstr "转换Unix UTF-8到Windows UTF-8(并添加BOM):" #. type: verbatim #: dos2unix.pod:638 #, no-wrap msgid "" " unix2dos -m -n in.txt out.txt\n" "\n" msgstr "" " unix2dos -m -n in.txt out.txt\n" "\n" #. type: textblock #: dos2unix.pod:640 msgid "Convert from Unix UTF-8 to Windows UTF-16:" msgstr "转换Unix UTF-8到Windows UTF-16:" #. type: verbatim #: dos2unix.pod:642 #, no-wrap msgid "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" msgstr "" " unix2dos < in.txt | iconv -f UTF-8 -t UTF-16 > out.txt\n" "\n" #. type: =head1 #: dos2unix.pod:644 msgid "GB18030" msgstr "GB18030" #. type: textblock #: dos2unix.pod:646 msgid "GB18030 is a Chinese government standard. A mandatory subset of the GB18030 standard is officially required for all software products sold in China. See also L." msgstr "GB18030是中国国家标准。GB18030标准的一系列子集被强制应用于中国销售的软件产品。参见 L。" #. type: textblock #: dos2unix.pod:650 msgid "GB18030 is fully compatible with Unicode, and can be considered an unicode transformation format. Like UTF-8, GB18030 is compatible with ASCII. GB18030 is also compatible with Windows code page 936, also known as GBK." msgstr "GB18030与Unicode完全兼容,并且可以被认为是Unicode格式的变体。和UTF-8一样,GB18030也兼容ASCII。GB18030也兼容Windows 936代码页(GBK)。" #. type: textblock #: dos2unix.pod:654 msgid "On Unix/Linux UTF-16 files are converted to GB18030 when the locale encoding is set to GB18030. Note that this will only work if the locale is supported by the system. Use command C to get the list of supported locales." msgstr "在Unix/Linux中,若区域编码被设置为GB18030,UTF-16文件将被转换为GB18030格式。注意只有当系统支持区域设置时这一才会进行这一转换。可以使用 C 命令来获取受支持的区域。" #. type: textblock #: dos2unix.pod:658 msgid "On Windows you need to use option C<-gb> to convert UTF-16 files to GB18030." msgstr "在Windows中,你需要使用 C<-gb> 选项来转换UTF-16文件到GB18030编码。" #. type: textblock #: dos2unix.pod:660 msgid "GB18030 encoded files can have a Byte Order Mark, like Unicode files." msgstr "GB18030编码的文件和Unicode文件一样可以含有BOM。" #. type: =head1 #: dos2unix.pod:662 msgid "EXAMPLES" msgstr "示例" #. type: textblock #: dos2unix.pod:664 msgid "Read input from 'stdin' and write output to 'stdout':" msgstr "从标准输入读取,并输出到标准输出:" #. type: verbatim #: dos2unix.pod:666 #, fuzzy, no-wrap #| msgid "" #| " dos2unix -ic *.txt | xargs dos2unix\n" #| "\n" msgid "" " dos2unix < a.txt\n" " cat a.txt | dos2unix\n" "\n" msgstr "" " dos2unix -ic *.txt | xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:669 msgid "Convert and replace a.txt. Convert and replace b.txt:" msgstr "转换并覆盖a.txt和b.txt:" #. type: verbatim #: dos2unix.pod:671 #, no-wrap msgid "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" msgstr "" " dos2unix a.txt b.txt\n" " dos2unix -o a.txt b.txt\n" "\n" #. type: textblock #: dos2unix.pod:674 msgid "Convert and replace a.txt in ascii conversion mode:" msgstr "转换并覆盖a.txt,使用ascii模式:" #. type: verbatim #: dos2unix.pod:676 #, no-wrap msgid "" " dos2unix a.txt\n" "\n" msgstr "" " dos2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:678 msgid "Convert and replace a.txt in ascii conversion mode, convert and replace b.txt in 7bit conversion mode:" msgstr "转换并覆盖a.txt,使用ascii模式;转换并覆盖b.txt,使用7位编码模式:" #. type: verbatim #: dos2unix.pod:681 #, no-wrap msgid "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" msgstr "" " dos2unix a.txt -c 7bit b.txt\n" " dos2unix -c ascii a.txt -c 7bit b.txt\n" " dos2unix -ascii a.txt -7 b.txt\n" "\n" #. type: textblock #: dos2unix.pod:685 msgid "Convert a.txt from Mac to Unix format:" msgstr "将a.txt从Mac格式转换到Unix格式:" #. type: verbatim #: dos2unix.pod:687 #, no-wrap msgid "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" msgstr "" " dos2unix -c mac a.txt\n" " mac2unix a.txt\n" "\n" #. type: textblock #: dos2unix.pod:690 msgid "Convert a.txt from Unix to Mac format:" msgstr "将a.txt从Unix格式转换到Mac格式:" #. type: verbatim #: dos2unix.pod:692 #, no-wrap msgid "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" msgstr "" " unix2dos -c mac a.txt\n" " unix2mac a.txt\n" "\n" #. type: textblock #: dos2unix.pod:695 msgid "Convert and replace a.txt while keeping original date stamp:" msgstr "转换并覆盖a.txt,保留原始时间戳:" #. type: verbatim #: dos2unix.pod:697 #, no-wrap msgid "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" msgstr "" " dos2unix -k a.txt\n" " dos2unix -k -o a.txt\n" "\n" #. type: textblock #: dos2unix.pod:700 msgid "Convert a.txt and write to e.txt:" msgstr "转换a.txt,并输出到e.txt:" #. type: verbatim #: dos2unix.pod:702 #, no-wrap msgid "" " dos2unix -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:704 msgid "Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt:" msgstr "转换a.txt,并输出到e.txt,同时使e.txt的时间戳和a.txt一致:" #. type: verbatim #: dos2unix.pod:706 #, no-wrap msgid "" " dos2unix -k -n a.txt e.txt\n" "\n" msgstr "" " dos2unix -k -n a.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:708 msgid "Convert and replace a.txt, convert b.txt and write to e.txt:" msgstr "转换并覆盖a.txt;转换b.txt并输出到e.txt:" #. type: verbatim #: dos2unix.pod:710 #, no-wrap msgid "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" msgstr "" " dos2unix a.txt -n b.txt e.txt\n" " dos2unix -o a.txt -n b.txt e.txt\n" "\n" #. type: textblock #: dos2unix.pod:713 msgid "Convert c.txt and write to e.txt, convert and replace a.txt, convert and replace b.txt, convert d.txt and write to f.txt:" msgstr "转换c.txt并输出到e.txt;转换并覆盖a.txt和b.txt;转换d.txt并输出到f.txt:" #. type: verbatim #: dos2unix.pod:716 #, no-wrap msgid "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" msgstr "" " dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt\n" "\n" #. type: =head1 #: dos2unix.pod:718 msgid "RECURSIVE CONVERSION" msgstr "递归转换" #. type: textblock #: dos2unix.pod:720 msgid "Use dos2unix in combination with the find(1) and xargs(1) commands to recursively convert text files in a directory tree structure. For instance to convert all .txt files in the directory tree under the current directory type:" msgstr "结合 find(1) 和 xargs(1) 使用dos2unix可以递归地转换目录树中的文本文件。例如,转换当前目录的目录树中所有的.txt文件:" #. type: verbatim #: dos2unix.pod:724 #, no-wrap msgid "" " find . -name '*.txt' |xargs dos2unix\n" "\n" msgstr "" " find . -name '*.txt' |xargs dos2unix\n" "\n" #. type: textblock #: dos2unix.pod:726 msgid "In a Windows Command Prompt the following command can be used:" msgstr "在Windows命令提示符中,可以使用下列命令:" #. type: verbatim #: dos2unix.pod:728 #, no-wrap msgid "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" msgstr "" " for /R %G in (*.txt) do dos2unix \"%G\"\n" "\n" #. type: textblock #: dos2unix.pod:730 msgid "PowerShell users can use the following command in Windows PowerShell:" msgstr "PowerShell用户可以在Windows PowerShell中使用如下命令:" #. type: verbatim #: dos2unix.pod:732 #, no-wrap msgid "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" msgstr "" " get-childitem -path . -filter '*.txt' -recurse | foreach-object {dos2unix $_.Fullname}\n" "\n" #. type: =head1 #: dos2unix.pod:735 msgid "LOCALIZATION" msgstr "区域" #. type: =item #: dos2unix.pod:739 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:741 msgid "The primary language is selected with the environment variable LANG. The LANG variable consists out of several parts. The first part is in small letters the language code. The second is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for POSIX standard type shells:" msgstr "LANG环境变量指定了程序所使用的首选语言。它包括几个部分:第一部分是小写的语言编码,第二部分是(可选的)大写的国家/地区代码,前面用下划线连接;第三部分也是可选的,即字符编码,前面用点连接。一些POSIX规范的示例如下:" #. type: verbatim #: dos2unix.pod:748 #, no-wrap msgid "" " export LANG=nl Dutch\n" " export LANG=nl_NL Dutch, The Netherlands\n" " export LANG=nl_BE Dutch, Belgium\n" " export LANG=es_ES Spanish, Spain\n" " export LANG=es_MX Spanish, Mexico\n" " export LANG=en_US.iso88591 English, USA, Latin-1 encoding\n" " export LANG=en_GB.UTF-8 English, UK, UTF-8 encoding\n" "\n" msgstr "" " export LANG=zh 中文\n" " export LANG=zh_CN 中文,中国\n" " export LANG=zh_TW 中文,台湾\n" " export LANG=es_ES 西班牙语,西班牙\n" " export LANG=es_MX 西班牙语,墨西哥\n" " export LANG=en_US.iso88591 英语,美国,Latin-1编码\n" " export LANG=en_GB.UTF-8 英语,英国,UTF-8编码\n" "\n" #. type: textblock #: dos2unix.pod:756 msgid "For a complete list of language and country codes see the gettext manual: L" msgstr "完整的语言和国家/地区编码可以在gettext手册中找到:L" #. type: textblock #: dos2unix.pod:759 msgid "On Unix systems you can use the command locale(1) to get locale specific information." msgstr "在Unix系统中,你可以使用 locale(1) 命令获取特定区域的信息。" #. type: =item #: dos2unix.pod:762 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:764 msgid "With the LANGUAGE environment variable you can specify a priority list of languages, separated by colons. Dos2unix gives preference to LANGUAGE over LANG. For instance, first Dutch and then German: C. You have to first enable localization, by setting LANG (or LC_ALL) to a value other than \"C\", before you can use a language priority list through the LANGUAGE variable. See also the gettext manual: L" msgstr "可以使用LANGUAGE变量指定一系列语言的优先级,各项之间由冒号分割。dos2unix首先使用LANGUAGE变量,其次才是LANG。例如,首选中文、其次英文:C。在使用语言优先级之前,必须先启用区域化功能,即将LANG(或LC_ALL)变量设置为除了“C”以外的其他值。参见gettext手册:L" #. type: textblock #: dos2unix.pod:772 msgid "If you select a language which is not available you will get the standard English messages." msgstr "如果你选择了一个不可用的语言,程序将会输出标准的英语信息。" #. type: =item #: dos2unix.pod:776 msgid "B" msgstr "B" #. type: textblock #: dos2unix.pod:778 msgid "With the environment variable DOS2UNIX_LOCALEDIR the LOCALEDIR set during compilation can be overruled. LOCALEDIR is used to find the language files. The GNU default value is C. Option B<--version> will display the LOCALEDIR that is used." msgstr "DOS2UNIX_LOCALEDIR环境变量将覆盖编译时设置的LOCALEDIR变量。LOCALEDIR被用于查找语言文件。GNU程序的默认值为 C。可以使用 B<--version> 查看当前的LOCALEDIR。" #. type: textblock #: dos2unix.pod:783 msgid "Example (POSIX shell):" msgstr "示例(POSIX shell):" #. type: verbatim #: dos2unix.pod:785 #, no-wrap msgid "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" msgstr "" " export DOS2UNIX_LOCALEDIR=$HOME/share/locale\n" "\n" #. type: =head1 #: dos2unix.pod:790 msgid "RETURN VALUE" msgstr "返回值" #. type: textblock #: dos2unix.pod:792 msgid "On success, zero is returned. When a system error occurs the last system error will be returned. For other errors 1 is returned." msgstr "若成功,返回0。若出现系统错误,则返回最近一次系统错误号。若发生其他错误,返回1。" #. type: textblock #: dos2unix.pod:795 msgid "The return value is always zero in quiet mode, except when wrong command-line options are used." msgstr "在安静模式下,返回值总是为0,除非命令行选项有误。" #. type: =head1 #: dos2unix.pod:798 msgid "STANDARDS" msgstr "遵循规范" #. type: textblock #: dos2unix.pod:800 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:802 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:804 msgid "L" msgstr "L" #. type: textblock #: dos2unix.pod:806 msgid "L" msgstr "L" #. type: =head1 #: dos2unix.pod:808 msgid "AUTHORS" msgstr "作者" #. type: textblock #: dos2unix.pod:810 msgid "Benjamin Lin - , Bernd Johannes Wuebben (mac2unix mode) - , Christian Wurll (add extra newline) - , Erwin Waterlander - (maintainer)" msgstr "Benjamin Lin - Bernd Johannes Wuebben(mac2unix模式) - ,Christian Wurll(添加额外新行) - ,Erwin Waterlander - (维护者)" #. type: textblock #: dos2unix.pod:815 msgid "Project page: L" msgstr "项目主页:L" #. type: textblock #: dos2unix.pod:817 msgid "SourceForge page: L" msgstr "SourceForge主页:L" #. type: =head1 #: dos2unix.pod:819 msgid "SEE ALSO" msgstr "参见" #. type: textblock #: dos2unix.pod:821 msgid "file(1) find(1) iconv(1) locale(1) xargs(1)" msgstr "file(1) find(1) iconv(1) locale(1) xargs(1)" #~ msgid "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgstr "" #~ " dos2unix\n" #~ " dos2unix -l -c mac\n" #~ "\n" #~ msgid "Freecode: L" #~ msgstr "Freecode: L" #~ msgid "The Windows versions of dos2unix and unix2dos convert UTF-16 encoded files always to UTF-8 encoded files. Unix versions of dos2unix/unix2dos convert UTF-16 encoded files to the locale character encoding when it is set to UTF-8. Use the locale(1) command to find out what the locale character encoding is." #~ msgstr "Les versions Windows de dos2unix et unix2dos convertissent toujours les fichiers UTF-16 en fichiers UTF-8. Les versions Unix de dos2unix/unix2dos convertissent les fichiers UTF-16 vers le codage de l'environnement linguistique quand il est en UTF-8. Utilisez la commande locale(1) pour connaître le codage de l'environnement linguistique en vigueur." #~ msgid "Because UTF-8 formatted text files are well supported on both Windows and Unix, dos2unix and unix2dos have no option to write UTF-16 files. All UTF-16 characters can be encoded in UTF-8. Conversion from UTF-16 to UTF-8 is without loss. UTF-16 files will be skipped on Unix when the locale character encoding is not UTF-8, to prevent accidental loss of text. When an UTF-16 to UTF-8 conversion error occurs, for instance when the UTF-16 input file contains an error, the file will be skipped." #~ msgstr "Puisque les fichiers textes au format UTF-8 sont bien supportés sous Windows et Unix, dos2unix et unix2dos n'ont pas d'option pour écrire des fichiers UTF-16. Tous les caractères UTF-16 peuvent être codés en UTF-8. La conversion de UTF-16 vers UTF-8 est sans perte. Les fichiers UTF-16 seront ignorés sous Unix quand l'encodage des caractères de l'environnement linguistique n'est pas UTF-8 pour éviter la perte accidentelle du texte. Quand une conversion de UTF-16 vers UTF-8 échoue, par exemple parce que le fichier d'entrée UTF-16 contient des erreurs, le fichier est ignoré." #~ msgid "Dos2unix never writes a BOM in the output file, unless you use option C<-m>." #~ msgstr "Dos2unix n'écrit jamais de BOM dans le fichier de sortie à moins que vous utilisiez l'option C<-m>." #~ msgid "Dos2unix was modelled after dos2unix under SunOS/Solaris and has similar conversion modes." #~ msgstr "Dos2unix a été conçu comme dos2unix sous SunOS/Solaris et a des modes de conversions similaires." #~ msgid "Conversion modes I, I<7bit>, and I are similar to those of dos2unix/unix2dos under SunOS/Solaris." #~ msgstr "Les modes de conversion I, I<7bit> et I sont similaires à ceux de dos2unix/unix2dos sous SunOS/Solaris." dos2unix-7.3.4/querycp.c0000644000175500010010000001401412721132543014403 0ustar waterlanGeen/* querycp.c is in the public domain */ #if (defined(__WATCOMC__) && defined(__NT__)) # define _WIN32 1 #endif #ifdef __DJGPP__ #include #include #include /* ---------------------------------------------------------------------- Tuesday, May 5, 2009 1:40pm rugxulo _AT_ gmail _DOT_ com This file is (obviously?) not copyrighted, "nenies proprajxo" !! Tested successfully on DR-DOS 7.03, FreeDOS 1.0++, and MS-DOS 6.22. (Doesn't work on XP or Vista, though.) ---------------------------------------------------------------------- unsigned short query_con_codepage(void); gets currently selected display CON codepage int 21h, 6601h ("chcp") needs NLSFUNC.EXE + COUNTRY.SYS, but many obscure codepages (e.g. FD's cp853 from EGA.CPX (CPIX.ZIP) or Kosta Kostis' cp913 from ISOLATIN.CPI (ISOCP101.ZIP) have no relevant data inside COUNTRY.SYS. int 21h, 440Ch 6Ah only works in MS-DOS and DR-DOS (not FreeDOS) because FreeDOS DISPLAY is an .EXE TSR, not a device driver, and hence doesn't fully support IOCTL, so they use the undocumented int 2Fh, 0AD02h (which doesn't work in DR-DOS!). But DR-DOS' DISPLAY doesn't respond to the typical install check i.d. anyways. FreeDOS currently only supports COUNTRY.SYS in their "unstable" kernel 2037, but at least their KEYB, "gxoje", supports cp853 too (thanks, Henrique!). P.S. For MS or DR: ren ega.cpx *.com ; upx -d ega.com ; ren ega.com *.cpi ADDENDUM (2011): Latest "stable" FreeDOS kernel is 2040, it now includes COUNTRY.SYS support by default, but NLSFUNC (CHCP) 'system code page' support is partially unimplemented (lacking some int 2Fh calls, yet Eduardo Casino didn't seem too worried, so I dunno, nag him if necessary, heh). ---------------------------------------------------------------------- */ unsigned short query_con_codepage(void) { __dpmi_regs regs; unsigned short param_block[2] = { 0, 437 }; regs.d.eax = 0x440C; /* GENERIC IO FOR HANDLES */ regs.d.ebx = 1; /* STDOUT */ regs.d.ecx = 0x036A; /* 3 = CON, 0x6A = QUERY SELECTED CP */ regs.x.ds = __tb >> 4; /* using transfer buffer for low mem. */ regs.x.dx = __tb & 0x0F; /* (suggested by DJGPP FAQ, hi Eli!) */ regs.x.flags |= 1; /* preset carry for potential failure */ __dpmi_int (0x21, ®s); if (!(regs.x.flags & 1)) /* if succeed (carry flag not set) */ dosmemget( __tb, 4, param_block); else { /* (undocumented method) */ regs.x.ax = 0xAD02; /* 440C -> MS-DOS or DR-DOS only */ regs.x.bx = 0xFFFE; /* AD02 -> MS-DOS or FreeDOS only */ regs.x.flags |= 1; __dpmi_int(0x2F, ®s); if ((!(regs.x.flags & 1)) && (regs.x.bx < 0xFFFE)) param_block[1] = regs.x.bx; } return param_block[1]; } #elif defined(__WATCOMC__) && defined(__I86__) /* Watcom C, 16 bit Intel */ /* rugxulo _AT_ gmail _DOT_ com */ #include #include #include unsigned short query_con_codepage(void) { union REGS regs; unsigned short param_block[2] = { 0, 437 }; regs.x.ax = 0x440C; /* GENERIC IO FOR HANDLES */ regs.x.bx = 1; /* STDOUT */ regs.x.cx = 0x036A; /* 3 = CON, 0x6A = QUERY SELECTED CP */ regs.x.dx = (unsigned short)param_block; regs.x.cflag |= 1; /* preset carry for potential failure */ int86(0x21, ®s, ®s); if (regs.x.cflag) /* if not succeed (carry flag set) */ { regs.x.ax = 0xAD02; /* 440C -> MS-DOS or DR-DOS only */ regs.x.bx = 0xFFFE; /* AD02 -> MS-DOS or FreeDOS only */ regs.x.cflag |= 1; int86(0x2F, ®s, ®s); } if ((!(regs.x.cflag)) && (regs.x.bx < 0xFFFE)) param_block[1] = regs.x.bx; return param_block[1]; } #elif defined(__WATCOMC__) && defined(__DOS__) /* Watcom C, 32 bit DOS */ /* rugxulo _AT_ gmail _DOT_ com */ #include #include #include unsigned short query_con_codepage(void) { union REGS regs; unsigned short param_block[2] = { 0, 437 }; regs.x.eax = 0x440C; /* GENERIC IO FOR HANDLES */ regs.x.ebx = 1; /* STDOUT */ regs.x.ecx = 0x036A; /* 3 = CON, 0x6A = QUERY SELECTED CP */ regs.x.edx = (unsigned short)param_block; regs.x.cflag |= 1; /* preset carry for potential failure */ int386(0x21, ®s, ®s); if (regs.x.cflag) /* if not succeed (carry flag set) */ { regs.x.eax = 0xAD02; /* 440C -> MS-DOS or DR-DOS only */ regs.x.ebx = 0xFFFE; /* AD02 -> MS-DOS or FreeDOS only */ regs.x.cflag |= 1; int386(0x2F, ®s, ®s); } if ((!(regs.x.cflag)) && (regs.x.ebx < 0xFFFE)) param_block[1] = regs.x.ebx; return param_block[1]; } #elif defined (_WIN32) && !defined(__CYGWIN__) /* Windows, not Cygwin */ /* Erwin Waterlander */ #include unsigned short query_con_codepage(void) { /* Dos2unix is modelled after dos2unix under SunOS/Solaris. * The original dos2unix ISO mode on SunOS supported code * pages CP437, CP850, CP860, CP863, and CP865, which * are DOS code pages. Therefore we request here the DOS * code page of the Console. The DOS code page is used * by DOS programs, for instance text editor 'edit'. */ /* Get the console's DOS code page */ return((unsigned short)GetConsoleOutputCP()); /* Get the system's ANSI code page */ /* return((unsigned short)GetACP()); */ } #elif defined (__OS2__) /* OS/2 Warp */ #define INCL_DOS #include unsigned short query_con_codepage(void) { ULONG cp[3]; ULONG cplen; DosQueryCp(sizeof(cp), cp, &cplen); return((unsigned short)cp[0]); } #else /* Unix, other */ unsigned short query_con_codepage(void) { return(0); } #endif #ifdef TEST int main() { printf("\nCP%u\n",query_con_codepage() ); /* should be same result as */ return 0; /* "mode con cp /status" */ } #endif dos2unix-7.3.4/querycp.h0000644000175500010010000000012212721132543014403 0ustar waterlanGeen/* querycp.h is in the public domain */ unsigned short query_con_codepage(void); dos2unix-7.3.4/README.txt0000644000175500010010000002367312721132543014260 0ustar waterlanGeen dos2unix - DOS/Mac to Unix and vice versa text file format converter. FILE LIST README.txt : This file. INSTALL.txt : How to build and install. COPYING.txt : distribution license. NEWS.txt : Basic change log for users. ChangeLog.txt : Detailed change log for programmers. TODO.txt : Things to do. BUGS.txt : Known bugs and instructions on reporting new ones. DEVEL.txt : Information about dos2unix' implementation choices. man/man1/dos2unix.txt : Dos2unix manual, text format. man/man1/dos2unix.htm : Dos2unix manual, HTML format. PROJECT HOME PAGE http://waterlan.home.xs4all.nl/dos2unix.html HISTORY This is an update of Benjamin Lin's implementations of dos2unix and unix2dos. Benjamin Lin's implementations of dos2unix and unix2dos were distributed via SunSITE.unc.edu (later MetaLab.unc.edu, now ibiblio) and became part of several Linux distributions such as RedHat, Suse, Gentoo, and others. This update includes all RedHat patches and fixes several other problems. Internationalization has been added and ports to DOS, Windows, Cygwin and OS/2 Warp have been made. These implementations of dos2unix and unix2dos have been modelled after dos2unix/unix2dos under SunOS/Solaris. The first versions were made by John Birchfield in 1989, and in 1995 rewritten from scratch by Benjamin Lin. Mac to Unix conversion was added by Bernd Johannes Wuebben in 1998, Unix to Mac conversion by Erwin Waterlander in 2010. In 2010 the two separate dos2unix and unix2dos packages have been bundled into a single dos2unix package (version 5.0). Support for Unicode UTF-16 was added in 2012 (version 6.0). Version 7.0, in 2014, was a major code cleanup and added a test suite. Features * Native language support. * Automatically skips binary and non-regular files. * In-place, paired, or stdio mode conversion. * Keep original file dates option. * 7-bit and iso conversion modes like SunOS dos2unix. * Conversion of Unicode UTF-16 files. * Handles Unicode Byte Order Mark (BOM). * Display file information. * Secure. AUTHORS Erwin Waterlander version 3.2 - 7.3.4 2009-2016 Christian Wurll version 3.1 1998 Bernd Johannes Wuebben version 3.0 1998 Benjamin Lin version 1.1 - 2.3 1994-1995 John Birchfield version 1.0 1989 TRANSLATORS Since verion 6.0.5 dos2unix is part of the Translation Project (TP). All translations go via the Translation Project. Translation of the messages. See http://translationproject.org/domain/dos2unix.html Brazilian Portuguese Enrico Nicoletto Version 6.0.5 Brazilian Portuguese Rafael Ferreira Version 6.0.6 - 7.2 Brazilian Portuguese Rafael Fontenelle Version 7.3.2 - 7.3.4 Chinese (simplified) Tianze Wang Version 7.3.1 - 7.3.3 Chinese (traditional) mail6543210 Version 6.0.5 Danish Thomas Pryds Version 6.0.5 - 6.0.6 Danish Joe Hansen Version 7.2.3 - 7.3.4 Dutch Erwin Waterlander Version 4.0 - 6.0.4 Dutch Benno Schulenberg Version 6.0.5 - 7.3.4 Esperanto Rugxulo Version 5.1 - 6.0.4 Esperanto Benno Schulenberg Version 6.0.5 - 7.3 French Frédéric Marchal Version 6.0.5 - 7.3.4 German Philipp Thomas Version 5.0 - 6.0.3, 7.0, 7.2.2 - 7.3.4 German Lars Wendler Version 6.0.4 German Mario Blättermann Version 6.0.6, 7.1 - 7.2 Hungarian Balázs Úr Version 6.0.5 - 7.2.3 Japanese Yasuaki Taniguchi Version 7.1.1 Japanese Takeshi Hamasaki Version 7.3.4 Norwegian Bokmaal Åka Sikrom Version 6.0.6 - 7.3.4 Polish Jakub Bogusz Version 6.0.5 - 7.3.4 Russian Андрей Углик (Andrei Uhlik) Version 6.0.4 Russian Yuri Kozlov Version 6.0.6 - 7.3.4 Serbian Мирослав Николић Version 6.0.5 - 7.3.4 Spanish Julio A. Freyre-Gonzalez Version 5.3.1 - 6.0.4 Spanish Enrique Lazcorreta Puigmartí Version 6.0.6 - 7.3.1 Swedish Sebastian Rasmussen Version 7.3.2 - 7.3.4 Ukrainian Yuri Chornoivan Version 6.0.5 - 7.3.4 Vietnamese Trần Ngọc Quân Version 6.0.5 - 7.3.4 Translation of the manual. See http://translationproject.org/domain/dos2unix-man.html Brazilian Portuguese Rafael Ferreira Version 6.0.5 - 7.2 Brazilian Portuguese Rafael Fontenelle Version 7.3.2 - 7.3.4 Chinese (simplified) Tianze Wang Version 7.3.1 - 7.3.3 Dutch Erwin Waterlander Version 5.1.1 - 6.0.4 Dutch Benno Schulenberg Version 6.0.5 - 7.3.3 French Frédéric Marchal Version 6.0.5 - 7.3.3 German Mario Blättermann Version 6.0.5 - 7.3.3 Polish Jakub Bogusz Version 6.0.5 - 7.3.3 Spanish Julio A. Freyre-Gonzalez Version 5.3.1 - 6.0.4 Spanish Enrique Lazcorreta Puigmartí Version 6.0.6 - 7.2.1 Swedish Sebastian Rasmussen Version 7.3.2 - 7.3.3 Ukrainian Yuri Chornoivan Version 6.0.5 - 7.3.3 ACKNOWLEDGEMENTS Rugxulo query_con_codepage(), code page detection in DOS. Rugxulo DJGPP stubs for mac2unix and unix2mac. Jari Aalto Improvements man page. Jari Aalto Improvements Makefile. Ben Pfaff Treat form feeds as valid text. Marc Gianzero Darwin OS port. Elbert Pol OS/2 port. Tim Waugh Various patches. Mike Harris Man page update. Bernard RosenKraenzer segfault patch. Tim Powers mkstemp patch. Miloslav Trmac safeconv patch. Charles Wilson Follow symbolic links. Charles Wilson Makefile and code cleanup for Cygwin. Christopher Williams Maintain file ownership in old file mode. Steven H. Levine Support wildcard expansion on OS/2. Steve Hay Support wildcard expansion on win64. Michael Schindler Fixed compiler warning. Somsak Pattanaprateep Print line number when binary symbol is found. Justin Lecher Makefile improvement. F.J. Brandelik Reported problems when win32 version processes huge files on a network drive. Benno Schulenberg Cleaning up the UI messages. Mario Blättermann Generate pod files from gettext po files with po4a. Daniel Macks Reported dependency on GNU sed. Alan S. Jones Reported bug in UTF-16 conversion by mac2unix. Alan S. Jones Idea for an info option, to list file statistics about line breaks and byte order marks. Gary Johnson Idea for an info option, to list only files which have DOS line breaks, or only files with Unix line breaks. Helmut Karlowski Makefile and PrintVersion() update for freeMiNT. Tom Christiansen Fix for wrong title in HTML manuals. Armin Müller Fixed typo in if condition in write_bom(). Philip Rowlands Reported that dos2unix was not checking for file I/O errors while reading the input. Baruch Siach Fix compilation error "'wchar_t' undeclared" when Unicode support is disabled. Ulf-Dietrich Braumann Reported that the -iso option was misinterpreted as a corrupted -i option. Hans Passant Correct redirection of unicode UTF-16 screen output. anonymous Don't install international man pages when NLS is disabled. Alan S. Jones New flags h (print header) and p (show file names without path) for option -i, --info FINDUTILS Windows users who are looking for the Unix 'find' and 'xargs' commands can find them in the findutils package for Windows at the ezwinports project page at: http://sourceforge.net/projects/ezwinports/files/ A DOS version of the findutils package can be obtained from the DJGPP project (http://www.delorie.com/djgpp/) at ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/ CONTACT INFORMATION Project home page : http://waterlan.home.xs4all.nl/dos2unix.html SourceForge project page : http://sourceforge.net/projects/dos2unix/ Erwin Waterlander waterlan@xs4all.nl http://waterlan.home.xs4all.nl/ If you need support you can email me directly or make a ticket on the SourceForge project page. Help in any form is appreciated. A problem report, a fix, or just a remark. dos2unix-7.3.4/test/0000755000175500010010000000000012721132543013526 5ustar waterlanGeendos2unix-7.3.4/test/ascii.t0000755000175500010010000001023212721132543015004 0ustar waterlanGeen#!/usr/bin/perl # Requires perl-Test-Simple installation. use Test::Simple tests => 30; $suffix = ""; if (-e "../dos2unix.exe") { $suffix = ".exe"; } $DOS2UNIX = "../dos2unix" . $suffix; $MAC2UNIX = "../mac2unix" . $suffix; $UNIX2DOS = "../unix2dos" . $suffix; $UNIX2MAC = "../unix2mac" . $suffix; system("$DOS2UNIX -v -n dos.txt out_unix.txt; cmp out_unix.txt unix.txt"); ok( $? == 0, 'DOS to Unix conversion' ); system("$MAC2UNIX -v -n mac.txt out_unix.txt; cmp out_unix.txt unix.txt"); ok( $? == 0, 'DOS to Unix conversion' ); system("$UNIX2DOS -v -n unix.txt out_dos.txt; cmp out_dos.txt dos.txt"); ok( $? == 0, 'Unix to DOS conversion' ); system("$UNIX2MAC -v -n unix.txt out_mac.txt; cmp out_mac.txt mac.txt"); ok( $? == 0, 'Unix to Mac conversion' ); system("cp -f dos.txt out_unix.txt; $DOS2UNIX -v out_unix.txt; cmp out_unix.txt unix.txt"); ok( $? == 0, 'DOS to Unix conversion, old file mode' ); system("cp -f unix.txt out_dos.txt; $UNIX2DOS -v out_dos.txt; cmp out_dos.txt dos.txt"); ok( $? == 0, 'Unix to DOS conversion, old file mode' ); system("$DOS2UNIX -v -n unix.txt out_unix.txt; cmp out_unix.txt unix.txt"); ok( $? == 0, 'dos2unix must not change unix line breaks'); system("$DOS2UNIX -v -n mac.txt out_unix.txt; cmp out_unix.txt mac.txt"); ok( $? == 0, 'dos2unix must not change mac line breaks'); system("$MAC2UNIX -v -n unix.txt out_unix.txt; cmp out_unix.txt unix.txt"); ok( $? == 0, 'mac2unix must not change unix line breaks'); system("$MAC2UNIX -v -n dos.txt out_unix.txt; cmp out_unix.txt dos.txt"); ok( $? == 0, 'mac2unix must not change dos line breaks'); system("$UNIX2DOS -v -n dos.txt out_dos.txt; cmp out_dos.txt dos.txt"); ok( $? == 0, 'unix2dos must not change dos line breaks'); system("$UNIX2DOS -v -n mac.txt out_dos.txt; cmp out_dos.txt mac.txt"); ok( $? == 0, 'unix2dos must not change mac line breaks'); system("$UNIX2MAC -v -n dos.txt out_mac.txt; cmp out_mac.txt dos.txt"); ok( $? == 0, 'unix2mac must not change dos line breaks'); system("$UNIX2MAC -v -n mac.txt out_mac.txt; cmp out_mac.txt mac.txt"); ok( $? == 0, 'unix2mac must not change mac line breaks'); system("$DOS2UNIX -v -n mixed.txt out.txt; cmp out.txt mixedd2u.txt"); ok( $? == 0, 'DOS to Unix conversion mixed'); system("$MAC2UNIX -v -n mixed.txt out.txt; cmp out.txt mixedm2u.txt"); ok( $? == 0, 'DOS to Unix conversion mixed'); system("$UNIX2DOS -v -n mixed.txt out.txt; cmp out.txt mixedu2d.txt"); ok( $? == 0, 'Unix to DOS conversion mixed'); system("$UNIX2MAC -v -n mixed.txt out.txt; cmp out.txt mixedu2m.txt"); ok( $? == 0, 'Unix to Mac conversion mixed'); system("$DOS2UNIX -v -l -n dos.txt out_unix.txt; cmp out_unix.txt unix_dbl.txt"); ok( $? == 0, 'DOS to Unix conversion with line doubling'); system("$MAC2UNIX -v -l -n mac.txt out_unix.txt; cmp out_unix.txt unix_dbl.txt"); ok( $? == 0, 'DOS to Unix conversion with line doubling'); system("$UNIX2DOS -v -l -n unix.txt out_dos.txt; cmp out_dos.txt dos_dbl.txt"); ok( $? == 0, 'Unix to DOS conversion with line doubling'); system("$UNIX2MAC -v -l -n unix.txt out_mac.txt; cmp out_mac.txt mac_dbl.txt"); ok( $? == 0, 'Unix to Mac conversion with line doubling'); system("$DOS2UNIX -v -l -n unix.txt out_unix.txt; cmp out_unix.txt unix.txt"); ok( $? == 0, 'dos2unix -l must not change unix line breaks'); system("$DOS2UNIX -v -l -n mac.txt out_unix.txt; cmp out_unix.txt mac.txt"); ok( $? == 0, 'dos2unix -l must not change mac line breaks'); system("$MAC2UNIX -v -l -n unix.txt out_unix.txt; cmp out_unix.txt unix.txt"); ok( $? == 0, 'mac2unix -l must not change unix line breaks'); system("$MAC2UNIX -v -l -n dos.txt out_unix.txt; cmp out_unix.txt dos.txt"); ok( $? == 0, 'mac2unix -l must not change dos line breaks'); system("$UNIX2DOS -v -l -n dos.txt out_dos.txt; cmp out_dos.txt dos.txt"); ok( $? == 0, 'unix2dos -l must not change dos line breaks'); system("$UNIX2DOS -v -l -n mac.txt out_dos.txt; cmp out_dos.txt mac.txt"); ok( $? == 0, 'unix2dos -l must not change mac line breaks'); system("$UNIX2MAC -v -l -n dos.txt out_mac.txt; cmp out_mac.txt dos.txt"); ok( $? == 0, 'unix2mac -l must not change dos line breaks'); system("$UNIX2MAC -v -l -n mac.txt out_mac.txt; cmp out_mac.txt mac.txt"); ok( $? == 0, 'unix2mac -l must not change mac line breaks'); dos2unix-7.3.4/test/chard7.txt0000644000175500010010000000037412721132543015443 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ dos2unix-7.3.4/test/chardos.txt0000644000175500010010000000037412721132543015716 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ dos2unix-7.3.4/test/charu7.txt0000644000175500010010000000035612721132543015464 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ dos2unix-7.3.4/test/charunix.txt0000644000175500010010000000035612721132543016114 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ dos2unix-7.3.4/test/chk_loc.sh0000755000175500010010000000023712721132543015471 0ustar waterlanGeen#!/bin/sh LOC=`echo $1 | sed 's/-//g'` locale -a | sed 's/-//g' | grep -i "${LOC}" 2>&1 > /dev/null if [ "$?" = "0" ] then echo "yes" else echo "no" fi dos2unix-7.3.4/test/cp_1252.txt0000644000175500010010000000037412721132543015346 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ ................ ................ dos2unix-7.3.4/test/cp_437.txt0000644000175500010010000000037412721132543015272 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ ................ ................ ........ ...... ........... ............ . ..... dos2unix-7.3.4/test/cp_850.txt0000644000175500010010000000037412721132543015271 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ ................ ................ Ͼ ǎԐ ѥ噞 Ƅ Ф dos2unix-7.3.4/test/cp_860.txt0000644000175500010010000000037412721132543015272 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ ................ ................ ......... ...... ...... ....... ...... ....... dos2unix-7.3.4/test/cp_863.txt0000644000175500010010000000037412721132543015275 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ ................ ................ ... . .... ......... . ..... dos2unix-7.3.4/test/cp_865.txt0000644000175500010010000000037412721132543015277 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ ................ ................ ......... ....... ........... ........... . .... dos2unix-7.3.4/test/dos.txt0000644000175500010010000000004012721132543015046 0ustar waterlanGeenhello world take a break dos2unix-7.3.4/test/dos_bin.txt0000644000175500010010000000022012721132543015676 0ustar waterlanGeen $ $  !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ dos2unix-7.3.4/test/dos_bom.txt0000644000175500010010000000004312721132543015706 0ustar waterlanGeenhello world take a break dos2unix-7.3.4/test/dos_dbl.txt0000644000175500010010000000005412721132543015674 0ustar waterlanGeenhello world take a break dos2unix-7.3.4/test/dos_gb.txt0000644000175500010010000000004412721132543015522 0ustar waterlanGeen13hello world take a break dos2unix-7.3.4/test/gb18030.t0000755000175500010010000000432112721132543014702 0ustar waterlanGeen#!/usr/bin/perl # Requires perl-Test-Simple installation. use Test::Simple tests => 12; $suffix = ""; if (-e "../dos2unix.exe") { $suffix = ".exe"; } $DOS2UNIX = "../dos2unix" . $suffix; $MAC2UNIX = "../mac2unix" . $suffix; $UNIX2DOS = "../unix2dos" . $suffix; $UNIX2MAC = "../unix2mac" . $suffix; if ($ENV{'MSYSTEM'} =~ /^MINGW/) { $GB_OPT = '-gb'; } else { $GB_OPT = ''; $ENV{'LC_ALL'} = 'zh_CN.GB18030'; } system("$DOS2UNIX $GB_OPT -v -n dos_gb.txt out_unix.txt; cmp out_unix.txt unix.txt"); ok( $? == 0, 'dos2unix removes GB18030 BOM' ); system("$DOS2UNIX $GB_OPT -v -b -n dos_bom.txt out_unix.txt; cmp out_unix.txt unix_bom.txt"); ok( $? == 0, 'dos2unix -b keeps UTF-8 BOM in GB18030 locale' ); system("$DOS2UNIX $GB_OPT -v -m -n dos.txt out_unix.txt; cmp out_unix.txt unix_gb.txt"); ok( $? == 0, 'dos2unix -m adds GB18030 BOM' ); system("$UNIX2DOS $GB_OPT -v -n unix_bom.txt out_dos.txt; cmp out_dos.txt dos_bom.txt"); ok( $? == 0, 'unix2dos keeps UTF-8 BOM in GB18030 locale' ); system("$UNIX2DOS $GB_OPT -v -r -n unix_gb.txt out_dos.txt; cmp out_dos.txt dos.txt"); ok( $? == 0, 'unix2dos -r removes GB18030 BOM' ); system("$UNIX2DOS $GB_OPT -v -m -n unix.txt out_dos.txt; cmp out_dos.txt dos_gb.txt"); ok( $? == 0, 'unix2dos -m adds GB18030 BOM' ); system("$DOS2UNIX $GB_OPT -v -n utf16le.txt out_unix.txt; cmp out_unix.txt gb18030u.txt"); ok( $? == 0, 'dos2unix convert DOS UTF-16LE to Unix GB18030' ); system("$DOS2UNIX $GB_OPT -b -v -n utf16le.txt out_unix.txt; cmp out_unix.txt gb18030b.txt"); ok( $? == 0, 'dos2unix convert DOS UTF-16LE to Unix GB18030, keep BOM' ); system("$UNIX2DOS $GB_OPT -v -n utf16be.txt out_dos.txt; cmp out_dos.txt gb18030.txt"); ok( $? == 0, 'unix2dos convert DOS UTF-16BE to DOS GB18030, keep BOM' ); system("$DOS2UNIX $GB_OPT -u -v -m -n dos.txt out_unix.txt; cmp out_unix.txt unix_gb.txt"); ok( $? == 0, 'dos2unix with option -u adds GB18030 BOM to non UTF-16 file' ); $ENV{'LC_ALL'} = 'en_US.UTF-8'; system("$DOS2UNIX -v -b -n dos_gb.txt out_unix.txt; cmp out_unix.txt unix_gb.txt"); ok( $? == 0, 'dos2unix -b keeps GB18030 BOM in UTF-8 locale' ); system("$UNIX2DOS -v -n unix_gb.txt out_dos.txt; cmp out_dos.txt dos_gb.txt"); ok( $? == 0, 'unix2dos keeps GB18030 BOM in UTF-8 locale' ); dos2unix-7.3.4/test/gb18030.txt0000644000175500010010000000254712721132543015263 0ustar waterlanGeen13ıµ͹ıݵ׸2007˿Լ15ǼάҲɡĺִ֮ݵĴСıλڰµǰ˹ɽͥеĽ԰Ϊеʷ൱ƾãʷϼأıֽµϽʷƾõijСıĪصijأĪز36ĶгһıȹġıҲָӼҺղء롤Ĺ磬Ӱ֮ءıϳ1996걻Ϲ̿֯Ų¼ 22 Unicode Scalar Value UTF-8 NCR U+2070E 32 32 U+20731 37 37 U+20779 39 39 U+20C53 41 41 U+20C78 48 48 U+20C96 48 48 U+20CCF 45 45 U+20CD5 41 41 U+20D15 45 45 U+20D7C 48 48 U+20D7F 41 41 U+20E0E 44 44 U+20E0F 45 45 U+20E77 49 49 U+20E9D 47 47 U+20EA2 42 42 U+20ED7 55 55 U+20EF9 59 59 U+20EFA 50 50 U+20F2D 51 51 U+20F2E 52 52 U+20F4C 52 52 U+20FB4 56 56 U+20FBC 54 54 U+20FEA 50 50 U+2105C 54 54 U+2106F 53 53 U+21075 59 59 U+21076 50 50 U+2107B 55 55 U+210C1 55 55 U+210C9 53 53 U+211D9 55 55 U+220C7 87 87 U+227B5 01 01 U+22AD5 01 01 U+22B43 01 01 U+22BCA 06 06 U+22C51 11 11 U+22C55 15 15 U+22CC2 14 14 U+22D08 14 14 U+22D4C 12 12 U+22D67 19 19 U+22EB3 11 11dos2unix-7.3.4/test/gb18030b.txt0000644000175500010010000000246512721132543015424 0ustar waterlanGeen13ıµ͹ıݵ׸2007˿Լ15ǼάҲɡĺִ֮ݵĴСıλڰµǰ˹ɽͥеĽ԰Ϊеʷ൱ƾãʷϼأıֽµϽʷƾõijСıĪصijأĪز36ĶгһıȹġıҲָӼҺղء롤Ĺ磬Ӱ֮ءıϳ1996걻Ϲ̿֯Ų¼ 22 Unicode Scalar Value UTF-8 NCR U+2070E 32 32 U+20731 37 37 U+20779 39 39 U+20C53 41 41 U+20C78 48 48 U+20C96 48 48 U+20CCF 45 45 U+20CD5 41 41 U+20D15 45 45 U+20D7C 48 48 U+20D7F 41 41 U+20E0E 44 44 U+20E0F 45 45 U+20E77 49 49 U+20E9D 47 47 U+20EA2 42 42 U+20ED7 55 55 U+20EF9 59 59 U+20EFA 50 50 U+20F2D 51 51 U+20F2E 52 52 U+20F4C 52 52 U+20FB4 56 56 U+20FBC 54 54 U+20FEA 50 50 U+2105C 54 54 U+2106F 53 53 U+21075 59 59 U+21076 50 50 U+2107B 55 55 U+210C1 55 55 U+210C9 53 53 U+211D9 55 55 U+220C7 87 87 U+227B5 01 01 U+22AD5 01 01 U+22B43 01 01 U+22BCA 06 06 U+22C51 11 11 U+22C55 15 15 U+22CC2 14 14 U+22D08 14 14 U+22D4C 12 12 U+22D67 19 19 U+22EB3 11 11dos2unix-7.3.4/test/gb18030u.txt0000644000175500010010000000246112721132543015443 0ustar waterlanGeenıµ͹ıݵ׸2007˿Լ15ǼάҲɡĺִ֮ݵĴСıλڰµǰ˹ɽͥеĽ԰Ϊеʷ൱ƾãʷϼأıֽµϽʷƾõijСıĪصijأĪز36ĶгһıȹġıҲָӼҺղء롤Ĺ磬Ӱ֮ءıϳ1996걻Ϲ̿֯Ų¼ 22 Unicode Scalar Value UTF-8 NCR U+2070E 32 32 U+20731 37 37 U+20779 39 39 U+20C53 41 41 U+20C78 48 48 U+20C96 48 48 U+20CCF 45 45 U+20CD5 41 41 U+20D15 45 45 U+20D7C 48 48 U+20D7F 41 41 U+20E0E 44 44 U+20E0F 45 45 U+20E77 49 49 U+20E9D 47 47 U+20EA2 42 42 U+20ED7 55 55 U+20EF9 59 59 U+20EFA 50 50 U+20F2D 51 51 U+20F2E 52 52 U+20F4C 52 52 U+20FB4 56 56 U+20FBC 54 54 U+20FEA 50 50 U+2105C 54 54 U+2106F 53 53 U+21075 59 59 U+21076 50 50 U+2107B 55 55 U+210C1 55 55 U+210C9 53 53 U+211D9 55 55 U+220C7 87 87 U+227B5 01 01 U+22AD5 01 01 U+22B43 01 01 U+22BCA 06 06 U+22C51 11 11 U+22C55 15 15 U+22CC2 14 14 U+22D08 14 14 U+22D4C 12 12 U+22D67 19 19 U+22EB3 11 11dos2unix-7.3.4/test/info.txt0000644000175500010010000000066512721132543015231 0ustar waterlanGeen 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 0 51 52 no_bom binary utf16len.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 50 0 0 GB18030 text gb18030.txt dos2unix-7.3.4/test/info_ub.txt0000644000175500010010000000034212721132543015707 0ustar waterlanGeen 50 0 0 UTF-16BE text utf16be.txt 50 0 0 no_bom text utf16ben.txt 0 50 0 UTF-8 text utf8unxb.txt 50 0 0 GB18030 text gb18030.txt dos2unix-7.3.4/test/info_ucs.txt0000644000175500010010000000104512721132543016074 0ustar waterlanGeen 6 0 0 no_bom text dos.txt 0 6 0 no_bom text unix.txt 0 0 6 no_bom text mac.txt 6 6 6 no_bom text mixed.txt 50 0 0 UTF-16LE text utf16le.txt 50 0 0 UTF-16BE text utf16be.txt 0 51 52 no_bom binary utf16len.txt 0 50 0 no_bom text utf8unix.txt 50 0 0 UTF-8 text utf8dos.txt 50 0 0 GB18030 text gb18030.txt dos2unix-7.3.4/test/info_ul.txt0000644000175500010010000000034212721132543015721 0ustar waterlanGeen 50 0 0 UTF-16LE text utf16le.txt 50 0 0 no_bom text utf16len.txt 0 50 0 UTF-8 text utf8unxb.txt 50 0 0 GB18030 text gb18030.txt dos2unix-7.3.4/test/invalhig.txt0000644000175500010010000000003612721132543016067 0ustar waterlanGeen1 2 3 4 5dos2unix-7.3.4/test/invallow.txt0000644000175500010010000000003612721132543016121 0ustar waterlanGeen1 2 3 4 5dos2unix-7.3.4/test/iso.t0000755000175500010010000000672512721132543014522 0ustar waterlanGeen#!/usr/bin/perl # Requires perl-Test-Simple installation. use Test::Simple tests => 14; $suffix = ""; if (-e "../dos2unix.exe") { $suffix = ".exe"; } $DOS2UNIX = "../dos2unix" . $suffix; $MAC2UNIX = "../mac2unix" . $suffix; $UNIX2DOS = "../unix2dos" . $suffix; $UNIX2MAC = "../unix2mac" . $suffix; # To check for instance cp850 to iso88591 conversion # you can do a visual check like this (on Windows). # # In a Windows Command Prompt, set font to Lucida Console. # Then set the code page to 850: # chcp 850 # Display complete cp850 code page: # type chardos.txt # # In a Cygwin Mintty terminal, under Options->Text # set Character set to ISO-8859-1 # Display converted character set: # cat iso_850.txt # # You now see the same characters as in the Windows Command Prompt # with the non-convertable characters replaced with a dot. system("$DOS2UNIX -v -iso -437 -n chardos.txt out_unix.txt; cmp out_unix.txt iso_437.txt"); ok( $? == 0, 'DOS to Unix conversion, cp437 to iso88591 with option -iso' ); system("$DOS2UNIX -v -437 -n chardos.txt out_unix.txt; cmp out_unix.txt iso_437.txt"); ok( $? == 0, 'DOS to Unix conversion, cp437 to iso88591 without option -iso' ); system("$DOS2UNIX -v -850 -n chardos.txt out_unix.txt; cmp out_unix.txt iso_850.txt"); ok( $? == 0, 'DOS to Unix conversion, cp850 to iso88591' ); system("$DOS2UNIX -v -860 -n chardos.txt out_unix.txt; cmp out_unix.txt iso_860.txt"); ok( $? == 0, 'DOS to Unix conversion, cp860 to iso88591' ); system("$DOS2UNIX -v -863 -n chardos.txt out_unix.txt; cmp out_unix.txt iso_863.txt"); ok( $? == 0, 'DOS to Unix conversion, cp863 to iso88591' ); system("$DOS2UNIX -v -865 -n chardos.txt out_unix.txt; cmp out_unix.txt iso_865.txt"); ok( $? == 0, 'DOS to Unix conversion, cp865 to iso88591' ); system("$DOS2UNIX -v -1252 -n chardos.txt out_unix.txt; cmp out_unix.txt iso_1252.txt"); ok( $? == 0, 'DOS to Unix conversion, cp1252 to iso88591' ); # To check for instance iso88591 to cp850 conversion # you can do a visual check like this (on Windows). # # In a Cygwin Mintty terminal, under Options->Text # set Character set to ISO-8859-1 # Display complete ISO-8859-1 character set: # cat charunix.txt # # In a Windows Command Prompt, set font to Lucida Console. # Then set the code page to 850: # chcp 850 # Display converted cp850 code page: # type cp_850.txt # # You now see the same characters as in the Mintty terminal # with the non-convertable characters replaced with a dot. system("$UNIX2DOS -v -iso -437 -n charunix.txt out_dos.txt; cmp out_dos.txt cp_437.txt"); ok( $? == 0, 'Unix to DOS conversion, iso88591 to cp437 with option -iso' ); system("$UNIX2DOS -v -437 -n charunix.txt out_dos.txt; cmp out_dos.txt cp_437.txt"); ok( $? == 0, 'Unix to DOS conversion, iso88591 to cp437 without option -iso' ); system("$UNIX2DOS -v -850 -n charunix.txt out_dos.txt; cmp out_dos.txt cp_850.txt"); ok( $? == 0, 'Unix to DOS conversion, iso88591 to cp850' ); system("$UNIX2DOS -v -860 -n charunix.txt out_dos.txt; cmp out_dos.txt cp_860.txt"); ok( $? == 0, 'Unix to DOS conversion, iso88591 to cp860' ); system("$UNIX2DOS -v -863 -n charunix.txt out_dos.txt; cmp out_dos.txt cp_863.txt"); ok( $? == 0, 'Unix to DOS conversion, iso88591 to cp863' ); system("$UNIX2DOS -v -865 -n charunix.txt out_dos.txt; cmp out_dos.txt cp_865.txt"); ok( $? == 0, 'Unix to DOS conversion, iso88591 to cp865' ); system("$UNIX2DOS -v -1252 -n charunix.txt out_dos.txt; cmp out_dos.txt cp_1252.txt"); ok( $? == 0, 'Unix to DOS conversion, iso88591 to cp1252' ); dos2unix-7.3.4/test/iso_1252.txt0000644000175500010010000000035612721132543015536 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ ................ ................ dos2unix-7.3.4/test/iso_437.txt0000644000175500010010000000035612721132543015462 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ ܢ.. Ѫ. ................ ................ ................ .............. .......... dos2unix-7.3.4/test/iso_850.txt0000644000175500010010000000035612721132543015461 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ . Ѫ .......... ............. ...... յݯ .. dos2unix-7.3.4/test/iso_860.txt0000644000175500010010000000035612721132543015462 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ ܢ. ѪҬ ................ ................ ................ .............. .......... dos2unix-7.3.4/test/iso_863.txt0000644000175500010010000000035612721132543015465 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ . ܢ. . ................ ................ ................ .............. .......... dos2unix-7.3.4/test/iso_865.txt0000644000175500010010000000035612721132543015467 0ustar waterlanGeen !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ .. Ѫ. ................ ................ ................ .............. .......... dos2unix-7.3.4/test/mac.txt0000644000175500010010000000003212721132543015022 0ustar waterlanGeenhello world take a break dos2unix-7.3.4/test/mac_dbl.txt0000644000175500010010000000004012721132543015642 0ustar waterlanGeenhello world take a break dos2unix-7.3.4/test/Makefile0000644000175500010010000000210012721132543015157 0ustar waterlanGeenTESTS = ascii.t iso.t utf8.t misc.t d2u_os=$(shell uname -s) UCS = 1 # Checking WIN32 version in MSYS shell. ifeq ($(findstring MINGW,$(d2u_os)),MINGW) TESTS += gb18030.t endif ifneq ($(findstring FreeBSD,$(d2u_os)),FreeBSD) # Unix/Linux/Cygwin. Check if zh_CN.gb18030 locale is supported. ifeq ($(shell ./chk_loc.sh zh_CN.gb18030),yes) TESTS += gb18030.t endif endif # DOS and Windows version do not support symlinks like the Unix version. ifeq ($(DJGPP),) ifneq ($(findstring MINGW,$(d2u_os)),MINGW) TESTS += symlink.t endif endif ifeq ($(UCS),1) TESTS +=utf16.t endif all: test check: test test: prove -v $(TESTS) ascii: prove -v $@.t iso: prove -v $@.t misc: prove -v $@.t utf8: prove -v $@.t utf16: prove -v $@.t gb18030: prove -v $@.t symlink: prove -v $@.t wcstombs: $(CC) -Wall -Wextra wcstombs_test.c -o wcstombs_test @echo "====> test wcstombs() UTF-8" LC_ALL=en_US.UTF-8 ./wcstombs_test @echo "====> test wcstombs() GB18030" LC_ALL=zh_CN.GB18030 ./wcstombs_test testu16: testu16.c gcc $< -o $@ clean: rm -f out*.txt in_link.txt wcstombs_test dos2unix-7.3.4/test/misc.t0000755000175500010010000000472312721132543014657 0ustar waterlanGeen#!/usr/bin/perl # Requires perl-Test-Simple installation. use Test::Simple tests => 13; $suffix = ""; if (-e "../dos2unix.exe") { $suffix = ".exe"; } $DOS2UNIX = "../dos2unix" . $suffix; $MAC2UNIX = "../mac2unix" . $suffix; $UNIX2DOS = "../unix2dos" . $suffix; $UNIX2MAC = "../unix2mac" . $suffix; $ENV{'LC_ALL'} = 'en_US.UTF-8'; system("$DOS2UNIX -v -7 -n chardos.txt out_unix.txt; cmp out_unix.txt charu7.txt"); ok( $? == 0, '7bit'); system("$DOS2UNIX -v < dos.txt > out_unix.txt; cmp out_unix.txt unix.txt"); ok( $? == 0, 'DOS to Unix conversion, stdin/out' ); system("$UNIX2DOS -v < unix.txt > out_dos.txt; cmp out_dos.txt dos.txt"); ok( $? == 0, 'Unix to DOS conversion, stdin/out' ); system("$DOS2UNIX -v -n utf16len.txt out_bin.txt"); # file out_bin.txt may not exist. if (-e "out_bin.txt") { $exists = "1"; } else { $exists = "0"; } ok( $exists == 0, 'dos2unix skip binary file.' ); system("$UNIX2DOS -v -n utf16len.txt out_bin.txt"); # file out_bin.txt may not exist. if (-e "out_bin.txt") { $exists = "1"; } else { $exists = "0"; } ok( $exists == 0, 'unix2dos skip binary file.' ); system("$DOS2UNIX -v < utf16len.txt > out.txt"); $result = ($? >> 8); ok( $result == 1, 'Dos2unix stdio returns error on binary input.' ); system("$UNIX2DOS -v < utf16len.txt > out.txt"); $result = ($? >> 8); ok( $result == 1, 'Unix2dos stdio returns error on binary input.' ); system("rm -f out_forc.txt"); system("$DOS2UNIX -f -v -n utf16len.txt out_forc.txt"); # file out_bin.txt may not exist. if (-e "out_forc.txt") { $exists = "1"; } else { $exists = "0"; } ok( $exists == 1, 'dos2unix force binary file.' ); system("rm -f out_forc.txt"); system("$UNIX2DOS -f -v -n utf16len.txt out_forc.txt"); # file out_bin.txt may not exist. if (-e "out_forc.txt") { $exists = "1"; } else { $exists = "0"; } ok( $exists == 1, 'unix2dos force binary file.' ); system("$DOS2UNIX -v -f -n dos_bin.txt out_unix.txt; cmp out_unix.txt unix_bin.txt"); ok( $? == 0, 'Dos2unix, force ASCII file with binary symbols' ); system("$UNIX2DOS -v -f -n unix_bin.txt out_dos.txt; cmp out_dos.txt dos_bin.txt"); ok( $? == 0, 'Unix2dos, force ASCII file with binary symbols' ); system("$DOS2UNIX -i dos.txt unix.txt mac.txt mixed.txt utf16len.txt utf8unix.txt utf8dos.txt gb18030.txt > outinfo.txt"); system("$DOS2UNIX outinfo.txt; diff info.txt outinfo.txt"); ok( $? == 0, 'Option -i, --info'); system("$DOS2UNIX -v -n gb18030.txt out_unix.txt; cmp out_unix.txt gb18030u.txt"); ok( $? == 0, 'Remove GB18030 BOM'); dos2unix-7.3.4/test/mixed.txt0000644000175500010010000000012412721132543015372 0ustar waterlanGeenhello world take a break hello world take a break hello world take a break dos2unix-7.3.4/test/mixedd2u.txt0000644000175500010010000000011612721132543016006 0ustar waterlanGeenhello world take a break hello world take a break hello world take a break dos2unix-7.3.4/test/mixedm2u.txt0000644000175500010010000000012412721132543016016 0ustar waterlanGeenhello world take a break hello world take a break hello world take a break dos2unix-7.3.4/test/mixedu2d.txt0000644000175500010010000000013212721132543016004 0ustar waterlanGeenhello world take a break hello world take a break hello world take a break dos2unix-7.3.4/test/mixedu2m.txt0000644000175500010010000000012412721132543016016 0ustar waterlanGeenhello world take a break hello world take a break hello world take a break dos2unix-7.3.4/test/README.txt0000644000175500010010000000103612721132543015224 0ustar waterlanGeenAlthough locale -a says on FreeBSD 10.1 that zh_CN.GB18030 is supported, the conversion of CJK characters fails. This makes the gb18030 test of dos2unix fail on FreeBSD. The problem is wcstombs(), and this is demonstrated with wcstombs_test.c. Run the test with the command: gmake wcstombs This is correct output: cc -Wall -Wextra wcstombs_test.c -o wcstombs_test ====> test wcstombs() UTF-8 LC_ALL=en_US.UTF-8 ./wcstombs_test E8 90 A8 00 00 PASS ====> test wcstombs() GB18030 LC_ALL=zh_CN.GB18030 ./wcstombs_test C8 F8 00 00 00 PASS dos2unix-7.3.4/test/setlocale.c0000644000175500010010000000515712721132543015655 0ustar waterlanGeen#include #include #include #include /* This program proves that when you set the locale to "", the Chinese ANSI CP936 encoded text is printed wrongly in a simplified Chinese regional setting. UTF-8 is also printed wrongly. To test this program you first need to change the Windows locale setting to simplified Chinese. There is no problem doing that, because the "display language" will stay the original language, and you can still use your Windows. Control Panel > Region and Language > Administrative > Change system locale Select simplified Chinese and reboot your PC. For example output see setlocale.png. */ print_string(const char* str, const char* ustr, const wchar_t *wstr) { int prevmode; UINT outputCP; int utf8 = 0; /* Set utf8 to 1 to print UTF-8 text. If you print both UTF-16 en UTF-8 in one program the console gets mixed up. When the UTF-8 is printed after UTF-16 the UTF-16 text is displayed wrongly. */ if ( ! utf8 ) { /* When the locale is set to "" the following line will produce wrong output */ printf ("ANSI CP936 %s\n",str); /* UTF-16 will produce correct output in all cases. */ prevmode = _setmode(_fileno(stdout), _O_U16TEXT); wprintf(L"UTF-16 %ls\n",wstr); _setmode(_fileno(stdout), prevmode); } else { /* UTF-8 will produce wrong output when the locale is "". When the locale is "C" wrong output with raster font, and correct output with TrueType font. */ outputCP = GetConsoleOutputCP(); SetConsoleOutputCP(CP_UTF8); wprintf(L"UTF-8 %S\n",ustr); SetConsoleOutputCP(outputCP); /* The code below produces wrong output in all cases */ // prevmode = _setmode(_fileno(stdout), _O_U8TEXT); // wprintf(L"UTF-8 %S",ustr); // _setmode(_fileno(stdout), prevmode); } } int main() { char str[5]; /* ANSI CP936 */ char ustr[15]; /* UTF-8 */ wchar_t wstr[10]; /* UTF-16 */ /* Create ANSI CP936 string (meaning: Western-European). */ str[0] = 0xce; str[1] = 0xf7; str[2] = 0xc5; str[3] = 0xb7; str[4] = '\0'; /* Convert CP936 to UTF-16. */ MultiByteToWideChar(936, 0, str, -1, wstr, sizeof(wstr)); /* Convert UTF-16 to UTF-8 */ WideCharToMultiByte(CP_UTF8, 0, wstr, -1, ustr, sizeof(ustr), NULL, NULL); setlocale (LC_ALL, ""); printf("==> setlocale (LC_ALL, \"\");\n"); print_string(str, ustr, wstr); setlocale (LC_ALL, "C"); printf("\n==> setlocale (LC_ALL, \"C\");\n"); print_string(str, ustr, wstr); return 0; } dos2unix-7.3.4/test/setlocale.png0000644000175500010010000004411212721132543016211 0ustar waterlanGeenPNG  IHDR`Q!LsRGBgAMA a pHYsodGIDATx^ݿgIr~咮uf@K SXzm g i  68h 3oPyoEwܨ<2-eDdds TPxo }Ccxޠ;94Q' zCcxޠ;94Q' zCcxޠ;94Q }%^v= p!ox{5oЛ%Ysh  D=VDox=nA#І~g'0?ufn?z9<6=64) + }|w`]΃=64~7SD6p[A$ x1ov3ҫR zGȯh}94Qzp|o>~_߽_~xчcO> 28~X[׷>}?{Ks=g #{;dϗ~xƏۜ'z>wx{fx=^fɯj| *)qkD?2 =eSC[5{a?h?uѯO{3ù{p=w߈{yϡ zؔwAxQ3k}_=>rI=W4vŻ|{;7w#Q`kޠ;9C%lAxQA*?kF=~.}ox׽?ߘ; zC;oDg (;%tX |m=+Q{yϡ߈JN~ogQu%Z=}q{^ehY*}?=3e lv=65b^Y#3pW]o5zXzt€XJ :,Nߟ^uL |c>Aowsh }z۹X}]gz769';~vwrY{6e8tCoh= YnGy1^ADlA: v %D(` XAK0` ?xw!  %D(` X"D;71`XomCAâAT0 a jOD07f1 a jc8(y(Q c XAK0`74QLaD?}Ɵųjϫ}ٷָ D0iqы]f] g5戣}әVOޯj8;eG xݾ6˟a9zgV^#w?Y^gou~;}{ 7#sW_'R9wng>kջ<>W=|ףWr=w D7T*y9UߙZzyF,^GNW߹;krm0Bm5}YLzk^/&^똗xqoy1ӱFDF6^N^{{^ZbQń'zy^&yVǼϲ6Z/ɾhHrƋ7v弼WIޫ1ﳬmG֋Ij/(/^pv>>uh^ўj۫{=u'{&Eqy:yjU9Ssuيr^<9lte\ol.wf#es{,O粸ٗWElmo>۵okY[ gzeJ^%-U6ժ5QZWS/*Gs*l̫^H,G^^lf+59G{Hˋ|Ƌ7Q΋Xvyy; jbmr۫y9齶赧W{VzGzqۘ嬨V=rN?ۼfc^h95&Usױ,ߋi-_ĴlO%v4V֚j\Dz|/|Ƌ7QNZ5^\j}ٞYDoI+hzl\;Rc:^NT~Ho-|/ՉJgvN YMck*}{|韝Y9Cd|/|VD5oOg쬣Y[ |T{yXZeۼy%}bQO-gUzG~H}tfRŅj.y5bZǼ~Wzd/&~Zw֯oϮuueGb"EW?b6kzook  z/y5as6DqѼEyV۸De4*5{:&=5]EyZ9/g6^ohL{{=QW粼^{yxyWyr|D{fjur^^^l^zMj,Gl9ٿa[~]g_g \Ats|~?t^kAxySՆ#D0AK0` Q, z2߽7|VyDG]dk/^=8϶!yBf: 2  ^i㳶gy.oOGgrm9ų{9l_*y[^U^]/gk\d~:ε j?GJ3gYYL;{fyEgV^8ǖ/[ (Ҳڬ|fd: Yas^mo?8fA4 CAVKΫi1d^^*yjmLuMlݙ:^}?^փUWS=?2s/ɏퟭ,m,s= ZYXgzY^ޑټ{ދy Yl3B.zq-uo*3:xꜭؘ:gk\Ewsl3zc s 77g g %D(` XAK0` Q, %D(` XAK0` Q, %D(` XAKj~~?g_XVhäE/Nwu3~?Gok׼#NgZ}?y«9h+t35 xݾ)˟a9zgV^#w?Y^gou~;}}fߔg\_Hѻ,^U*\8y^~_}ss)fr^|oʫDc|sGwxVGi欑=g>*w?r9^ۖhF:n^b[彸꼼x1GZǼ\Ƌ{k͋hE5"7zqor+m^G5/&>뜗j4{:}(z1ME{G򶦗5^mm/M^yemm[Q΋g=GUl?ebQ|lte\#Gj=d2;ҳ#eggrոE{jMwkVTQ>4j3R9f򑬗iJM%e{^>b3{<-_M:)f< [Vo$ں^N[מ^Y5/ocZ99ly5儗׼,V֚j\Dz|/|Ӳ=GXeO[k:kq/D9kjtNxqWj8mgg|~Wos|kGjl<[G1ˉOeuQ^wżs:QΩ!YZ>ilMo/633+gŴjf43x~DHoj/Zײz9oQ,E5JW3ׯl^jy[[E1F6Y}[|[DOm=ٵy̷^Ld(G^z1vhӾQۼӼ9j΍h^^Ǣg+Im\fjϲbzQYzբEy-{kgq/W7QMgV罽(۫sY^{ݫ?ۼ{Jj=3:d9//q/os6y^}#{<ʖ虞X~?|.woׯ\Atso緵sw x_QAK0` Q\kx'.w 08}-,G<[ Cz=q=[RdYt,ߋln56;nw^j<;#;wf'3st,/'rAY:;y/3wm{fz͜3V \5ע#dg[s3_$}~gDD6úz^uo|/'\GOo,Kx3κ#LxmD^e^L^uV;j{Fmf>gvYwxg+#r^Γ{jLYjGΉ#gssmZEǫz͜c:Lw rAҺWoV6?rN/>٣egѳ#?:XuO~:WGj/ѳGX%<w DACjl^xy{56okך۾3>jU_}Gn5b?wV>OlQ`ShUl:g' XAK0` Q, %DկH*ś~etJjнG4mN}XEk4X_j93vhO%VZ?^Dep 5:}i=^MvoDo{]˭QoX}u,[6'Q~ݻTkv7촘\Glޮml4U=-QM_V峭Ѣ\oOZ#dmky=Fګ jZ>gx*{^̙Mu_9c^ul=ژͷu/?z_}xM l5Y'쫺?mQ^c~u:WWD{WTj|ފ{f.b XAK08MR}FC3Q 7fl< چ!ӱ^{;fwy 2`#1|zZemY?DFIc~D#z9|8vTy%vWwln7zuc֋x}]{Ky1/58zUz1{8ⶃQGﲊ'W(6f0evʝfE@3^]o VhM_+QOԯ[z4ޮFm7=@fv z3:Q0AK0` Q, %D(` XAK0` Q, %D(` XAK0` Q, %D(.'7;y?~502 F_;:8fygrAY~#ηgqKU=ޞ_?!lEqvsApW{ٹ3{<ўϤ{gelfwTܵ5s֙fY,Tl5k$EG^yg&gIx3κÌ^,Tm5mqc:/TG^NdJh_Yegug9n=6#?tZ+zv&̜}l쌳0W> U[ 퇧G.['՘^Y_ՎG63xZW:@Vf}Z/'t٘^YߦH]Tߋ{ڞhO9푭30W> UD!{UfuQދo#3^Y=ZG_9 zp6dy/VmmUQmKl~6V{5ggϺVmؼzjlD9Y5E56?B}5Njg}:֓J?EVU] Tj~6<ջ1v Іou %D(Nÿ#D_3:/2 / y4m9zMٸt\FrUQ/ۜg5^nyiQۜ^{h>[{^Q󵖏fkvhO%VZzTy{go `m7zCN/}i=^MvoT_vVxn5zkOƚcY޲9Y߅W=v/gc^D( >-E/s5k{u=+1<[^g[EޞHeOFj{=׿w=l5F=^>칢{gJ}EkQ^~$VWʞ$_ :]Sٟx{zhG^6h\\N4zmtFqONxNyv `m3z{ڑ0pxV(0` Q, 25;8M!qVC3Q 7fl< چ!ӱ^{;fwy 2`#1|zZemY?DFIc~D#z9|8vTy%vWwln7zuc֋x}]{Ky1/58zUz1{8ⶃQGﲊ'W(6f0evʝfE@3^]o VhM_+QOԯ[z4ޮFm7=@fv z3:Q0AK0` Q, %D(` XAK0` Q, %D(` XAK0` Q, %D( '7,W[~^ßϾ_>ƭ&I^l2gX~?xy5G{ŝδ~~WsѾW,; 8eiw^ ~?:sgߧg#3{^gom3D7~}>^wD*gzzWGǙzTs3ਧD7b1yUߙZzyF,^GNW߹rmdBm5}YLzk^/&^똗xqoy1ӱFDF6^N^{{^ZbQń'zy^&yVǼϲ6Z/ɾhHrƋ7v弼WIޫ1ﳬmG֋Ij3;jm7YZf>{,ﭵ~-yK.ŢZTcϪz53{<Ƌ \jHmշy̷^LdJ_/#-]|[DOQ~$lޫvhӾلۼӼ9j΍h^^Ǣg+Im\fjϲbzQYzբEy-{kgq/W7QMgV罽(۫sY^{ݫ?ۼ{Jj=3:d9//q/os6y^=̶D߼ço{w׏?}~}z }ߏ=5Wx#v?|x?n?`O XAK0` Q, %D(` XDb8(E:` *][  >{Ch a TІAzh (eh(1` Q, %D|uQ* XAK0` Q, %D(xD<7˵oo>o3ggO{?xѴٳ˿g// ˿|:shoDv zCcxޠ;94Q }%^v= p!ox{5oЛ%Ysh  D=VDox=nA#І~g_ ?_~Wvs_~Wrym䗗;{mh7SDWϿrWbթ2wy`3;Ws 7La^ 7oHѓ0żۙoόJJ7!D\oC!?_~uL`_AT/+v}s~o{G,=da޿VroDه?o ۫y,UCD6%nc (߰uAU60 j(z}/Cjjw0m,==>? ?!(7o۝ MlD53𷦭L|ei |>#۝sEhY{gss>?b zC;4ZD51~=@_DÿndWg8~cS~9`ޠ;9SF~ [O`PC ao۝ک}f^WWAέY0~ U_ AowshS(Q!!m02{Lg{VaJ/ xo}Ϗ5i^g ڽϗ=9v= އQؿ,u׏#m2gQ}/ȟſgc[֏C :n#}=`=ݞN}QuDA6D `G XAK0` Q, %D(LK-Dp_~CD0AK0` Q, %DD6~wn\c چP(EBaAüAvm1`XobAâAzqQ Q  %D(`o~i %n5~ɍ?gVWoׯqAa[m̺V5k^G^q3_qw:wxAr}s??l݅?sϬF~z陹HLיw>>g\AtoG3uOr|תwy}z<^GL>W9?{nO9o7U;~s^}'s竞;r3]ooxs$o\ӹ,\|/Ggy*GXeq1/;޺}kDbY-;K>G=[m,ګUk*^#Z_TΏeTg/٘W#Y66dOWj*1-s4ŏ򑬗iJoױL1[:vt?0AZ儭kWr{m]/'zqkOFz⚗1YQ{^o]yƼrk^MikMtM5cYZRSiٞJޣuh55ոe^LkJoz5:kd=Gn;67WWz6'kGٸvƳu!*ZV%n^̫:׫Y"{1峚Tb3[??;rg^LkjF=ޞYGD;_>{,ﭵ~-yK.ŢZTcϪz53{<Ƌ \jHmշy̷^LdJ_/#-]|[DOQ~$lޫzެo8bA?^Njdlޫ:7Ryyן('qq>:i6E%gUjuLzjV:(s6=^ӟm^ǽ\%D5ўZz\oey:vl:*&꼷ד弼Ľټ{Xyr=ӳ ߷ǟϾ_>x [~m3yރD G0`(` XbAe˿{o50>1^Lzpm#C+  K?ޅuDe82@qgm4\ޞϜ = r"gyrv\UoU򶦗佺^xoOɺ.tkA~b+ggβz=GVw:΋άƽ:p-QM_:duQ>;ۗeYu;5~pVh6TWb[jU]ژ(ٺ3euޫ~QY]//9z~d^:61?[[Y XzAJO+l^g#3Y?yQz5fm?\΋Z:/Tgzu.뵗 9[1#txJjf.::xy@AooFAK0` Q, %D(` XAK0` Q, %D(` XAK0` Q, %D( '7,W[~^ßϾ_>ƭ&I^l2gX~?xy5G{ŝδ~~WsѾW,gmgkzAr}S>?$݅?sϬF~z陹HLיw>>g;lGp;)qϸ>ʹw;Y^Uqx2\}w{SߔW߉gzzW=Y#{|#UUv\;s-"t\ۗŤ{qoyyb>뵎yj֚>jDo^aZ$Wx9:>u/%k^L}9/hju,k[oQ>bmM/kxc^{5Z>xjĭ&^Ƌx8v͠/cGTWc^^lc=Q[g5Q,{tQ̋Wʙz-VYϑes{,OxcsY3X-c~:Ⱦj,rfZL[ g~SXv~gG_ΒQqj՚JH֫~9}ًi6gr#Y//6JLg|$fxZRś(u,;Sū=#DM^Nz{5/'1rjtJW/yyʹGgl̫-'dʞtNT:{1+5=^׎*{Z9]SXŴx&I_WsƋkZTSGn;67WWz6'kGٸvƳu!*ZV%n^̫:׫Y"{1峚Tb3[??;rg^LkjF=ޞ9#gaAo7HًeyoUkYۜ_r(Ԣ{Vwԫ׌Gi6/5^\輭梘W#FjuweGb"UzgzoyZǼ^Wzd/&~Zzx#y/f^ߋuT iAo蛠 ^ټWunF:%?[QN6o:7S}ul\׋JΪ46tu,kQ\l[{ݧ?ۼ{Jj=3:D^zu^uUMT황yo'yy{yy٣m^:L[gzo"!зǟϾ_>p=¾Ǟ֚+<~}zD'Q, %Dq)w⽟(ϻ (.ln5>|:nJۓg|/ CMx=|ܙ=hg<fwTܵ5s*tW"[ 2@XrY/H^⏐n|MκeguGxj={9u^r=Ѿ^ٳ,8л3=zmF~({:{1-WzYL<=9ǣ؞gDDW\5z9OV1-gZ9')Fmf>鵕wLw zm ]#u6EWַi5R'5se{dk;<3-3H^վY]#9 Wf9GrO2DXb=Qzk\5ftGocWh;3j=Z -y>/ؼr^kjl~ojvxt'~R׏V9 m(Z<ճDςAO W=ޞ=ꜣ0` Q, %D(f:ӫ^UG` 2`asϽXղzi,f3Y;yQe^n7j^MFkn>'g`D+豃v1r{z cDvܻD"a"EQ^dw<v(^(` XAK0` Q, %D(` XAK0` Q, %D(` XAK0` Q, K}ɍ2NfOw x6 ׎~9j}«m-tuz'Ϣ{g{>kQjmv!&ywFvOg3YY,/z9vrAY8;y/3wm{fz͜u;GV? [ 퇧G.kQWޭYw>^쌳0W> U[ gaX|/g΋7QYң'7{%}~gag|N[]VDz|/EJ:G=63xt3;;8@VhzFV/|5EWWk#D39G9>{P zm ]#u6EWַi5R'5se{dk;:@-3^վY]#9 Wf9W~n7! YދUDqg[sxT1={U^Ylٳ#g zpoe56/5Q~kMrQ͏m_odOlѹU}W?UD =;?On ]0)sGs<1` Q, 2.8M+9#(c6HfmCXOVzUݿ{yt`6h7HL*{wϞuMzA4̐4r֮} ;l Wf{ԻlYuAcƟ}^NRh=V?{6ߣ<Dg+o(6f0*#gݷrg|?@AT9kW>={jmڀ|%>J9kꝽ:ܚWoDq 3~OT;bpxV( %D(` XAK0` Q, %D(` XAK0` Q, %D(` XAKj~~?g_XVhäE/Nwu3~?Gok׼#NgZ}?y«9h+t2hv~ش /WY{gzٿ9z3sב=^37G|}ζ }c?>Wqe_;|}"sGvxVȣsz=}e*YpSW߉gzzW=Y#{|#UUv\{fm9o26޾,&^ދ{kKxYuUkּXT#x Z/'y/=^uY{qo-^bByyFWcgYzQd_w$okz9]r^ޫ$Yֶƣ|T$ne5Y^r,<Q5:v4/hOe5ƽ:VŽuVŢOǼ|ożxΪlE9/[6W?Dzt.76;3ߋEY޲J=sY\Ϋ"#DίkY9\5nc^ZSz5r~/;O>{1ƼTβ|$fxZRSiٞ,~dOWjx弸eg1X[k5zmj^NbzD/5z螕Q^\6&z9+s-6٘W#ZNxyͫb=m霮u,bZWj*1-S{tUsױ,ߋi-_MVFt*5 ~^LܯRmNwֳqHg(&z9Q9CTi#.KnW#tW'*93D?bZg5f=~vf YMՌ{=Ysm56,F|3V{yXZeۼy%}bQO-gUzG~H}tfRŅj.y5bZǼ~Wzd/&~Zw֯oϮuueGb"EW?b6nAilBmi^z؜{5Q\Fj4/cQ^$n6s35gYG1uJMc^IOMjQ^Ǣu潵}븗䛨&3S^Oչ,^^=^՟m^ǽ\%D5ўZz9׼|xf[gzo^ӷǟϾ_>p=¾Ǟ֚+<~}zD'Q, %D(` XAK0` Q, %D(` XAK0` Q, %D(` XAK0` Q, %D7~w_zqQ Q;tz1 aATOD0D=|ІAâA (&BQ  Q c XAKl33RUD(` XAK0` Q,6x~vIENDB`dos2unix-7.3.4/test/symlink.t0000755000175500010010000000517612721132543015415 0ustar waterlanGeen#!/usr/bin/perl # Requires perl-Test-Simple installation. use Test::Simple tests => 14; $suffix = ""; if (-e "../dos2unix.exe") { $suffix = ".exe"; } $DOS2UNIX = "../dos2unix" . $suffix; $MAC2UNIX = "../mac2unix" . $suffix; $UNIX2DOS = "../unix2dos" . $suffix; $UNIX2MAC = "../unix2mac" . $suffix; # dos2unix skip symlink system("cp -f dos.txt out_link.txt"); system("rm -f in_link.txt; ln -s out_link.txt in_link.txt"); system("$DOS2UNIX -v in_link.txt; cmp out_link.txt dos.txt"); ok( $? == 0, 'dos2unix, skip symlink, check symlink target.' ); if (-l "in_link.txt") { $symlink = "1"; } else { $symlink = "0"; } ok( $symlink == 1, 'dos2unix, skip symlink, check symlink.' ); # dos2unix replace symlink system("$DOS2UNIX -v -R in_link.txt; cmp out_link.txt dos.txt"); ok( $? == 0, 'dos2unix, replace symlink, check symlink target.' ); if (-l "in_link.txt") { $symlink = "1"; } else { $symlink = "0"; } ok( $symlink == 0, 'dos2unix, replace symlink, check symlink.' ); system("cmp in_link.txt unix.txt"); ok( $? == 0, 'dos2unix, replace symlink, check conversion.' ); # dos2unix follow symlink system("cp -f dos.txt out_link.txt"); system("rm -f in_link.txt; ln -s out_link.txt in_link.txt"); system("$DOS2UNIX -v -F in_link.txt; cmp out_link.txt unix.txt"); ok( $? == 0, 'dos2unix, follow symlink, check symlink target.' ); if (-l "in_link.txt") { $symlink = "1"; } else { $symlink = "0"; } ok( $symlink == 1, 'dos2unix, follow symlink, check symlink.' ); # unix2dos skip symlink system("cp -f unix.txt out_link.txt"); system("rm -f in_link.txt; ln -s out_link.txt in_link.txt"); system("$UNIX2DOS -v in_link.txt; cmp out_link.txt unix.txt"); ok( $? == 0, 'unix2dos, skip symlink, check symlink target.' ); if (-l "in_link.txt") { $symlink = "1"; } else { $symlink = "0"; } ok( $symlink == 1, 'unix2dos, skip symlink, check symlink.' ); # unix2dos replace symlink system("$UNIX2DOS -v -R in_link.txt; cmp out_link.txt unix.txt"); ok( $? == 0, 'unix2dos, replace symlink, check symlink target.' ); if (-l "in_link.txt") { $symlink = "1"; } else { $symlink = "0"; } ok( $symlink == 0, 'unix2dos, replace symlink, check symlink.' ); system("cmp in_link.txt dos.txt"); ok( $? == 0, 'unix2dos, replace symlink, check conversion.' ); # unix2dos follow symlink system("cp -f unix.txt out_link.txt"); system("rm -f in_link.txt; ln -s out_link.txt in_link.txt"); system("$UNIX2DOS -v -F in_link.txt; cmp out_link.txt dos.txt"); ok( $? == 0, 'unix2dos, follow symlink, check symlink target.' ); if (-l "in_link.txt") { $symlink = "1"; } else { $symlink = "0"; } ok( $symlink == 1, 'unix2dos, follow symlink, check symlink.' ); dos2unix-7.3.4/test/testcmd.bat0000755000175500010010000000076112721132543015670 0ustar waterlanGeen@echo off REM This script demonstrates how to use Unicode file names REM in a batch script. REM This script is in UTF-8 encoding. REM This script must NOT have a BOM (Byte Order Mark). Notepad will REM add one when you save the file. Remove it with unix2dos -r test.bat REM This script will only run on Windows 7 and higher. REM switch to UTF-8 code page chcp 65001 dos2unix -D unicode -i uni_el_αρχείο.txt uni_zh_文件.txt REM set code page back to original value chcp 850 dos2unix-7.3.4/test/testps16.ps10000755000175500010010000000151012721132543015644 0ustar waterlanGeen# This script demonstrates how to use Unicode file names # in a PowerShell script. # This script is in UTF-16 encoding. $env:DOS2UNIX_DISPLAY_ENC = "unicode" dos2unix -i uni_el_.txt uni_zh_eN.txt echo "test select-string:" # select-string requires a BOM. $env:DOS2UNIX_DISPLAY_ENC = "unicodebom" dos2unix -i uni* | select-string -encoding unicode -pattern  $env:DOS2UNIX_DISPLAY_ENC = "" dos2unix-7.3.4/test/testps8.ps10000755000175500010010000000066112721132543015573 0ustar waterlanGeen# This script demonstrates how to use Unicode file names # in a PowerShell script. # This script is in UTF-8 encoding, with BOM. $env:DOS2UNIX_DISPLAY_ENC = "utf8" dos2unix -i uni_el_αρχείο.txt uni_zh_文件.txt echo "test select-string:" # select-string requires a BOM. $env:DOS2UNIX_DISPLAY_ENC = "utf8bom" dos2unix -i uni* | select-string -encoding utf8 -pattern αρχ $env:DOS2UNIX_DISPLAY_ENC = "" dos2unix-7.3.4/test/testu16.c0000644000175500010010000000130312721132543015202 0ustar waterlanGeen#include #include #include #include /* This program demonstrates Unicode UTF-16 printed text redirected to a correct UTF-16 file. .\testu16.exe > out.txt */ int main () { int prevmode; prevmode = _setmode(_fileno(stdout), _O_U16TEXT); /* We need to print an UTF-16 BOM for correct redirection in PowerShell. */ fwprintf(stdout, L"\xfeff"); fwprintf(stdout,L"one\n"); fwprintf(stdout,L"two\n"); fwprintf(stdout,L"three\n"); /* Flushing stdout is required to get correct UTF-16. This is required for both CMD.exe and PowerShell. */ fflush(stdout); _setmode(_fileno(stdout), prevmode); return 0; } dos2unix-7.3.4/test/unix.txt0000644000175500010010000000003212721132543015245 0ustar waterlanGeenhello world take a break dos2unix-7.3.4/test/unix_bin.txt0000644000175500010010000000021012721132543016073 0ustar waterlanGeen $ $  !"#$%&'()*+,-./ 0123456789:;<=>? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ dos2unix-7.3.4/test/unix_bom.txt0000644000175500010010000000003512721132543016105 0ustar waterlanGeenhello world take a break dos2unix-7.3.4/test/unix_dbl.txt0000644000175500010010000000004012721132543016065 0ustar waterlanGeenhello world take a break dos2unix-7.3.4/test/unix_gb.txt0000644000175500010010000000003612721132543015721 0ustar waterlanGeen13hello world take a break dos2unix-7.3.4/test/uni_el_αρχείο.txt0000644000175500010010000000002012721132543022153 0ustar waterlanGeentake a break dos2unix-7.3.4/test/uni_nl_ëäï.txt0000644000175500010010000000002012721132543020011 0ustar waterlanGeentake a break dos2unix-7.3.4/test/uni_zh_文件.txt0000644000175500010010000000002012721132543020042 0ustar waterlanGeentake a break dos2unix-7.3.4/test/utf16.t0000755000175500010010000001243612721132543014671 0ustar waterlanGeen#!/usr/bin/perl # Requires perl-Test-Simple installation. use Test::Simple tests => 34; $suffix = ""; if (-e "../dos2unix.exe") { $suffix = ".exe"; } $system = `uname -s`; if ($system =~ m/MINGW/) { $unix=0; } else { $unix=1; } $DOS2UNIX = "../dos2unix" . $suffix; $MAC2UNIX = "../mac2unix" . $suffix; $UNIX2DOS = "../unix2dos" . $suffix; $UNIX2MAC = "../unix2mac" . $suffix; $ENV{'LC_ALL'} = 'en_US.UTF-8'; system("$DOS2UNIX -v -n utf16le.txt out_unix.txt; cmp out_unix.txt utf8unix.txt"); ok( $? == 0, 'DOS UTF-16LE to Unix UTF-8' ); system("$DOS2UNIX -v -n utf16be.txt out_unix.txt; cmp out_unix.txt utf8unix.txt"); ok( $? == 0, 'DOS UTF-16BE to Unix UTF-8' ); system("$UNIX2DOS -v -n utf16le.txt out_dos.txt; cmp out_dos.txt utf8dos.txt"); ok( $? == 0, 'DOS UTF-16LE to DOS UTF-8' ); system("$UNIX2DOS -v -n utf16be.txt out_dos.txt; cmp out_dos.txt utf8dos.txt"); ok( $? == 0, 'DOS UTF-16BE to DOS UTF-8' ); system("$DOS2UNIX -v -ul -n utf16len.txt out_unix.txt; cmp out_unix.txt utf8unix.txt"); ok( $? == 0, 'UTF-16LE without BOM to UTF-8' ); system("$DOS2UNIX -v -ub -n utf16ben.txt out_unix.txt; cmp out_unix.txt utf8unix.txt"); ok( $? == 0, 'UTF-16BE without BOM to UTF-8' ); system("$DOS2UNIX -v -ul -n utf16be.txt out_unix.txt; cmp out_unix.txt utf8unix.txt"); ok( $? == 0, 'BOM overrides -ul' ); system("$DOS2UNIX -v -ub -n utf16le.txt out_unix.txt; cmp out_unix.txt utf8unix.txt"); ok( $? == 0, 'BOM overrides -ub' ); system("$DOS2UNIX -v -b -n utf16le.txt out_unix.txt; cmp out_unix.txt utf8unxb.txt"); ok( $? == 0, 'DOS UTF-16LE to Unix UTF-8, keep BOM' ); system("$UNIX2DOS -v -r -n utf16le.txt out_dos.txt; cmp out_dos.txt utf8dosn.txt"); ok( $? == 0, 'DOS UTF-16LE to DOS UTF-8, remove BOM' ); system("$MAC2UNIX -v -n utf16le.txt out_unix.txt; cmp out_unix.txt utf8dosn.txt"); ok( $? == 0, 'mac2unix does not change utf16 DOS line breaks.' ); system("$UNIX2MAC -v -n utf16le.txt out_mac.txt; cmp out_mac.txt utf8dos.txt"); ok( $? == 0, 'unix2mac does not change utf16 DOS line breaks.' ); system("$UNIX2DOS -v -u -n utf16le.txt out_dos.txt; cmp out_dos.txt utf16le.txt"); ok( $? == 0, 'DOS UTF-16LE to DOS UTF-16' ); system("$UNIX2DOS -v -u -n utf16be.txt out_dos.txt; cmp out_dos.txt utf16be.txt"); ok( $? == 0, 'DOS UTF-16BE to DOS UTF-16' ); system("$DOS2UNIX -v -b -u -n utf16.txt out_unix.txt; cmp out_unix.txt utf16u.txt"); ok( $? == 0, 'DOS UTF-16LE to Unix UTF-16' ); system("$MAC2UNIX -v -b -u -n utf16m.txt out_unix.txt; cmp out_unix.txt utf16u.txt"); ok( $? == 0, 'Mac UTF-16LE to Unix UTF-16' ); system("$UNIX2DOS -v -b -u -n utf16u.txt out_dos.txt; cmp out_dos.txt utf16.txt"); ok( $? == 0, 'Unix UTF-16 to DOS UTF-16LE' ); system("$UNIX2MAC -v -b -u -n utf16u.txt out_mac.txt; cmp out_mac.txt utf16m.txt"); ok( $? == 0, 'Unix UTF-16 to Mac UTF-16LE' ); system("$DOS2UNIX -v -f -n utf16bin.txt out_unix.txt; cmp out_unix.txt unix_bin.txt"); ok( $? == 0, 'Dos2unix, force UTF-16 file with binary symbols' ); system("$UNIX2DOS -v -f -r -n utf16bin.txt out_dos.txt; cmp out_dos.txt dos_bin.txt"); ok( $? == 0, 'Unix2dos, force UTF-16 file with binary symbols' ); system("$DOS2UNIX -v -n invalhig.txt out_unix.txt"); $result = ($? >> 8); ok( $result == 1, 'Dos2unix, invalid surrogate pair, missing low surrogate' ); system("$DOS2UNIX -v -n invallow.txt out_unix.txt"); $result = ($? >> 8); ok( $result == 1, 'Dos2unix, invalid surrogate pair, missing high surrogate' ); system("cat utf16le.txt | $DOS2UNIX -v > out_unix.txt; cmp out_unix.txt utf8unix.txt"); ok( $? == 0, 'UTF-16LE with BOM to UTF-8, stdin/out' ); system("cat utf16u.txt | $UNIX2DOS -v -u > out_dos.txt; cmp out_dos.txt utf16.txt"); ok( $? == 0, 'UTF-16LE with BOM to UTF-16LE, stdin/out' ); system("$UNIX2DOS -v -u -m -n unix.txt out_dos.txt; cmp out_dos.txt dos_bom.txt"); ok( $? == 0, 'Option -u must not disable -m on ASCII input'); system("$DOS2UNIX -ul -i utf16le.txt utf16len.txt utf8unxb.txt gb18030.txt > outinfo.txt"); system("$DOS2UNIX outinfo.txt; diff info_ul.txt outinfo.txt"); ok( $? == 0, 'Option -i, --info combined with -ul'); system("$DOS2UNIX -ub -i utf16be.txt utf16ben.txt utf8unxb.txt gb18030.txt > outinfo.txt"); system("$DOS2UNIX outinfo.txt; diff info_ub.txt outinfo.txt"); ok( $? == 0, 'Option -i, --info combined with -ub'); system("$DOS2UNIX -v -7 -n utf16le.txt out_unix.txt chardos.txt out_u7.txt; cmp out_unix.txt utf8unix.txt"); ok( $? == 0, '7bit disabled for utf16'); system("cmp out_u7.txt charu7.txt"); ok( $? == 0, '7bit enabled again, dos2unix'); system("$UNIX2DOS -v -7 -n utf8unxb.txt out_dos.txt charunix.txt out_d7.txt; cmp out_dos.txt utf8dos.txt"); ok( $? == 0, '7bit disabled for utf8 with BOM'); system("cmp out_d7.txt chard7.txt"); ok( $? == 0, '7bit enabled again, unix2dos'); system("$DOS2UNIX -i dos.txt unix.txt mac.txt mixed.txt utf16le.txt utf16be.txt utf16len.txt utf8unix.txt utf8dos.txt gb18030.txt > outinfo.txt"); system("$DOS2UNIX outinfo.txt; diff info_ucs.txt outinfo.txt"); ok( $? == 0, 'Option -i, --info'); $ENV{'LC_ALL'} = 'C'; system("$DOS2UNIX -v -n utf16le.txt out_unix.txt"); $result = ($? >> 8); if ( $unix ) { $expected = 1; } else { $expected = 0 }; print "UNIX" . $unix . "\n"; print "EXP" . $expected . "\n"; ok( $result == $expected, 'DOS UTF-16LE to Unix in C locale, conversion error.' ); system("$DOS2UNIX -v -n utf16.txt out_unix.txt"); ok( $? == 0, 'DOS UTF-16LE to Unix in C locale, conversion OK' ); dos2unix-7.3.4/test/utf16.txt0000644000175500010010000000010212721132543015225 0ustar waterlanGeenhello world take a break dos2unix-7.3.4/test/utf16be.txt0000644000175500010010000000360612721132543015550 0ustar waterlanGeen(\(X! YeW0R)QqTV(\(X!]v^ 2007^tNS~15N f/~~N_~0h? @ABCDEFGHIJKLMNO PQRSTUVWXYZ[\]^_ `abcdefghijklmno pqrstuvwxyz{|}~ dos2unix-7.3.4/test/utf16le.txt0000644000175500010010000000360612721132543015562 0ustar waterlanGeen(\(!X eY0W)RqQTV(\(!X]v^ 2007t^NS~15N /f~~_N~0 6; $suffix = ""; if (-e "../dos2unix.exe") { $suffix = ".exe"; } $DOS2UNIX = "../dos2unix" . $suffix; $MAC2UNIX = "../mac2unix" . $suffix; $UNIX2DOS = "../unix2dos" . $suffix; $UNIX2MAC = "../unix2mac" . $suffix; $ENV{'LC_ALL'} = 'en_US.UTF-8'; system("$DOS2UNIX -v -n dos_bom.txt out_unix.txt; cmp out_unix.txt unix.txt"); ok( $? == 0, 'dos2unix removes BOM' ); system("$DOS2UNIX -v -b -n dos_bom.txt out_unix.txt; cmp out_unix.txt unix_bom.txt"); ok( $? == 0, 'dos2unix -b keeps BOM' ); system("$DOS2UNIX -v -m -n dos.txt out_unix.txt; cmp out_unix.txt unix_bom.txt"); ok( $? == 0, 'dos2unix -m adds BOM' ); system("$UNIX2DOS -v -n unix_bom.txt out_dos.txt; cmp out_dos.txt dos_bom.txt"); ok( $? == 0, 'unix2dos keeps BOM' ); system("$UNIX2DOS -v -r -n unix_bom.txt out_dos.txt; cmp out_dos.txt dos.txt"); ok( $? == 0, 'unix2dos -r removes BOM' ); system("$UNIX2DOS -v -m -n unix.txt out_dos.txt; cmp out_dos.txt dos_bom.txt"); ok( $? == 0, 'unix2dos -m adds BOM' ); dos2unix-7.3.4/test/utf8dos.txt0000644000175500010010000000311712721132543015665 0ustar waterlanGeen萨尔茨堡,奥地利共和国萨尔茨堡州的首府,2007年人口约15万,是继维也纳、格拉茨和林茨之后的奥地利第四大城市。萨尔茨堡位于奥地利的西部,是阿尔卑斯山脉的门庭,城市的建筑风格以巴洛克为主,城市的历史相当悠久,据史料记载,萨尔茨堡是现今奥地利管辖地域内历史最悠久的城市。萨尔茨堡是音乐天才莫扎特的出生地,莫扎特不到36年的短暂生命中超过一半的岁月是在萨尔茨堡度过的。萨尔茨堡也是指挥家赫伯特·冯·卡拉扬的故乡,电影《音乐之声》的拍摄地。萨尔茨堡老城在1996年被联合国教科文组织列入世界遗产名录。 𝌆 Unicode Scalar Value UTF-8 NCR U+2070E 𠜎 𠜎 U+20731 𠜱 𠜱 U+20779 𠝹 𠝹 U+20C53 𠱓 𠱓 U+20C78 𠱸 𠱸 U+20C96 𠲖 𠲖 U+20CCF 𠳏 𠳏 U+20CD5 𠳕 𠳕 U+20D15 𠴕 𠴕 U+20D7C 𠵼 𠵼 U+20D7F 𠵿 𠵿 U+20E0E 𠸎 𠸎 U+20E0F 𠸏 𠸏 U+20E77 𠹷 𠹷 U+20E9D 𠺝 𠺝 U+20EA2 𠺢 𠺢 U+20ED7 𠻗 𠻗 U+20EF9 𠻹 𠻹 U+20EFA 𠻺 𠻺 U+20F2D 𠼭 𠼭 U+20F2E 𠼮 𠼮 U+20F4C 𠽌 𠽌 U+20FB4 𠾴 𠾴 U+20FBC 𠾼 𠾼 U+20FEA 𠿪 𠿪 U+2105C 𡁜 𡁜 U+2106F 𡁯 𡁯 U+21075 𡁵 𡁵 U+21076 𡁶 𡁶 U+2107B 𡁻 𡁻 U+210C1 𡃁 𡃁 U+210C9 𡃉 𡃉 U+211D9 𡇙 𡇙 U+220C7 𢃇 𢃇 U+227B5 𢞵 𢞵 U+22AD5 𢫕 𢫕 U+22B43 𢭃 𢭃 U+22BCA 𢯊 𢯊 U+22C51 𢱑 𢱑 U+22C55 𢱕 𢱕 U+22CC2 𢳂 𢳂 U+22D08 𢴈 𢴈 U+22D4C 𢵌 𢵌 U+22D67 𢵧 𢵧 U+22EB3 𢺳 𢺳dos2unix-7.3.4/test/utf8dosn.txt0000644000175500010010000000311412721132543016040 0ustar waterlanGeen萨尔茨堡,奥地利共和国萨尔茨堡州的首府,2007年人口约15万,是继维也纳、格拉茨和林茨之后的奥地利第四大城市。萨尔茨堡位于奥地利的西部,是阿尔卑斯山脉的门庭,城市的建筑风格以巴洛克为主,城市的历史相当悠久,据史料记载,萨尔茨堡是现今奥地利管辖地域内历史最悠久的城市。萨尔茨堡是音乐天才莫扎特的出生地,莫扎特不到36年的短暂生命中超过一半的岁月是在萨尔茨堡度过的。萨尔茨堡也是指挥家赫伯特·冯·卡拉扬的故乡,电影《音乐之声》的拍摄地。萨尔茨堡老城在1996年被联合国教科文组织列入世界遗产名录。 𝌆 Unicode Scalar Value UTF-8 NCR U+2070E 𠜎 𠜎 U+20731 𠜱 𠜱 U+20779 𠝹 𠝹 U+20C53 𠱓 𠱓 U+20C78 𠱸 𠱸 U+20C96 𠲖 𠲖 U+20CCF 𠳏 𠳏 U+20CD5 𠳕 𠳕 U+20D15 𠴕 𠴕 U+20D7C 𠵼 𠵼 U+20D7F 𠵿 𠵿 U+20E0E 𠸎 𠸎 U+20E0F 𠸏 𠸏 U+20E77 𠹷 𠹷 U+20E9D 𠺝 𠺝 U+20EA2 𠺢 𠺢 U+20ED7 𠻗 𠻗 U+20EF9 𠻹 𠻹 U+20EFA 𠻺 𠻺 U+20F2D 𠼭 𠼭 U+20F2E 𠼮 𠼮 U+20F4C 𠽌 𠽌 U+20FB4 𠾴 𠾴 U+20FBC 𠾼 𠾼 U+20FEA 𠿪 𠿪 U+2105C 𡁜 𡁜 U+2106F 𡁯 𡁯 U+21075 𡁵 𡁵 U+21076 𡁶 𡁶 U+2107B 𡁻 𡁻 U+210C1 𡃁 𡃁 U+210C9 𡃉 𡃉 U+211D9 𡇙 𡇙 U+220C7 𢃇 𢃇 U+227B5 𢞵 𢞵 U+22AD5 𢫕 𢫕 U+22B43 𢭃 𢭃 U+22BCA 𢯊 𢯊 U+22C51 𢱑 𢱑 U+22C55 𢱕 𢱕 U+22CC2 𢳂 𢳂 U+22D08 𢴈 𢴈 U+22D4C 𢵌 𢵌 U+22D67 𢵧 𢵧 U+22EB3 𢺳 𢺳dos2unix-7.3.4/test/utf8unix.txt0000644000175500010010000000303212721132543016057 0ustar waterlanGeen萨尔茨堡,奥地利共和国萨尔茨堡州的首府,2007年人口约15万,是继维也纳、格拉茨和林茨之后的奥地利第四大城市。萨尔茨堡位于奥地利的西部,是阿尔卑斯山脉的门庭,城市的建筑风格以巴洛克为主,城市的历史相当悠久,据史料记载,萨尔茨堡是现今奥地利管辖地域内历史最悠久的城市。萨尔茨堡是音乐天才莫扎特的出生地,莫扎特不到36年的短暂生命中超过一半的岁月是在萨尔茨堡度过的。萨尔茨堡也是指挥家赫伯特·冯·卡拉扬的故乡,电影《音乐之声》的拍摄地。萨尔茨堡老城在1996年被联合国教科文组织列入世界遗产名录。 𝌆 Unicode Scalar Value UTF-8 NCR U+2070E 𠜎 𠜎 U+20731 𠜱 𠜱 U+20779 𠝹 𠝹 U+20C53 𠱓 𠱓 U+20C78 𠱸 𠱸 U+20C96 𠲖 𠲖 U+20CCF 𠳏 𠳏 U+20CD5 𠳕 𠳕 U+20D15 𠴕 𠴕 U+20D7C 𠵼 𠵼 U+20D7F 𠵿 𠵿 U+20E0E 𠸎 𠸎 U+20E0F 𠸏 𠸏 U+20E77 𠹷 𠹷 U+20E9D 𠺝 𠺝 U+20EA2 𠺢 𠺢 U+20ED7 𠻗 𠻗 U+20EF9 𠻹 𠻹 U+20EFA 𠻺 𠻺 U+20F2D 𠼭 𠼭 U+20F2E 𠼮 𠼮 U+20F4C 𠽌 𠽌 U+20FB4 𠾴 𠾴 U+20FBC 𠾼 𠾼 U+20FEA 𠿪 𠿪 U+2105C 𡁜 𡁜 U+2106F 𡁯 𡁯 U+21075 𡁵 𡁵 U+21076 𡁶 𡁶 U+2107B 𡁻 𡁻 U+210C1 𡃁 𡃁 U+210C9 𡃉 𡃉 U+211D9 𡇙 𡇙 U+220C7 𢃇 𢃇 U+227B5 𢞵 𢞵 U+22AD5 𢫕 𢫕 U+22B43 𢭃 𢭃 U+22BCA 𢯊 𢯊 U+22C51 𢱑 𢱑 U+22C55 𢱕 𢱕 U+22CC2 𢳂 𢳂 U+22D08 𢴈 𢴈 U+22D4C 𢵌 𢵌 U+22D67 𢵧 𢵧 U+22EB3 𢺳 𢺳dos2unix-7.3.4/test/utf8unxb.txt0000644000175500010010000000303512721132543016053 0ustar waterlanGeen萨尔茨堡,奥地利共和国萨尔茨堡州的首府,2007年人口约15万,是继维也纳、格拉茨和林茨之后的奥地利第四大城市。萨尔茨堡位于奥地利的西部,是阿尔卑斯山脉的门庭,城市的建筑风格以巴洛克为主,城市的历史相当悠久,据史料记载,萨尔茨堡是现今奥地利管辖地域内历史最悠久的城市。萨尔茨堡是音乐天才莫扎特的出生地,莫扎特不到36年的短暂生命中超过一半的岁月是在萨尔茨堡度过的。萨尔茨堡也是指挥家赫伯特·冯·卡拉扬的故乡,电影《音乐之声》的拍摄地。萨尔茨堡老城在1996年被联合国教科文组织列入世界遗产名录。 𝌆 Unicode Scalar Value UTF-8 NCR U+2070E 𠜎 𠜎 U+20731 𠜱 𠜱 U+20779 𠝹 𠝹 U+20C53 𠱓 𠱓 U+20C78 𠱸 𠱸 U+20C96 𠲖 𠲖 U+20CCF 𠳏 𠳏 U+20CD5 𠳕 𠳕 U+20D15 𠴕 𠴕 U+20D7C 𠵼 𠵼 U+20D7F 𠵿 𠵿 U+20E0E 𠸎 𠸎 U+20E0F 𠸏 𠸏 U+20E77 𠹷 𠹷 U+20E9D 𠺝 𠺝 U+20EA2 𠺢 𠺢 U+20ED7 𠻗 𠻗 U+20EF9 𠻹 𠻹 U+20EFA 𠻺 𠻺 U+20F2D 𠼭 𠼭 U+20F2E 𠼮 𠼮 U+20F4C 𠽌 𠽌 U+20FB4 𠾴 𠾴 U+20FBC 𠾼 𠾼 U+20FEA 𠿪 𠿪 U+2105C 𡁜 𡁜 U+2106F 𡁯 𡁯 U+21075 𡁵 𡁵 U+21076 𡁶 𡁶 U+2107B 𡁻 𡁻 U+210C1 𡃁 𡃁 U+210C9 𡃉 𡃉 U+211D9 𡇙 𡇙 U+220C7 𢃇 𢃇 U+227B5 𢞵 𢞵 U+22AD5 𢫕 𢫕 U+22B43 𢭃 𢭃 U+22BCA 𢯊 𢯊 U+22C51 𢱑 𢱑 U+22C55 𢱕 𢱕 U+22CC2 𢳂 𢳂 U+22D08 𢴈 𢴈 U+22D4C 𢵌 𢵌 U+22D67 𢵧 𢵧 U+22EB3 𢺳 𢺳dos2unix-7.3.4/test/wcstombs_test.c0000644000175500010010000000127212721132543016574 0ustar waterlanGeen#include #include #include #include #include #include int main() { wchar_t wstr[2]; char str[5]; size_t i; setlocale(LC_ALL, ""); wstr[0] = 0x8428; /* Unicode CJK U+8428 */ wstr[1] = 0x0; for (i=0;i #endif #ifdef D2U_UNICODE #if !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__) /* Unix, Cygwin */ # include #endif #endif void PrintLicense(void) { D2U_ANSI_FPRINTF(stdout,_("\ Copyright (C) 2009-%d Erwin Waterlander\n\ Copyright (C) 1994-1995 Benjamin Lin\n\ All rights reserved.\n\n"),2016); PrintBSDLicense(); } #ifdef D2U_UNICODE wint_t AddDOSNewLineW(FILE* ipOutF, CFlag *ipFlag, wint_t CurChar, wint_t PrevChar, const char *progname) { if (ipFlag->NewLine) { /* add additional CR-LF? */ /* Don't add line ending if it is a DOS line ending. Only in case of Unix line ending. */ if ((CurChar == 0x0a) && (PrevChar != 0x0d)) { if (d2u_putwc(0x0d, ipOutF, ipFlag, progname) == WEOF) { d2u_putwc_error(ipFlag,progname); return WEOF; } if (d2u_putwc(0x0a, ipOutF, ipFlag, progname) == WEOF) { d2u_putwc_error(ipFlag,progname); return WEOF; } } } return CurChar; } #endif int AddDOSNewLine(FILE* ipOutF, CFlag *ipFlag, int CurChar, int PrevChar, const char *progname) { if (ipFlag->NewLine) { /* add additional CR-LF? */ /* Don't add line ending if it is a DOS line ending. Only in case of Unix line ending. */ if ((CurChar == '\x0a') && (PrevChar != '\x0d')) { if (fputc('\x0d', ipOutF) == EOF) { d2u_putc_error(ipFlag,progname); return EOF; } if (fputc('\x0a', ipOutF) == EOF) { d2u_putc_error(ipFlag,progname); return EOF; } } } return CurChar; } /* converts stream ipInF to DOS format text and write to stream ipOutF * RetVal: 0 if success * -1 otherwise */ #ifdef D2U_UNICODE int ConvertUnixToDosW(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, const char *progname) { int RetVal = 0; wint_t TempChar; wint_t PreviousChar = 0; unsigned int line_nr = 1; unsigned int converted = 0; ipFlag->status = 0; /* LF -> CR-LF */ /* CR-LF -> CR-LF, in case the input file is a DOS text file */ /* \x0a = Newline/Line Feed (LF) */ /* \x0d = Carriage Return (CR) */ switch (ipFlag->FromToMode) { case FROMTO_UNIX2DOS: /* unix2dos */ while ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { /* get character */ if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != 0x0a) && /* Not an LF */ (TempChar != 0x0d) && /* Not a CR */ (TempChar != 0x09) && /* Not a TAB */ (TempChar != 0x0c)) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (ipFlag->verbose) { if ((ipFlag->stdio_mode) && (!ipFlag->error)) ipFlag->error = 1; D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Binary symbol 0x00%02X found at line %u\n"), TempChar, line_nr); } break; } if (TempChar == 0x0a) { if (d2u_putwc(0x0d, ipOutF, ipFlag, progname) == WEOF) { /* got LF, put extra CR */ RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } converted++; } else { if (TempChar == 0x0d) { /* got CR */ if ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) == WEOF) { /* get next char (possibly LF) */ if (ferror(ipInF)) /* Read error */ break; TempChar = 0x0d; /* end of file. */ } else { if (d2u_putwc(0x0d, ipOutF, ipFlag, progname) == WEOF) { /* put CR */ RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } PreviousChar = 0x0d; } } } if (TempChar == 0x0a) /* Count all DOS and Unix line breaks */ ++line_nr; if (d2u_putwc(TempChar, ipOutF, ipFlag, progname) == WEOF) { RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } else { if (AddDOSNewLineW( ipOutF, ipFlag, TempChar, PreviousChar, progname) == WEOF) { RetVal = -1; break; } } PreviousChar = TempChar; } if ((TempChar == WEOF) && ferror(ipInF)) { RetVal = -1; d2u_getc_error(ipFlag,progname); } break; case FROMTO_UNIX2MAC: /* unix2mac */ while ((TempChar = d2u_getwc(ipInF, ipFlag->bomtype)) != WEOF) { if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != 0x0a) && /* Not an LF */ (TempChar != 0x0d) && /* Not a CR */ (TempChar != 0x09) && /* Not a TAB */ (TempChar != 0x0c)) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (ipFlag->verbose) { if ((ipFlag->stdio_mode) && (!ipFlag->error)) ipFlag->error = 1; D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Binary symbol 0x00%02X found at line %u\n"), TempChar, line_nr); } break; } if (TempChar != 0x0a) { /* Not an LF */ if(d2u_putwc(TempChar, ipOutF, ipFlag, progname) == WEOF) { RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } PreviousChar = TempChar; if (TempChar == 0x0d) /* CR */ ++line_nr; } else{ /* TempChar is an LF */ if (PreviousChar != 0x0d) /* CR already counted */ ++line_nr; /* Don't touch this delimiter if it's a CR,LF pair. */ if ( PreviousChar == 0x0d ) { if (d2u_putwc(0x0a, ipOutF, ipFlag, progname) == WEOF) { /* CR,LF pair. Put LF */ RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } PreviousChar = TempChar; continue; } PreviousChar = TempChar; if (d2u_putwc(0x0d, ipOutF, ipFlag, progname) == WEOF) { /* Unix line end (LF). Put CR */ RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } converted++; if (ipFlag->NewLine) { /* add additional CR? */ if (d2u_putwc(0x0d, ipOutF, ipFlag, progname) == WEOF) { RetVal = -1; d2u_putwc_error(ipFlag,progname); break; } } } } if ((TempChar == WEOF) && ferror(ipInF)) { RetVal = -1; d2u_getc_error(ipFlag,progname); } break; default: /* unknown FromToMode */ ; #if DEBUG D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("program error, invalid conversion mode %d\n"),ipFlag->FromToMode); exit(1); #endif } if (ipFlag->status & UNICODE_CONVERSION_ERROR) ipFlag->line_nr = line_nr; if ((RetVal == 0) && (ipFlag->verbose > 1)) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Converted %u out of %u line breaks.\n"), converted, line_nr -1); } return RetVal; } #endif /* converts stream ipInF to DOS format text and write to stream ipOutF * RetVal: 0 if success * -1 otherwise */ int ConvertUnixToDos(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, const char *progname) { int RetVal = 0; int TempChar; int PreviousChar = 0; int *ConvTable; unsigned int line_nr = 1; unsigned int converted = 0; ipFlag->status = 0; switch (ipFlag->ConvMode) { case CONVMODE_ASCII: /* ascii */ case CONVMODE_UTF16LE: /* Assume UTF-16LE, bomtype = FILE_UTF8 or GB18030 */ case CONVMODE_UTF16BE: /* Assume UTF-16BE, bomtype = FILE_UTF8 or GB18030 */ ConvTable = U2DAsciiTable; break; case CONVMODE_7BIT: /* 7bit */ ConvTable = U2D7BitTable; break; case CONVMODE_437: /* iso */ ConvTable = U2DIso437Table; break; case CONVMODE_850: /* iso */ ConvTable = U2DIso850Table; break; case CONVMODE_860: /* iso */ ConvTable = U2DIso860Table; break; case CONVMODE_863: /* iso */ ConvTable = U2DIso863Table; break; case CONVMODE_865: /* iso */ ConvTable = U2DIso865Table; break; case CONVMODE_1252: /* iso */ ConvTable = U2DIso1252Table; break; default: /* unknown convmode */ ipFlag->status |= WRONG_CODEPAGE ; return(-1); } /* Turn off ISO and 7-bit conversion for Unicode text files */ if (ipFlag->bomtype > 0) ConvTable = U2DAsciiTable; if ((ipFlag->ConvMode > CONVMODE_7BIT) && (ipFlag->verbose)) { /* not ascii or 7bit */ D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("using code page %d.\n"), ipFlag->ConvMode); } /* LF -> CR-LF */ /* CR-LF -> CR-LF, in case the input file is a DOS text file */ /* \x0a = Newline/Line Feed (LF) */ /* \x0d = Carriage Return (CR) */ switch (ipFlag->FromToMode) { case FROMTO_UNIX2DOS: /* unix2dos */ while ((TempChar = fgetc(ipInF)) != EOF) { /* get character */ if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != '\x0a') && /* Not an LF */ (TempChar != '\x0d') && /* Not a CR */ (TempChar != '\x09') && /* Not a TAB */ (TempChar != '\x0c')) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (ipFlag->verbose) { if ((ipFlag->stdio_mode) && (!ipFlag->error)) ipFlag->error = 1; D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Binary symbol 0x%02X found at line %u\n"), TempChar, line_nr); } break; } if (TempChar == '\x0a') { if (fputc('\x0d', ipOutF) == EOF) { /* got LF, put extra CR */ RetVal = -1; d2u_putc_error(ipFlag,progname); break; } converted++; } else { if (TempChar == '\x0d') { /* got CR */ if ((TempChar = fgetc(ipInF)) == EOF) { /* get next char (possibly LF) */ if (ferror(ipInF)) /* Read error */ break; TempChar = '\x0d'; /* end of file. */ } else { if (fputc('\x0d', ipOutF) == EOF) { /* put CR */ RetVal = -1; d2u_putc_error(ipFlag,progname); break; } PreviousChar = '\x0d'; } } } if (TempChar == '\x0a') /* Count all DOS and Unix line breaks */ ++line_nr; if (fputc(ConvTable[TempChar], ipOutF) == EOF) { /* put LF or other char */ RetVal = -1; d2u_putc_error(ipFlag,progname); break; } else { if (AddDOSNewLine( ipOutF, ipFlag, TempChar, PreviousChar, progname) == EOF) { RetVal = -1; break; } } PreviousChar = TempChar; } if ((TempChar == EOF) && ferror(ipInF)) { RetVal = -1; d2u_getc_error(ipFlag,progname); } break; case FROMTO_UNIX2MAC: /* unix2mac */ while ((TempChar = fgetc(ipInF)) != EOF) { if ((ipFlag->Force == 0) && (TempChar < 32) && (TempChar != '\x0a') && /* Not an LF */ (TempChar != '\x0d') && /* Not a CR */ (TempChar != '\x09') && /* Not a TAB */ (TempChar != '\x0c')) { /* Not a form feed */ RetVal = -1; ipFlag->status |= BINARY_FILE ; if (ipFlag->verbose) { if ((ipFlag->stdio_mode) && (!ipFlag->error)) ipFlag->error = 1; D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Binary symbol 0x%02X found at line %u\n"), TempChar, line_nr); } break; } if (TempChar != '\x0a') { /* Not an LF */ if(fputc(ConvTable[TempChar], ipOutF) == EOF) { RetVal = -1; d2u_putc_error(ipFlag,progname); break; } PreviousChar = TempChar; if (TempChar == '\x0d') /* CR */ ++line_nr; } else { /* TempChar is an LF */ if (PreviousChar != '\x0d') /* CR already counted */ ++line_nr; /* Don't touch this delimiter if it's a CR,LF pair. */ if ( PreviousChar == '\x0d' ) { if (fputc('\x0a', ipOutF) == EOF) { /* CR,LF pair. Put LF */ RetVal = -1; d2u_putc_error(ipFlag,progname); break; } PreviousChar = TempChar; continue; } PreviousChar = TempChar; if (fputc('\x0d', ipOutF) == EOF) { /* Unix line end (LF). Put CR */ RetVal = -1; d2u_putc_error(ipFlag,progname); break; } converted++; if (ipFlag->NewLine) { /* add additional CR? */ if (fputc('\x0d', ipOutF) == EOF) { RetVal = -1; d2u_putc_error(ipFlag,progname); break; } } } } if ((TempChar == EOF) && ferror(ipInF)) { RetVal = -1; d2u_getc_error(ipFlag,progname); } break; default: /* unknown FromToMode */ ; #if DEBUG D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("program error, invalid conversion mode %d\n"),ipFlag->FromToMode); exit(1); #endif } if ((RetVal == 0) && (ipFlag->verbose > 1)) { D2U_UTF8_FPRINTF(stderr, "%s: ", progname); D2U_UTF8_FPRINTF(stderr, _("Converted %u out of %u line breaks.\n"), converted, line_nr -1); } return RetVal; } int main (int argc, char *argv[]) { /* variable declarations */ char progname[9]; CFlag *pFlag; char *ptr; char localedir[1024]; # ifdef __MINGW64__ int _dowildcard = -1; /* enable wildcard expansion for Win64 */ # endif int argc_new; char **argv_new; #ifdef D2U_UNIFILE wchar_t **wargv; char ***argv_glob; #endif progname[8] = '\0'; strcpy(progname,"unix2dos"); #ifdef ENABLE_NLS ptr = getenv("DOS2UNIX_LOCALEDIR"); if (ptr == NULL) strcpy(localedir,LOCALEDIR); else { if (strlen(ptr) < sizeof(localedir)) strcpy(localedir,ptr); else { D2U_UTF8_FPRINTF(stderr,"%s: ",progname); D2U_ANSI_FPRINTF(stderr, "%s", _("error: Value of environment variable DOS2UNIX_LOCALEDIR is too long.\n")); strcpy(localedir,LOCALEDIR); } } #endif #if defined(ENABLE_NLS) || (defined(D2U_UNICODE) && !defined(__MSDOS__) && !defined(_WIN32) && !defined(__OS2__)) /* setlocale() is also needed for nl_langinfo() */ #if (defined(_WIN32) && !defined(__CYGWIN__)) /* When the locale is set to "" on Windows all East-Asian multi-byte ANSI encoded text is printed wrongly when you use standard printf(). Also UTF-8 code is printed wrongly. See also test/setlocale.c. When we set the locale to "C" gettext still translates the messages on Windows. On Unix this would disable gettext. */ setlocale (LC_ALL, "C"); #else setlocale (LC_ALL, ""); #endif #endif #ifdef ENABLE_NLS bindtextdomain (PACKAGE, localedir); textdomain (PACKAGE); #endif /* variable initialisations */ pFlag = (CFlag*)malloc(sizeof(CFlag)); if (pFlag == NULL) { D2U_UTF8_FPRINTF(stderr, "unix2dos:"); D2U_ANSI_FPRINTF(stderr, " %s\n", strerror(errno)); return errno; } pFlag->FromToMode = FROMTO_UNIX2DOS; /* default unix2dos */ pFlag->keep_bom = 1; if ( ((ptr=strrchr(argv[0],'/')) == NULL) && ((ptr=strrchr(argv[0],'\\')) == NULL) ) ptr = argv[0]; else ptr++; if ((strcmpi("unix2mac", ptr) == 0) || (strcmpi("unix2mac.exe", ptr) == 0)) { pFlag->FromToMode = FROMTO_UNIX2MAC; strcpy(progname,"unix2mac"); } #ifdef D2U_UNIFILE /* Get arguments in wide Unicode format in the Windows Command Prompt */ /* This does not support wildcard expansion (globbing) */ wargv = CommandLineToArgvW(GetCommandLineW(), &argc); argv_glob = (char ***)malloc(sizeof(char***)); if (argv_glob == NULL) { D2U_UTF8_FPRINTF(stderr, "%s:", progname); D2U_ANSI_FPRINTF(stderr, " %s\n", strerror(errno)); free(pFlag); return errno; } /* Glob the arguments and convert them to UTF-8 */ argc_new = glob_warg(argc, wargv, argv_glob, pFlag, progname); argv_new = *argv_glob; #else argc_new = argc; argv_new = argv; #endif #ifdef D2U_UNICODE return parse_options(argc_new, argv_new, pFlag, localedir, progname, PrintLicense, ConvertUnixToDos, ConvertUnixToDosW); #else return parse_options(argc_new, argv_new, pFlag, localedir, progname, PrintLicense, ConvertUnixToDos); #endif } dos2unix-7.3.4/unix2dos.h0000644000175500010010000004552212721132543014503 0ustar waterlanGeen/* * Copyright (C) 2009-2012 Erwin Waterlander * Copyright (C) 1994-1995 Benjamin Lin. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice in the documentation and/or other materials provided with * the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __UNIX2DOS_H #define __UNIX2DOS_H #ifdef __UNIX2DOS_C /* ASCII mode. No conversion. */ static int U2DAsciiTable[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x80', '\x81', '\x82', '\x83', '\x84', '\x85', '\x86', '\x87', '\x88', '\x89', '\x8a', '\x8b', '\x8c', '\x8d', '\x8e', '\x8f', '\x90', '\x91', '\x92', '\x93', '\x94', '\x95', '\x96', '\x97', '\x98', '\x99', '\x9a', '\x9b', '\x9c', '\x9d', '\x9e', '\x9f', '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf', '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7', '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf', '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7', '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf', '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7', '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde', '\xdf', '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7', '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff', }; /* 7bit mode. */ /* All 8 bit non-ASCII characters are converted to a space (\x20) */ static int U2D7BitTable [256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', '\x20', }; /* ISO mode. ISO-8859-1 -> CP437 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso437Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xff', '\xad', '\x9b', '\x9c', '\x2e', '\x9d', '\x2e', '\x2e', '\x2e', '\x2e', '\xa6', '\xae', '\xaa', '\x2e', '\x2e', '\x2e', '\xf8', '\xf1', '\xfd', '\x2e', '\x2e', '\xe6', '\x2e', '\xfa', '\x2e', '\x2e', '\xa7', '\xaf', '\xac', '\xab', '\x2e', '\xa8', '\x2e', '\x2e', '\x2e', '\x2e', '\x8e', '\x8f', '\x92', '\x80', '\x2e', '\x90', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa5', '\x2e', '\x2e', '\x2e', '\x2e', '\x99', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x9a', '\x2e', '\x2e', '\xe1', '\x85', '\xa0', '\x83', '\x2e', '\x84', '\x86', '\x91', '\x87', '\x8a', '\x82', '\x88', '\x89', '\x8d', '\xa1', '\x8c', '\x8b', '\x2e', '\xa4', '\x95', '\xa2', '\x93', '\x2e', '\x94', '\xf6', '\x2e', '\x97', '\xa3', '\x96', '\x81', '\x2e', '\x2e', '\x98', }; /* ISO mode. ISO-8859-1 -> CP850 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso850Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xff', '\xad', '\xbd', '\x9c', '\xcf', '\xbe', '\xdd', '\xf5', '\xf9', '\xb8', '\xa6', '\xae', '\xaa', '\xf0', '\xa9', '\xee', '\xf8', '\xf1', '\xfd', '\xfc', '\xef', '\xe6', '\xf4', '\xfa', '\xf7', '\xfb', '\xa7', '\xaf', '\xac', '\xab', '\xf3', '\xa8', '\xb7', '\xb5', '\xb6', '\xc7', '\x8e', '\x8f', '\x92', '\x80', '\xd4', '\x90', '\xd2', '\xd3', '\xde', '\xd6', '\xd7', '\xd8', '\xd1', '\xa5', '\xe3', '\xe0', '\xe2', '\xe5', '\x99', '\x9e', '\x9d', '\xeb', '\xe9', '\xea', '\x9a', '\xed', '\xe8', '\xe1', '\x85', '\xa0', '\x83', '\xc6', '\x84', '\x86', '\x91', '\x87', '\x8a', '\x82', '\x88', '\x89', '\x8d', '\xa1', '\x8c', '\x8b', '\xd0', '\xa4', '\x95', '\xa2', '\x93', '\xe4', '\x94', '\xf6', '\x9b', '\x97', '\xa3', '\x96', '\x81', '\xec', '\xe7', '\x98', }; /* ISO mode. ISO-8859-1 -> CP860 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso860Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xff', '\xad', '\x9b', '\x9c', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa6', '\xae', '\xaa', '\x2e', '\x2e', '\x2e', '\xf8', '\xf1', '\xfd', '\x2e', '\x2e', '\xe6', '\x2e', '\xfa', '\x2e', '\x2e', '\xa7', '\xaf', '\xac', '\xab', '\x2e', '\xa8', '\x91', '\x86', '\x8f', '\x8e', '\x2e', '\x2e', '\x2e', '\x80', '\x92', '\x90', '\x89', '\x2e', '\x98', '\x8b', '\x2e', '\x2e', '\x2e', '\xa5', '\xa9', '\x9f', '\x8c', '\x99', '\x2e', '\x2e', '\x2e', '\x9d', '\x96', '\x2e', '\x9a', '\x2e', '\x2e', '\xe1', '\x85', '\xa0', '\x83', '\x84', '\x2e', '\x2e', '\x2e', '\x87', '\x8a', '\x82', '\x88', '\x2e', '\x8d', '\xa1', '\x2e', '\x2e', '\x2e', '\xa4', '\x95', '\xa2', '\x93', '\x94', '\x2e', '\xf6', '\x2e', '\x97', '\xa3', '\x2e', '\x81', '\x2e', '\x2e', '\x2e', }; /* ISO mode. ISO-8859-1 -> CP863 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso863Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xff', '\xad', '\x9b', '\x9c', '\x98', '\x9d', '\xa0', '\x8f', '\xa4', '\x2e', '\xa6', '\xae', '\xaa', '\x2e', '\x2e', '\xa7', '\xf8', '\xf1', '\xfd', '\xa6', '\xa1', '\xe6', '\x86', '\xfa', '\xa5', '\x2e', '\xa7', '\xaf', '\xac', '\xab', '\xad', '\xa8', '\x8e', '\x2e', '\x84', '\x2e', '\x8e', '\x8f', '\x92', '\x80', '\x91', '\x90', '\x92', '\x94', '\x2e', '\x2e', '\xa8', '\x95', '\x2e', '\xa5', '\x2e', '\x2e', '\x99', '\x2e', '\x99', '\x2e', '\x2e', '\x9d', '\x2e', '\x9e', '\x9a', '\x2e', '\x2e', '\xe1', '\x85', '\xa0', '\x83', '\x2e', '\x84', '\x86', '\x91', '\x87', '\x8a', '\x82', '\x88', '\x89', '\x8d', '\xa1', '\x8c', '\x8b', '\x2e', '\xa4', '\x95', '\xa2', '\x93', '\x2e', '\x94', '\xf6', '\x2e', '\x97', '\xa3', '\x96', '\x81', '\x2e', '\x2e', '\x98', }; /* ISO mode. ISO-8859-1 -> CP865 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso865Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xff', '\xad', '\x2e', '\x9c', '\xaf', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa6', '\xae', '\xaa', '\x2e', '\x2e', '\x2e', '\xf8', '\xf1', '\xfd', '\x2e', '\x2e', '\xe6', '\x2e', '\xfa', '\x2e', '\x2e', '\xa7', '\x2e', '\xac', '\xab', '\x2e', '\xa8', '\x2e', '\x2e', '\x2e', '\x2e', '\x8e', '\x8f', '\x92', '\x80', '\x2e', '\x90', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa5', '\x2e', '\x2e', '\x2e', '\x2e', '\x99', '\x2e', '\x9d', '\x2e', '\x2e', '\x2e', '\x9a', '\x2e', '\x2e', '\xe1', '\x85', '\xa0', '\x83', '\x2e', '\x84', '\x86', '\x91', '\x87', '\x8a', '\x82', '\x88', '\x89', '\x8d', '\xa1', '\x8c', '\x8b', '\x2e', '\xa4', '\x95', '\xa2', '\x93', '\x2e', '\x94', '\xf6', '\x9b', '\x97', '\xa3', '\x96', '\x81', '\x2e', '\x2e', '\x98', }; /* ISO-8859-1 -> CP1252 */ /* Non-convertable characters are converted to a dot (\x2e) */ static int U2DIso1252Table[256] = { '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f', '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27', '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f', '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37', '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f', '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47', '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f', '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57', '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f', '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67', '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f', '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77', '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\x2e', '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7', '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf', '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7', '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf', '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7', '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf', '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7', '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde', '\xdf', '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7', '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef', '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7', '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff', }; #endif #ifdef D2U_UNICODE int ConvertUnixToDosW(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, const char *progname); #endif int ConvertUnixToDos(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, const char *progname); #endif dos2unix-7.3.4/vc.mak0000644000175500010010000001025412721132543013653 0ustar waterlanGeen# Makefile for Microsoft Visual C++ # !include version.mk UNIFILE = 1 CC = cl.exe /nologo LINK = link.exe /nologo SRCDIR = . DEFINES = /DVER_REVISION=\"$(DOS2UNIX_VERSION)\" /DVER_DATE=\"$(DOS2UNIX_DATE)\" /DVER_AUTHOR=\""$(DOS2UNIX_AUTHOR)"\" CFLAGS = $(DEFINES) !ifdef DEBUG LDFLAGS = -debug !else LDFLAGS = !endif PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe HTMLEXT = htm PACKAGE = dos2unix DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT) VERSIONSUFFIX = -win32 UCS = 1 prefix = c:\usr\local # We only build and install the English manuals, because wildcards on # directory names are not supported in Windows CMD. Like man\*\man1\*.txt will # give a syntax error. It could be done with more scripting, but for simplicity # we stick to English. all: $(PROGRAMS) $(DOCFILES) dos2unix.exe: dos2unix.obj querycp.obj common.obj $(LINK) $(LDFLAGS) dos2unix.obj querycp.obj common.obj setargv.obj mpr.lib shell32.lib unix2dos.exe: unix2dos.obj querycp.obj common.obj $(LINK) $(LDFLAGS) unix2dos.obj querycp.obj common.obj setargv.obj mpr.lib shell32.lib !if "$(UCS)" == "1" CFLAGS = $(CFLAGS) -DD2U_UNICODE !endif !if "$(UNIFILE)" == "1" CFLAGS = $(CFLAGS) -DD2U_UNIFILE !endif !if "$(DEBUGMSG)" == "1" CFLAGS = $(CFLAGS) -DDEBUG !endif dos2unix.obj : $(SRCDIR)\dos2unix.c $(SRCDIR)\querycp.h $(SRCDIR)\common.h $(CC) -c $(CFLAGS) $(SRCDIR)\dos2unix.c unix2dos.obj : $(SRCDIR)\unix2dos.c $(SRCDIR)\querycp.h $(SRCDIR)\common.h $(CC) -c $(CFLAGS) $(SRCDIR)\unix2dos.c querycp.obj : $(SRCDIR)\querycp.c $(SRCDIR)\querycp.h $(CC) -c $(CFLAGS) $(SRCDIR)\querycp.c common.obj : $(SRCDIR)\common.c $(SRCDIR)\common.h $(CC) -c $(CFLAGS) $(SRCDIR)\common.c mac2unix.exe : dos2unix.exe copy /v dos2unix.exe mac2unix.exe unix2mac.exe : unix2dos.exe copy /v unix2dos.exe unix2mac.exe exec_prefix = $(prefix) bindir = $(exec_prefix)\bin datarootdir = $(prefix)\share datadir = $(datarootdir) !ifndef docsubdir docsubdir = $(PACKAGE)-$(DOS2UNIX_VERSION) !endif docdir = $(datarootdir)\doc\$(docsubdir) INSTALL_OBJS_DOC = README.txt NEWS.txt ChangeLog.txt COPYING.txt TODO.txt BUGS.txt $(DOCFILES) $(prefix): if not exist $@ mkdir $@ $(bindir): $(prefix) if not exist $@ mkdir $@ $(datarootdir): $(prefix) if not exist $@ mkdir $@ $(datarootdir)\doc: $(datarootdir) if not exist $@ mkdir $@ $(docdir): $(datarootdir)\doc if not exist $@ mkdir $@ install: $(PROGRAMS) $(DOCFILES) $(bindir) $(docdir) copy dos2unix.exe $(bindir) copy mac2unix.exe $(bindir) copy unix2dos.exe $(bindir) copy unix2mac.exe $(bindir) copy README.txt $(docdir) copy NEWS.txt $(docdir) copy ChangeLog.txt $(docdir) copy COPYING.txt $(docdir) copy TODO.txt $(docdir) copy BUGS.txt $(docdir) copy man\man1\$(PACKAGE).txt $(docdir) copy man\man1\$(PACKAGE).$(HTMLEXT) $(docdir) man\man1\dos2unix.txt : man\man1\dos2unix.pod pod2text $** > $@ man\man1\dos2unix.$(HTMLEXT) : man\man1\dos2unix.pod pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/MAC to UNIX and vice versa text file format converter" $** > $@ TXTFILES = man\man1\$(PACKAGE).txt HTMLFILES = man\man1\$(PACKAGE).$(HTMLEXT) txt : $(TXTFILES) html : $(HTMLFILES) doc : $(DOCFILES) uninstall: -del $(bindir)\dos2unix.exe -del $(bindir)\mac2unix.exe -del $(bindir)\unix2dos.exe -del $(bindir)\unix2mac.exe -rmdir /s /q $(docdir) !ifndef VERSIONSUFFIX VERSIONSUFFIX = -bin !endif !ifndef ZIPFILE ZIPFILE = $(PACKAGE)$(DOS2UNIX_VERSION)$(VERSIONSUFFIX).zip !endif ZIPOBJ = bin\dos2unix.exe bin\mac2unix.exe bin\unix2dos.exe bin\unix2mac.exe share\doc\$(docsubdir) $(ZIPOBJ_EXTRA) DISTCMD = dist.bat dist : @echo cd /d $(prefix) > $(DISTCMD) @echo unix2dos -k share\doc\$(docsubdir)\*.txt >> $(DISTCMD) @echo unix2dos -k share\doc\$(docsubdir)\*.$(HTMLEXT) >> $(DISTCMD) @echo zip -r $(ZIPFILE) $(ZIPOBJ) >> $(DISTCMD) @echo cd /d $(MAKEDIR) >> $(DISTCMD) @echo move $(prefix)\$(ZIPFILE) .. >> $(DISTCMD) .\$(DISTCMD) mostlyclean : -del *.obj -del *.exe -del *.tmp clean : mostlyclean -del $(DISTCMD) maintainer-clean : clean -del $(DOCFILES) dos2unix-7.3.4/version.mk0000644000175500010010000000016712721132543014571 0ustar waterlanGeenDOS2UNIX_VERSION = 7.3.4 DOS2UNIX_VERSION_SHORT = 734 DOS2UNIX_DATE = 2016-05-24 DOS2UNIX_AUTHOR = 'Erwin Waterlander' dos2unix-7.3.4/wcc.mif0000644000175500010010000000751612721132543014031 0ustar waterlanGeen!ifeq UCS 1 CFLAGS += -DD2U_UNICODE !endif !ifeq UNIFILE 1 CFLAGS += -DD2U_UNIFILE -D_O_U16TEXT=0x20000 !endif !ifeq DEBUGMSG 1 CFLAGS += -DDEBUG !endif dos2unix.obj : $(SRCDIR)\dos2unix.c $(SRCDIR)\querycp.h $(SRCDIR)\common.h $(CC) $(CFLAGS) $(SRCDIR)\dos2unix.c unix2dos.obj : $(SRCDIR)\unix2dos.c $(SRCDIR)\querycp.h $(SRCDIR)\common.h $(CC) $(CFLAGS) $(SRCDIR)\unix2dos.c querycp.obj : $(SRCDIR)\querycp.c $(SRCDIR)\querycp.h $(CC) $(CFLAGS) $(SRCDIR)\querycp.c common.obj : $(SRCDIR)\common.c $(SRCDIR)\common.h $(CC) $(CFLAGS) $(SRCDIR)\common.c wildargv.obj : $(WATCOMSRC)\wildargv.c $(CC) $(CFLAGS) $(WATCOMSRC)\wildargv.c mac2unix.exe : dos2unix.exe copy /v dos2unix.exe mac2unix.exe unix2mac.exe : unix2dos.exe copy /v unix2dos.exe unix2mac.exe exec_prefix = $(prefix) bindir = $(exec_prefix)\bin datarootdir = $(prefix)\share datadir = $(datarootdir) !ifndef docsubdir docsubdir = $(PACKAGE)-$(DOS2UNIX_VERSION) !endif docdir = $(datarootdir)\doc\$(docsubdir) INSTALL_OBJS_DOC = README.txt NEWS.txt ChangeLog.txt COPYING.txt TODO.txt BUGS.txt $(DOCFILES) $(prefix): .EXISTSONLY mkdir $@ $(bindir): $(prefix) .EXISTSONLY mkdir $@ $(datarootdir): $(prefix) .EXISTSONLY mkdir $@ $(datarootdir)\doc: $(datarootdir) .EXISTSONLY mkdir $@ $(docdir): $(datarootdir)\doc .EXISTSONLY mkdir $@ # We only build and install the English manuals, because wildcards on # directory names are not supported in Windows CMD. Like man\*\man1\*.txt will # give a syntax error. It could be done with more scripting, but for simplicity # we stick to English. install: $(PROGRAMS) $(DOCFILES) $(bindir) $(docdir) .SYMBOLIC copy dos2unix.exe $(bindir) copy mac2unix.exe $(bindir) copy unix2dos.exe $(bindir) copy unix2mac.exe $(bindir) copy README.txt $(docdir) copy NEWS.txt $(docdir) copy ChangeLog.txt $(docdir) copy COPYING.txt $(docdir) copy TODO.txt $(docdir) copy BUGS.txt $(docdir) copy man\man1\dos2unix.txt $(docdir) copy man\man1\dos2unix.$(HTMLEXT) $(docdir) man\man1\dos2unix.txt : man\man1\dos2unix.pod pod2text $< > $@ man\man1\dos2unix.$(HTMLEXT) : man\man1\dos2unix.pod pod2html --title="$(PACKAGE) $(DOS2UNIX_VERSION) - DOS/MAC to UNIX and vice versa text file format converter" $< > $@ TXTFILES = man\man1\$(PACKAGE).txt man\es\man1\$(PACKAGE).txt man\nl\man1\$(PACKAGE).txt HTMLFILES = man\man1\$(PACKAGE).$(HTMLEXT) man\es\man1\$(PACKAGE).$(HTMLEXT) man\nl\man1\$(PACKAGE).$(HTMLEXT) txt : $(TXTFILES) .SYMBOLIC html : $(HTMLFILES) .SYMBOLIC doc : $(DOCFILES) .SYMBOLIC uninstall: .SYMBOLIC -del $(bindir)\dos2unix.exe -del $(bindir)\mac2unix.exe -del $(bindir)\unix2dos.exe -del $(bindir)\unix2mac.exe -rmdir /s /q $(docdir) !ifndef VERSIONSUFFIX VERSIONSUFFIX = -bin !endif !ifndef ZIPFILE ZIPFILE = $(PACKAGE)$(DOS2UNIX_VERSION)$(VERSIONSUFFIX).zip !endif ZIPOBJ = bin\dos2unix.exe bin\mac2unix.exe bin\unix2dos.exe bin\unix2mac.exe share\doc\$(docsubdir) $(ZIPOBJ_EXTRA) CURDISK = $+ $(%cdrive): $- CURDIR = $+ $(%cwd) $- !ifdef __OS2__ DISTCMD = dist.cmd !else DISTCMD = dist.bat !endif dist : .SYMBOLIC @%create $(DISTCMD) @%append $(DISTCMD) set PREFIX=$(prefix) @%append $(DISTCMD) set PREFIXDISK=%PREFIX:~0,2% @%append $(DISTCMD) %PREFIXDISK% @%append $(DISTCMD) cd $(prefix) @%append $(DISTCMD) unix2dos -k share\doc\$(docsubdir)\*.txt @%append $(DISTCMD) unix2dos -k share\doc\$(docsubdir)\*.$(HTMLEXT) @%append $(DISTCMD) zip -r $(ZIPFILE) $(ZIPOBJ) @%append $(DISTCMD) $(CURDISK) @%append $(DISTCMD) cd $(CURDIR) @%append $(DISTCMD) move $(prefix)\$(ZIPFILE) .. .\$(DISTCMD) mostlyclean : .SYMBOLIC -del *.obj -del *.exe -del *.SYM -del *.map -del *.ilk -del *.tmp clean : mostlyclean .SYMBOLIC maintainer-clean : clean .SYMBOLIC -del $(DOCFILES) dos2unix-7.3.4/wccdos16.mak0000644000175500010010000000225212721132543014673 0ustar waterlanGeen!include version.mk CC = wcc SRCDIR = . DEFINES = -DVER_REVISION="$(DOS2UNIX_VERSION)" -DVER_DATE="$(DOS2UNIX_DATE)" -DVER_AUTHOR="$(DOS2UNIX_AUTHOR)" CFLAGS = $(DEFINES) -i=$(SRCDIR) -w4 -e25 -zq -od -d2 -bt=dos -ml WATCOMSRC = $(%WATCOM)\src\startup PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe HTMLEXT = htm PACKAGE = dos2unix DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT) VERSIONSUFFIX = b ZIPFILE = d2u$(DOS2UNIX_VERSION_SHORT)$(VERSIONSUFFIX).zip docsubdir = dos2unix prefix = c:\dos TARGET = dos all: $(PROGRAMS) $(DOCFILES) .SYMBOLIC dos2unix.exe: dos2unix.obj querycp.obj common.obj wildargv.obj @%create dos2unix.lnk @%append dos2unix.lnk FIL dos2unix.obj,querycp.obj,common.obj,wildargv.obj wlink name dos2unix d all SYS $(TARGET) op m op st=32k op maxe=25 op q op symf @dos2unix.lnk del dos2unix.lnk unix2dos.exe: unix2dos.obj querycp.obj common.obj wildargv.obj @%create unix2dos.lnk @%append unix2dos.lnk FIL unix2dos.obj,querycp.obj,common.obj,wildargv.obj wlink name unix2dos d all SYS $(TARGET) op m op st=32k op maxe=25 op q op symf @unix2dos.lnk del unix2dos.lnk !include wcc.mif dos2unix-7.3.4/wccdos32.mak0000644000175500010010000000234612721132543014675 0ustar waterlanGeen!include version.mk CC = wcc386 SRCDIR = . DEFINES = -DVER_REVISION="$(DOS2UNIX_VERSION)" -DVER_DATE="$(DOS2UNIX_DATE)" -DVER_AUTHOR="$(DOS2UNIX_AUTHOR)" CFLAGS = $(DEFINES) -i=$(SRCDIR) -w4 -e25 -zq -od -d2 -5r -bt=dos -mf WATCOMSRC = $(%WATCOM)\src\startup PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe HTMLEXT = htm PACKAGE = dos2unix DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT) VERSIONSUFFIX = pm ZIPFILE = d2u$(DOS2UNIX_VERSION_SHORT)$(VERSIONSUFFIX).zip ZIPOBJ_EXTRA = bin\cwstub.exe docsubdir = dos2unix prefix = c:\dos32 TARGET = causeway all: $(PROGRAMS) $(DOCFILES) .SYMBOLIC dos2unix.exe: dos2unix.obj querycp.obj common.obj wildargv.obj @%create dos2unix.lnk @%append dos2unix.lnk FIL dos2unix.obj,querycp.obj,common.obj,wildargv.obj wlink name dos2unix d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @dos2unix.lnk del dos2unix.lnk unix2dos.exe: unix2dos.obj querycp.obj common.obj wildargv.obj @%create unix2dos.lnk @%append unix2dos.lnk FIL unix2dos.obj,querycp.obj,common.obj,wildargv.obj wlink name unix2dos d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @unix2dos.lnk del unix2dos.lnk !include wcc.mif dos2unix-7.3.4/wccos2.mak0000644000175500010010000000220512721132543014440 0ustar waterlanGeen!include version.mk CC = wcc386 SRCDIR = . DEFINES = -DVER_REVISION="$(DOS2UNIX_VERSION)" -DVER_DATE="$(DOS2UNIX_DATE)" -DVER_AUTHOR="$(DOS2UNIX_AUTHOR)" CFLAGS = $(DEFINES) -i=$(SRCDIR) -i$(%WATCOM)\h\os2 -w4 -e25 -zq -od -d2 -6r -bt=os2 -mf WATCOMSRC = $(%WATCOM)\src\startup PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe HTMLEXT = htm PACKAGE = dos2unix DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT) VERSIONSUFFIX = -os2 prefix = c:\usr TARGET = os2v2 all: $(PROGRAMS) $(DOCFILES) .SYMBOLIC dos2unix.exe: dos2unix.obj querycp.obj common.obj wildargv.obj @%create dos2unix.lnk @%append dos2unix.lnk FIL dos2unix.obj,querycp.obj,common.obj,wildargv.obj wlink name dos2unix d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @dos2unix.lnk del dos2unix.lnk unix2dos.exe: unix2dos.obj querycp.obj common.obj wildargv.obj @%create unix2dos.lnk @%append unix2dos.lnk FIL unix2dos.obj,querycp.obj,common.obj,wildargv.obj wlink name unix2dos d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @unix2dos.lnk del unix2dos.lnk !include wcc.mif dos2unix-7.3.4/wccwin32.mak0000644000175500010010000000233412721132543014702 0ustar waterlanGeen!include version.mk CC = wcc386 SRCDIR = . DEFINES = -DVER_REVISION="$(DOS2UNIX_VERSION)" -DVER_DATE="$(DOS2UNIX_DATE)" -DVER_AUTHOR="$(DOS2UNIX_AUTHOR)" CFLAGS = $(DEFINES) -i=$(SRCDIR) -w4 -e25 -zq -od -d2 -5r -bt=nt -mf WATCOMSRC = $(%WATCOM)\src\startup PROGRAMS = dos2unix.exe unix2dos.exe mac2unix.exe unix2mac.exe HTMLEXT = htm PACKAGE = dos2unix DOCFILES = man\man1\$(PACKAGE).txt man\man1\$(PACKAGE).$(HTMLEXT) VERSIONSUFFIX = -win32 UCS = 1 UNIFILE = 1 prefix = c:\usr\local TARGET = nt all: $(PROGRAMS) $(DOCFILES) .SYMBOLIC dos2unix.exe: dos2unix.obj querycp.obj common.obj wildargv.obj @%create dos2unix.lnk @%append dos2unix.lnk FIL dos2unix.obj,querycp.obj,common.obj,wildargv.obj @%append dos2unix.lnk library mpr.lib wlink name dos2unix d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @dos2unix.lnk del dos2unix.lnk unix2dos.exe: unix2dos.obj querycp.obj common.obj wildargv.obj @%create unix2dos.lnk @%append unix2dos.lnk FIL unix2dos.obj,querycp.obj,common.obj,wildargv.obj @%append unix2dos.lnk library mpr.lib wlink name unix2dos d all SYS $(TARGET) op inc op m op st=64k op maxe=25 op q op symf @unix2dos.lnk del unix2dos.lnk !include wcc.mif