summaryrefslogtreecommitdiff
path: root/man/man1/dos2unix.1
diff options
context:
space:
mode:
Diffstat (limited to 'man/man1/dos2unix.1')
-rw-r--r--man/man1/dos2unix.1101
1 files changed, 64 insertions, 37 deletions
diff --git a/man/man1/dos2unix.1 b/man/man1/dos2unix.1
index 14cb50a..8596a9c 100644
--- a/man/man1/dos2unix.1
+++ b/man/man1/dos2unix.1
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
+.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
@@ -71,7 +71,7 @@
.\" ========================================================================
.\"
.IX Title "dos2unix 1"
-.TH dos2unix 1 "2014-09-17" "dos2unix" "2014-10-06"
+.TH dos2unix 1 "2015-01-02" "dos2unix" "2015-02-11"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -170,6 +170,11 @@ with ascii being the default.
.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.
@@ -241,13 +246,13 @@ Show only the byte order mark:
\& dos2unix \-\-info=b *.txt
.Ve
.Sp
-List the files that have \s-1DOS\s0 line breaks.
+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.
+List the files that have Unix line breaks:
.Sp
.Vb 1
\& unix2dos \-ic *.txt
@@ -400,49 +405,49 @@ Never use \s-1ISO\s0 conversion on Unicode text files. It will corrupt \s-1UTF\-
.Sp
Some examples:
.Sp
-Convert from \s-1DOS\s0 default code page to Unix Latin\-1
+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
+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
+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)
+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
+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
+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
+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
+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
@@ -470,9 +475,12 @@ Dos2unix and unix2dos with Unicode \s-1UTF\-16\s0 support, can read little and b
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
-\&\s-1UTF\-16\s0 encoded files are by default converted to \s-1UTF\-8.\s0 On Unix/Linux it is
-required that the locale character encoding is set to \s-1UTF\-8.\s0 Use the \fIlocale\fR\|(1)
-command to find out what the locale character encoding is. \s-1UTF\-8\s0 formatted
+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
@@ -509,53 +517,72 @@ Unix2dos writes by default a \s-1BOM\s0 in the output file when the input file h
Dos2unix and unix2dos write always a \s-1BOM\s0 when option \f(CW\*(C`\-m\*(C'\fR is used.
.SS "Unicode examples"
.IX Subsection "Unicode examples"
-Convert from Windows \s-1UTF\-16 \s0(with \s-1BOM\s0) to Unix \s-1UTF\-8\s0
+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
+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
+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
+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 <http://en.wikipedia.org/wiki/GB_18030>.
+.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 location is set to China.
+E.g. in an English British locale setting \f(CW\*(C`en_GB.GB18030\*(C'\fR conversion of \s-1UTF\-16\s0
+to \s-1GB18030\s0 will not work, but in a Chinese \f(CW\*(C`zh_CN.GB18030\*(C'\fR locale setting it
+will work.
+.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'.
+Read input from 'stdin' and write output to 'stdout':
.PP
.Vb 2
\& dos2unix
\& dos2unix \-l \-c mac
.Ve
.PP
-Convert and replace a.txt. Convert and replace b.txt.
+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.
+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.
+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
@@ -563,48 +590,48 @@ Convert and replace b.txt in 7bit conversion mode.
\& dos2unix \-ascii a.txt \-7 b.txt
.Ve
.PP
-Convert a.txt from Mac to Unix format.
+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.
+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.
+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.
+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.
+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.
+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.
+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
@@ -640,9 +667,9 @@ shells:
.Ve
.Sp
For a complete list of language and country codes see the gettext manual:
-<http://www.gnu.org/software/gettext/manual/gettext.html#Language\-Codes>
+<http://www.gnu.org/software/gettext/manual/html_node/Usual\-Language\-Codes.html>
.Sp
-On Unix systems you can use to command \fIlocale\fR\|(1) to get locale specific
+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"
@@ -652,7 +679,7 @@ For instance, first Dutch and then German: \f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. You
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:
-<http://www.gnu.org/software/gettext/manual/gettext.html#The\-LANGUAGE\-variable>
+<http://www.gnu.org/software/gettext/manual/html_node/The\-LANGUAGE\-variable.html>
.Sp
If you select a language which is not available you will get the
standard English messages.
@@ -686,10 +713,10 @@ are used.
<http://en.wikipedia.org/wiki/Unicode>
.SH "AUTHORS"
.IX Header "AUTHORS"
-Benjamin Lin \- <blin@socs.uts.edu.au>
+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)
+Erwin Waterlander \- <waterlan@xs4all.nl> (maintainer)
.PP
Project page: <http://waterlan.home.xs4all.nl/dos2unix.html>
.PP