Home > front end >  Url decoding problem
Url decoding problem

Time:10-02

There is a problem I open a web page with a url the following images (because there is a special symbol url or something so automatic coding)


Then I copy the encoded url to the Google browser address, he would become a normal link below


I guess try Google have automatic decoding so that show

But he and me to copy paste the code should be copied or that no decoding so or so before

Although can normal open the page but we can work it out this string of garbage into normal? (tried on the Google browser address bar to separate copy can be together but not a copy)
https://www.amazon.co.jp/%E3%80%902019%E6%9C%80%E6%96%B0%E7%89%88%E3%80%91-%E3%82%B2%E3%83%BC%E3%83%9F%E3%83%B3%E3%82%B0%E3%83%98%E3%83%83%E3%83%89%E3%82%BB%E3%83%83%E3%83%88-G7500-%E3%83%8E%E3%82%A4%E3%82%BA%E3%82%AD%E3%83%A3%E3%83%B3%E3%82%BB%E3%83%AA%E3%83%B3%E3%82%B0-PC%E7%94%A8%E3%83%98%E3%83%83%E3%83%89%E3%82%BB%E3%83%83%E3%83%88/dp/B07QWKBXFP

CodePudding user response:

Use decodeURI decoding () function

CodePudding user response:

decodeURI
(' https://www.amazon.co.jp/%E3%80%902019%E6%9C%80%E6%96%B0%E7%89%88%E3%80%91-%E3%82%B2%E3%83%BC%E3%83%9F%E3%83%B3%E3%82%B0%E3%83%98%E3%83%83%E3%83%89%E3%82%BB%E3%83%83%E3%83%88-G7500-%E3%83%8E%E3%82%A4%E3%82%BA%E3%82%AD%E3%83%A3%E3%83%B3%E3%82%BB%E3%83%AA%E3%83%B3%E3%82%B0-PC%E7%94%A8%E3%83%98%E3%83%83%E3%83%89%E3%82%BB%E3%83%83%E3%83%88/dp/B07QWKBXFP ')
"Https://www.amazon.co.jp/[2019 latest edition] - ゲ ー ミ ン グ ヘ ッ ド セ ッ ト G7500 - ノ イ ズ キ ャ ン セ リ ン グ - PC with ヘ ッ ド セ ッ ト/dp/B07QWKBXFP"
  • Related