我有一個本地pdf,我嘗試通過該文件的路徑在iframe中加載此pdf。從url中加載一個帶有中文文件名的pdf
文件有一個名明星.pdf和路徑是這樣的: http://localhost:8080/path-here/明星.pdf
當我嘗試打開PDF文件時,瀏覽器做這個請求和失敗(404): http://localhost:8080/path-here/%E6%98%8E%E6%98%9F.pdf
只有包含中文字符的pdf纔會出現問題。
有什麼建議嗎?
PS:我正在使用javascript。
編輯:
例子:
//there's a http:// in front, I can't put more links in post
var url = 'localhost:8080/path-here/teste.pdf'
var url2 = 'localhost:8080/path-here/明星.pdf'
window.open(url,"_blank") //works fine
window.open(url2,"_blank") //fails
我看到'javascript'在你的問題標籤。你會顯示一些代碼嗎? –