String str = "不支持此城市!";
String son = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><root><weather city="
+ str
+ " time=\"2010-01-25\" ffcaddition=\"\" today=\"多云@高温5 ℃低温-13 ℃@风力微风 小于3 级\" tomorrow=\"多云@高温3 ℃低温-16 ℃@风力微风 小于3 级\" day-after-tomorrow=\"晴@高温5 ℃低温-13 ℃@风力微风 小于3 级\" /><wm_life content=\"\"/></root>";response.setContentLength(son.length()); //一定要
/*
*获取长度
*/用response写出去 不乱码  网页源文件 能查看到son 的内容。

解决方案 »

  1.   

    http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/16.gif
      

  2.   

    向请求者 发送一段XML 要求 指定 发送XML的长度 response.setContentLength(son.length()); 
      

  3.   

    参考java.net.Encoder类----ip围观党党员三十三号建议
      

  4.   

    转码 如new String(**.getBytes("utf-8"),"iso8859-1")什么格式 自己想想!
      

  5.   

    不用转码,直接在tomcat中设定 URIEncoding ="utf-8"或者你的工程编码方式即可