.\" Copyright (c) 2009 Edwin Groothuis .\" 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, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 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. .\" .\" $FreeBSD$ .\" .Dd October 4, 2009 .Dt unicode2utf8 1 .Os .Sh NAME .Nm unicodename2utf8 , .Nm utf82unicodename .Nd convert a file with Unicode name definitions into UTF-8 character and vice-versa. .Sh SYNOPSIS .Nm .Fl cldr Ar directory .Op Fl -input Ar filename .Op Fl -output Ar filename .Op Fl -reverse .Nm utf82unicode .Fl -cldr Ar directory .Op Fl -input Ar filename .Op Fl -output Ar filename .Op Fl -reverse .Sh DESCRIPTION The .Nm utility converts the Unicode encoded strings in the contents of the specified input file with the corresponding UTF-8 character definitions. The .Nm utf82unicodename utility converts the UTF-8 encoded strings in the contents of the specified input file with the corresponding Unicode names. .Pp The Unicode encoded strings are specified between a '<' and a '>' sign. They are looked up against the keys in the conversion table specified in the file .Pa posix/UTF-8.cm in the with .Fl -cldr defined directory and the matching value is written out. .Pp Other characters are copied as-is. .Sh OPTIONS .Bl -tag -width indent .It Fl -cldr Ar directory The directory where the file .Pa posix/UTF-8.cm resides. By default this should point to .Pa /usr/share/misc , but for maintainers of the FreeBSD locale database this could point to their own extracted copy of the CLDR database. .It Fl -input Ar filename The source file. If not specific, stdin will be used. .It Fl -output Ar filename The output file. If not specific, stdout will be used. .It Fl -reverse If specified, do the reverse conversions. .El .Sh EXIT STATUS The utilties exit with 0 on success, and >0 if an error occurs. .Sh SEE ALSO .Xr iconv 1 , .Xr bsdiconv 1 .Bl -tag -width indent .It http://cldr.unicode.org/ Website of the Common Locale Database Repository, the maintainers of the file .Pa /usr/share/misc/UTF-8.cm .El .Sh AUTHORS The utilities and this manual page were written by .An Edwin Groothuis Aq edwin@FreeBSD.org .