這很好,但是,當我用移動應用程式掃描二維碼時,結果是:

Notice that the URL itself contains for every space in the URL, but the result (after scanning the QR code) does not. This results in an unclickable URL. This behaviour is weird considering some QR code generators do include the in the URL after scanning, such as 
uj5u.com熱心網友回復:
首先嘗試將其正式編碼為 url:
$encodedmapsurl = "https://www.google.nl/maps/dir/De Aar 18, 8253 PN Dronten/De Lepelaar 12, 8251MT Dronten/De Lepelaar 1, 8251mt Dronten/De Aar 18, 8253 PN Dronten/";
$encodedmapsurl = urlencode($encodedmapsurl);
此外,然后嘗試在生成二維碼之前將編碼的 url 發送到 bitly 或類似的縮短器。
如果這仍然不起作用,在日本我經常會發現特殊字符會導致許多難以查找/修復的問題(例如,1 位“%”與 2 位“%”字符)。嘗試使用charset-source (和 charset-target) 引數。
uj5u.com熱心網友回復:
只編碼一次:
$map_url = 'https://www.google.nl/maps/dir/De Aar 18, 8253 PN Dronten, Netherlands/De Lepelaar 12, 8251 MT Dronten, Netherlands/De Lepelaar 1, 8251 MT Dronten, Netherlands/De Aar 18, 8253 PN Dronten, Netherlands/@52.5308376,5.7062268,14z/data=!3m1!4b1!4m25!4m24!1m5!1m1!1s0x47c62a8ab5ae23a5:0x44f1928143db42a1!2m2!1d5.7085273!2d52.5441879!1m5!1m1!1s0x47c62b202ae17a0f:0x1abd001f5225a013!2m2!1d5.7290961!2d52.5190013!1m5!1m1!1s0x47c62b202fc55b65:0x12f835f420fa2676!2m2!1d5.7298615!2d52.5194267!1m5!1m1!1s0x47c62a8ab5ae23a5:0x44f1928143db42a1!2m2!1d5.7085273!2d52.5441879';
$encoded_url = urlencode( $map_url );
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/438703.html
上一篇:Laravel地圖示記不顯示?
