---
title: "文本文件编码转换"
author: "ddh9504"
date: "2011-08-18T15:50:29Z"
tags: ["Java", "TXT", "convert"]
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2011-08-18T15:50:29Z"
id: 1152482
url: "https://ddh9504.iteye.com/blog/1152482"
---

public class ExecuteConvertFileTest    
{    
    public static void main (String\[] args)    
    {    
        ExecuteConvertFile execute = new ExecuteConvertFileImpl();    
        // 目录    
        String inFilename = "c:/cn.txt";         
        String outFilename = "c:/cn.txt";    
        String encoding = "UTF-8";    
        try   
        {    
            execute.executeConvertFile(inFilename, outFilename, encoding);    
        }    
        catch (FileNotFoundException e)    
        {    
            e.printStackTrace();    
        }    
        catch (IOException e)    
        {    
            e.printStackTrace();    
        }    
    }    
        
} 

 

 

附件是需要引用的jar