24

Is there anything wrong or problematic with including spaces as well as a plus symbol (for the international code) in a telephone link? Example:

<a href="tel:+46 000 00 00 00">+46 000 00 00 00</a>

(I replaced the actual number I want to use with 0s here)

drake035
  • 3,955
  • 41
  • 119
  • 229

2 Answers2

27

HTML is irrelevant here. A URL is a URL no matter where you put it.

The relevant spec says:

even though ITU-T E.123 [E.123] recommends the use of space characters as visual separators in printed telephone numbers, "tel" URIs MUST NOT use spaces in visual separators to avoid excessive escaping.

So "no".

Even if a space was allowed, the general rules for URLs would mean that you would have to replace it with %20 (hence the comment about excessive escaping).

Community
  • 1
  • 1
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
4

Yes it is incorrect to add spaces in telephone numbers on href, according to RFC 3966 (The tel URI for Telephone Numbers):

5.1.1. Separators in Phone Numbers

Phone numbers MAY contain visual separators. Visual separators ('visual-separator') merely aid readability and are not used for URI comparison or placing a call ... "tel" URIs MUST NOT use spaces in visual separators ...

As you can see, the RFC clearly states: "tel" URIs MUST NOT use spaces in visual separators.

Community
  • 1
  • 1
BenM
  • 52,573
  • 26
  • 113
  • 168
  • This is an older, but still relevant question and it's now 2020. Whether compliant with the spec not, a phone number with spaces formatted as a tel: link appears to work with Chrome. I expect the chrome dev team have coded this in, to allow for input errors, just as with certain other malformed html snippets. I have not tested with other modern browsers and it would be interesting know if this is the same. – MrPaulDriver Aug 19 '20 at 09:36