String aPath;
String encoding;
File m_file=new File(aPath);
InputStreamReader is= new InputStreamReader(new FileInputStream(m_file),encoding);
在前三句的基础上,第四句这样表述正确吗?此处的encoding是什么类型的变量或是哪个类的对象?它的取值范围是什么?

解决方案 »

  1.   

    encoding是字符编码格式,inputstreamReader是一个将byte流按照各种编码格式转换成字符(char)流的工具。encoding的取值范围为:US-ASCII  Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set 
    ISO-8859-1   ISO Latin Alphabet No. 1, a.k.a. ISO-LATIN-1 
    UTF-8  Eight-bit UCS Transformation Format 
    UTF-16BE Sixteen-bit UCS Transformation Format, big-endian byte order 
    UTF-16LE Sixteen-bit UCS Transformation Format, little-endian byte order 
    UTF-16 Sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order