java读取txt字符问题

来源:百度知道 编辑:UC知道 时间:2024/06/01 20:30:14
txt里有的数字总是跟其他的不一样
比一般的要大一点,圆润一点
我想把它们都便成一般的字符,请问该怎么转换呢?
二楼的程序试过了,还是不行
谁来帮帮我啊,很郁闷

import java.io.*;
public class ReadFile
{
public static void main(String[] args)
{
String path = "f://a.txt";
byte[] buff=new byte[1024];
int n;
FileInputStream fis=null;
try
{
fis=new FileInputStream(path);
while ((n=fis.read(buff))!=-1)
{
System.out.write(buff,0,n);
}
}
catch (FileNotFoundException e)
{
System.out.println("没有找到文件");
System.exit(1);
}
catch(IOException e)
{
System.out.println("");
}
finally
{
try
{
fis.close();
}
catch (IOException e)
{
System.out.println("文件错误");
System.exit(1);
}
}

}
};
试一试

半角和全角的关系吧,跟你的输入法有关的.
alt+shief键就是切换半角和全角的.

你是想在源程序中读取,还是在编写源程序时改成英文字符?一楼的不错啊