2015-10-10 28 views
0
var urlRequest:URLRequest = new URLRequest("子系統.swf"); 
loader.load(urlRequest); 
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete); 

當我使用本機swf加載另一個swf時,一切正常。 但在我嵌入我的主SWF爲HTML,它報告錯誤:As3 urlrequest字符集

"NetworkError: 404 Not Found http://127.0.0.1:8020/huanmao/%D7%D3%CF%B5%CD%B3.swf" 

確實當 「子系統」 變成 「%D7%D3%CF%B5%CD%B3」 我不明白,我在UrlRequest中找不到任何字符集選項。如果我用英文名稱而不是中文,問題就消失了。 這是我的HTML字符集設置

http-equiv="Content-Type" content="text/html; charset=utf-8" 

我所有的文件以UTF-8進行編輯。

我真的很困惑。這個問題正在殺死我! 任何幫助將不勝感激!

+0

http://stackoverflow.com/questions/1794637/url-escaping-chinese-japanese-unicode-characters-for-internet-explorer和https://en.wikipedia.org/wiki/Internationalized_resource_identifier#兼容性 – SushiHangover

+0

謝謝克利福! –

回答

0

幾年前,我面臨同樣的問題。
如果您使用的是Tomcat,你的8020端口連接器添加這些屬性。(在server.xml中)

URIEncoding="UTF-8" 
useBodyEncodingForURI="true" 

這是我的設置。

<Connector port="8400" protocol="HTTP/1.1" 
       connectionTimeout="20000" 
       redirectPort="9400" 
       URIEncoding="UTF-8" 
       useBodyEncodingForURI="true" /> 
+0

謝謝。它現在工作!!!!!!!!!! –