Rayleigh identify sensors with identifiers like “e2.freq”,“e2.i3p@1”,“e2.i3p@2”,“e2.i3p@3” so I decided to use “Rayleigh” as the node and keep those identifiers. My first attempt used the identifiers as is but the ‘@’ didn’t appear in emonCMS. My next attempt replaced the ‘@’ with ‘%40’ and used a URL like this:
It’s a question that’s come up before, and I don’t think I’ve ever seen a definitive list. As far as I’m aware, nothing outside the plain set of alpha-numerical characters is guaranteed to be acceptable.
If you search for “emonCMS characters”, there are a few historic comments/discussions, only one directly related as I can see - but still not all that helpful.
What you’ve run across is called percent-encoding.
The following characters are denoted as reserved, i.e. they have special meanings.
!#$&'()*+,/:;=?@[]
When a character from the reserved set (a “reserved character”) has a special meaning (a “reserved purpose”) in a certain context, and a URI scheme says that it is necessary to use that character for some other purpose, then the character must be percent-encoded.
Thanks for the replies. I’m not clear which characters would need to be escaped in the fulljson part of the URL.
According to RFC 8259, The JavaScript Object Notation (JSON) Data Interchange Format: A string begins and ends with quotation marks. All Unicode characters may be placed within the quotation marks, except for the characters that MUST be escaped: quotation mark, reverse solidus, and the control characters (U+0000through U+001F).
The ‘@’ character isn’t one that MUST be escaped within a JSON string (but it may be represented as “\u0040”).