关于网友提出的HTTPSerivce中文问题的答复

HTTPService是支持中文的,你现在出现中文显示错误是topics.jsp的文件编码不正确引起的。把topics.jsp保存为UTF-8编码就都ok了。
效果图


Topic.mxml:

<?xml version="1.0" encoding="utf-8"?> 
<mx:Application width="800" height="600" xmlns:mx="http://www.macromedia.com/2003/mxml" initialize="xmlFeed.send()"> 
<mx:HTTPService id="xmlFeed" url="topics.jsp" resultFormat="xml"/> 
<mx:Tree id="blogTree" preferredWidth="250" heightFlex="1" dataProvider="{xmlFeed.result}"/> 
</mx:Application>

topics.jsp:
<
String str="<?xml version='1.0' encoding='utf-8'?>"
  str
+="<node>"
  str
+="   <node label='Macromedia'>"
  str
+="      <node label='我是中文' url='http://www.markme.com/cc/index.rdf'/>"
  str
+="      <node label='Christian Cantrell' url='http://www.markme.com/cantrell/index.rdf'/>"
  str
+="      <node label='Kevin Lynch' url='http://www.klynch.com/index.rdf'/>"
  str
+="      <node label='Mike Chambers' url='http://www.markme.com/mesh/index.rdf'/>"
  str
+="      <node label='John Dowdell' url='http://www.markme.com/jd/index.rdf'/>"
  str
+="  </node>"
  str
+="</node>"
%
> 
<%=str%>
posted @ 2004-09-08 11:42  dannyr|一个都不能少!  阅读(1066)  评论(0编辑  收藏  举报