Angular ui-router - curly braces, etc. in url

I was looking for a way to have curly braces {} and slashes / in the URL. But the url is as follows:

 URL appearance now: http://localhost/#/?ph=tes:testes%2Ftest%7Blb0%7D URL wanted appearance: http://localhost/#/?ph=tes:tests/test{lb0} 

How to get url without% 2f etc.

Thanks in advance!

+1
angularjs angular-ui-router
source share
2 answers

All valid characters that can be used in a URI ( URL is a type of URI ) are defined in RFC 3986 .

All other characters can be used in the URL, provided that they are first "URL encoded". This includes changing an invalid character for certain β€œcodes” (usually in the form of a percent character (%) followed by a hexadecimal number).

This link, HTML URL Encoding Reference, contains a list of encodings for invalid characters.

Happy help!

+1
source share

These (% 2F,% 7B) are escape sequences. They represent special characters that are in your URL, as the URL cannot contain that character directly.

Where do you want to process this URL exactly?

You can use Javascript unescape(url) to return the escaped URL string to the original if you intend to process it in Javascript itself.

0
source share

All Articles