google / eddystone

Specification for Eddystone, an open beacon format from Google
Apache License 2.0
3.08k stars 762 forks source link

Is it possible to add country codes e.g. .au to an Eddystone URL frame? #201

Closed RussM4120 closed 7 years ago

RussM4120 commented 7 years ago

Is it possible to add country codes e.g. .au to an Eddystone URL frame? An example would be: https://google.com.au This would code as: 0x01, 0x67, 0x6F, 0x6F, 0x67, 0x6C, 0x65, 0x07, 0x2E, 0x61, 0x75 If this would be correct, what would we need to use as a termination character?

scottjenson commented 7 years ago

The compression codes, like the one you used for '.com' are entirely optional and can be used anywhere. There is no need for a termination character. Your URL as you've specified it is valid.

RussM4120 commented 7 years ago

Scott, thanks for that, I sometimes take things too literally. I like the ability to use short readable URL’s with the multitude of .com/xxxxxx that it entails with the full gambit of printable characters (90+) options for each subsequent character after the ‘/’. I've been an assembler type person since the late 1980's and am enjoying my sojourn into the amazing world of C++.

adriancretu commented 7 years ago

Actually for a short URL path segment, you can only use exactly 79 ASCII characters. Many of the rest (especially "[" and "]") are reserved by RFC 3986, while anything remaining is by definition forbidden (even if only for stupid historical reasons that don't apply anymore like "some transport agents modify these" or "can cause confusion while printing"), and as such bunch of strict languages (Java, Python) will follow the spec and throw exceptions when trying to ingest malformed URLs, making them impossible to use in practice.

RussM4120 commented 7 years ago

Adrian, thanks for that update.