Transmitting newline character "\n"

UrlHtml EntitiesHtml Encode

Url Problem Overview


Given the following URL (working, try it!)

> https://select-test.wp3.rbsworldpay.com/wcc/purchase?instId=151711&cartId=28524&currency=GBP&amount=1401.49&testMode=100&name=Tom%20Gul&address=24%20House%20Road\nSome > Place\nCounty&postcode=TR33%20999&email=[email protected]&country=GB

If you click on the link and go through to the payment page, the address in the address box is not displaying properly, the newline characters are displaying as text.

I've tried passing through <br />'s but no luck, anyone got any ideas? I need to get the address to display with newlines.

Commas are OK as a separator but i would much prefer being able to have newlines. Thanks for any help! A working example will be the accepted answer.

Url Solutions


Solution 1 - Url

Try using %0A in the URL, just like you've used %20 instead of the space character.

Solution 2 - Url

Try to replace the \n with %0A just like you have spaces replaced with %20.

Solution 3 - Url

Use %0A (URL encoding) instead of \n (C encoding).

Solution 4 - Url

late to the party, but if anyone comes across this, javascript has a encodeURI method

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTom GullenView Question on Stackoverflow
Solution 1 - UrlrhinoView Answer on Stackoverflow
Solution 2 - UrleumiroView Answer on Stackoverflow
Solution 3 - UrlDarkDustView Answer on Stackoverflow
Solution 4 - Urlmarisbest2View Answer on Stackoverflow