How are URLs with right-to-left TLDs represented?

1.2k views Asked by At

I'm writing some Ruby code that does some text analysis on domain names. In looking at the list of valid TLDs, I see some that use right-to-left languages such as:

  • تونس.
  • سوريا.
  • السعودية.

Just looking at those TLDs alone shows that the dot (.) appears to the right instead of the left. If I came across a domain like this in the wild, how would the URL be structured? Specifically, a left-to-right URL is structured as:

<protocol>://[<user>:<pass>@]<host>:<port>/<path>[?<query>]

Additionally, the <host> portion above could be broken out to look like:

[<subdomain>.]<domain>.<tld>

(e.g. "foo.example.com")

What is the structure of a right-to-left language URL?

1

There are 1 answers

0
xsoh On BEST ANSWER

The short answer: the structure is the same.

For the dot, by default the system doesn't show the dot as right-to-left until there is string written before the symbol. So on your case when you deleted the domain the dot became as the first charterer and nothing before it, the system then showed as LTR charterer.

example:

As left-to-right string, for example when we have A[dot]B and when you deleted A it will become: [dot]B.

As right-to-left (such as Arabic) string, for example when we have B[dot]A and when you delete A it should print it like B[dot] but because the dot is the first charterer, the system will show the dot as left-to-right charterer. So it will be shown like [dot]B and what comes after B will be printed as right-to-left.

For the structure, the order of charterer doesn't care about the language direction, so When you Split نطاق.السعودية for example, you will find string[0] = "نطاق"//domain and string[1] = "السعودية"//TLD.