twitter intent share japanese text not working in IE11

时间:2019-04-08 13:21:56

标签: javascript vue.js twitter twitter-share

I have a simple share button by which twitter share url & text

https://twitter.com/intent/tweet?text=ドキドキしたい15才】 さんにおすすめのマンガは 「トレース 科捜研法医研究員の追想」 あなたも診断してみる? ⇒ &hashtags=hello&url=encodeURIComponent('https://google.com')

This is working in every browser but when IE11 its not working. Showing 400 bad request. Can anybody help me.

enter image description here

Sometimes not show 400 bad request but japanese text showing as question mark

When I open this URL into chrome then it works, after that if I copy this URL from Chrome then also work in IE but direct URL not works. Perhaps URL encoding issue. please help

2 个答案:

答案 0 :(得分:0)

you need to %-Encode your URL to UTF8. IE 11 does not do this. Here's a relevant SO question:
Why Internet Explorer doesn't url-encode the urls?

答案 1 :(得分:0)

最后,此问题已解决。我也编码了类似URL的文本,并且它也可以在IE11中使用。所以我像下面这样使用encodeURIComponent('Japanese text')然后工作

https://twitter.com/intent/tweet?text=encodeURIComponent('ドキドキしたい15才】 さんにおすすめのマンガは 「トレース 科捜研法医研究員の追想」 あなたも診断してみる? ⇒')&hashtags=hello&url=encodeURIComponent('https://google.com')