如果是jsp,这没有什么好奇怪的,©本来就是(c)
解决方案 »
- oracle问题 在线等
- 一个简单问题。
- 谢谢大侠们的帮助,小女子有理了!!!!!!!!
- return的问题
- 使用java的cp功能出现如下错误
- 跪求Hibernate数据保存
- 自动登陆VPN的java程序怎么写?
- java 问题 什么 10 进制
- 怎样在applet中,用键盘中的“delete”删除我选中的对象(用鼠标点击选中),比如可活动的图片、箭头。
- 配置问题,请教了*************************************************
- 我是初学者,希望好心人帮我解决一个很菜的问题!
- 请教一下,怎样在Java命令行输出汉字?怎样在JBuilder中写入汉字??
public static void main(String args[]) throws IOException {
String s = "This is a © copyright symbol " +
"but this is © not.\n";
byte buf[] = s.getBytes();
ByteArrayInputStream in = new ByteArrayInputStream(buf);
BufferedInputStream f = new BufferedInputStream(in);
int c;
boolean ed = false; while ((c = f.read()) != -1) {
switch(c) {
case '&':
if (!ed) {
//f.(32);
ed = true;
} else {
ed = false;
}
break;
case ';':
if (ed) {
ed = false;
System.out.print("(c)");
} else
System.out.print((char) c);
break;
case ' ':
if (ed) {
ed = false;
//f.reset();
System.out.print("(c)");
} else
System.out.print((char) c);
break;
default:
if (!ed)
System.out.print((char) c);
break;
}
}
}
}
而后一个是©注意,后一个没有分号,这就是楼主的源程序中第二个©没有被替换的原因程序中用借助于变量用空格来处理