Is hyphen allowed in URL?

Is hyphen allowed in URL?

Consider using punctuation in your URLs. The URL http://www.example.com/green-dress.html is much more useful to us than http://www.example.com/greendress.html . We recommend that you use hyphens – instead of underscores _ in your URLs.

What is the sign for hyphen?

Alternatively known as a dash, subtract, negative, or minus sign, the hyphen ( – ) is a punctuation mark on the underscore key next to the “0” key on US keyboards.

Is Hyphen a special character?

A special character is a character that is not an alphabetic or numeric character. Punctuation marks and other symbols are examples of special characters….Keyboard special characters.

Key/symbol Explanation
– Hyphen, minus, or dash.
_ Underscore.
+ Plus.
= Equal.

Is it okay to use Unicode characters in URLs?

Unicode characters are forbidden as per the RFC on URLs (see here ). They would have to be percent encoded to be standards compliant. My main point, though, is serving the unencoded characters for the sole purpose of having nice-looking URLs, so percent encoding is out. All major browsers seem to be parsing those URLs okay no matter what…

Is the hyphen “-” encoded in JavaScript?

Trying to make a request using the angular js $resource but it is encoding the url for making a request. which is obviously not found because – is encoded to %C2%AD. Question:- So how could I prevent this and call to the above mentioned url ? That hyphen is not a U+002D HYPHEN MINUS “-“, it’s a U+00AD SOFT HYPHEN, which encodes to C2 AD in UTF-8.

How are Unicode code points encoded in UTF-8?

The Unicode code point U+00AD gets encoded to the byte sequence C2AD in the UTF-8 encoding. That’s how it works. Unicode code points don’t map directly to the same bytes in UTF-8.

Do you have to percent encode characters in URLs?

They would have to be percent encoded to be standards compliant. My main point, though, is serving the unencoded characters for the sole purpose of having nice-looking URLs, so percent encoding is out. All major browsers seem to be parsing those URLs okay no matter what the RFC says.