Java Exception

www.jexception.com

  • 增加字体大小
  • 预设字体大小
  • 减少字体大小
 

Flex读取外部XML中文乱码解决办法

 用URLLoader加载XML,然后将data转化为ByteArray

用byteArray.readMultiByte(bytes.length,"utf-8")

然后将转化后的字符串再强制转化为XML

 

var loader:URLLoader = new URLLoader();

loader.dataFormat = URLLoaderDataFormat.Binary;

var urlRequest:URLRequest = new URLRequest(source);

loader.addEventListener("complete",completeHandler);

loader.load(urlRequest);

 

private var completeHandler(evt:Event):void

{

     var bytes:ByteArray = ByteArray(evt.currentTarget.data);

     var xmlStr:String = bytes.readMultiByte(bytes.length,"utf-8");

     var xml:XML = XML(xmlStr);

     trace(xml);

 

本文转自:http://blog.csdn.net/jiabangok/archive/2009/02/25/3934334.aspx

评论 (2)
  • asdf  - sadf




    Another way in wow power leveling protecting yourself from credit card scams and frauds is to shred all the



    documents, emails, and wow power leveling other paperwork that contain credit card account information.



    You h******e to remember that wow power leveling when this information gets into the wrong hands,



    they can use this to purchase world of warcraft gold items in the internet using your account. This will



    surely give you so much financial best wow gold debts in the future. So that you can be sure that there are



    no suspicious or fraudulent cheapest wow gold activities going on with your credit card accounts.



发表评论
Your Contact Details:
评论:
[b] [i] [u] [url] [quote] [code] [img]   
:D:angry::angry-red::evil::idea::love::x:no-comments::ooo::pirate::?::(
:sleep::););)):0
Security
请输入图片上显示的验证码.