#include	<stdio.h>
#include	"code.h"

extern	int
main(
	int		argc,
	char	**argv)
{	STREAM	*is
	,		*os;
	Char	c;

	CodeInit(ENCODE_ISO2022);
#if	0
	is = CodeOpenString("koreha 漢字wo含んでいますkara douなるkaな");
#endif
	is = CodeOpenFile(argv[1],"r");
	os = CodeMakeFileStream(stdout);
	CodeSetEncode(os,ENCODE_ISO2022_);
	CodeSetEncode(is,ENCODE_ISO2022);
	while	(  ( c = CodeGetChar(is) )  !=  Char_EOF  )	{
		CodePutChar(os,c);
	}
	CodeClose(is);
	CodeClose(os);
	exit(0);
}
