-/* mconv.c -- Code converter.
+/* mconv.c -- Code converter. -*- coding: euc-jp; -*-
Copyright (C) 2003, 2004
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H15PRO112
You should have received a copy of the GNU Lesser General Public
License along with the m17n library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
02111-1307, USA. */
/***en
- @page mconv convert file code
+ @enpage m17n-conv convert file code
- @section mconv-synopsis SYNOPSIS
+ @section m17n-conv-synopsis SYNOPSIS
- mconv [ OPTION ... ] [ INFILE [ OUTFILE ] ]
+ m17n-conv [ OPTION ... ] [ INFILE [ OUTFILE ] ]
- @section mconv-description DESCRIPTION
+ @section m17n-conv-description DESCRIPTION
Convert encoding of given files from one to another.
</ul>
*/
+/***ja
+ @japage m17n-conv ¥Õ¥¡¥¤¥ë¤Î¥³¡¼¥É¤òÊÑ´¹¤¹¤ë
+
+ @section m17n-conv-synopsis SYNOPSIS
+
+ m17n-conv [ OPTION ... ] [ INFILE [ OUTFILE ] ]
+
+ @section m17n-conv-description ÀâÌÀ
+
+ Í¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥³¡¼¥É¤òÊ̤Τâ¤Î¤ËÊÑ´¹¤¹¤ë¡£
+
+ INFILE ¤¬¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï¡¢É¸½àÆþÎϤ«¤é¤È¤ë¡£OUTFILE ¤¬¾Êά¤µ¤ì¤¿
+ ¾ì¹ç¤Ï¡¢É¸½à½ÐÎϤؽñ¤½Ð¤¹¡£
+
+ °Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤¬ÍøÍѤǤ¤ë¡£
+
+ <ul>
+
+ <li> -f FROMCODE
+
+ FROMCODE ¤Ï INFILE ¤Î¥³¡¼¥É·Ï¤Ç¤¢¤ë¡£(¥Ç¥Õ¥©¥ë¥È¤Ï UTF-8)
+
+ <li> -t TOCODE
+
+ TOCODE ¤Ï OUTFILE ¤Î¥³¡¼¥É·Ï¤Ç¤¢¤ë¡£(¥Ç¥Õ¥©¥ë¥È¤Ï UTF-8)
+
+ <li> -k
+
+ ¥¨¥é¡¼¤ÇÊÑ´¹¤òÄä»ß¤·¤Ê¤¤¡£
+
+ <li> -s
+
+ ·Ù¹ð¤òɽ¼¨¤·¤Ê¤¤¡£
+
+ <li> -v
+
+ ¿Ê¹Ô¾õ¶·¤òɽ¼¨¤¹¤ë¡£
+
+ <li> -l
+
+ ÍøÍѲÄǽ¤Ê¥³¡¼¥É·Ï¤òÎóµó¤¹¤ë¡£
+
+ <li> --version
+
+ ¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òɽ¼¨¤¹¤ë¡£
+
+ <li> -h, --help
+
+ ¤³¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£
+
+ </ul>
+*/
#ifndef FOR_DOXYGEN
#include <m17n.h>
#include <m17n-misc.h>
-#define VERSION "1.0"
+#define VERSION "1.3.4"
/* Print all coding system names. */
+int
+compare_coding_name (const void *elt1, const void *elt2)
+{
+ const MSymbol *n1 = elt1;
+ const MSymbol *n2 = elt2;
+
+ return strcmp (msymbol_name (*n1), msymbol_name (*n2));
+}
+
void
list_coding ()
{
int len, clm;
n = mconv_list_codings (&codings);
+ qsort (codings, n, sizeof (MSymbol), compare_coding_name);
clm = 0;
for (i = 0; i < n; i++)
{
help_exit (argv[0], 0);
else if (! strcmp (argv[i], "--version"))
{
- printf ("mconv (m17n library) %s\n", VERSION);
+ printf ("m17n-conv (m17n library) %s\n", VERSION);
printf ("Copyright (C) 2003 AIST, JAPAN\n");
exit (0);
}
/* Clear away. */
mconv_free_converter (converter);
+ fclose (in);
+ fclose (out);
m17n_object_unref (mt);
M17N_FINI ();
exit (0);