Duplicate :
|
Create a text file containing some invalid chinese characters. And then open and read it with FileReader class in zh_CN, zh_CN.GBK, zh_CN,UTF-8 and zh_CN.GB18030 locale. in zh_CN,zh_CN.GBK, zh_CN.UTF-8 locale, the read method will not throw exception and the invalid chinese character is replaced with white space. in zh_CN.GB18030 locale, the read() method will throw out MalformedException when reading the invalid ml character.
|