In my home network I have a service with the name "Den TV" with a space between "Den" and "TV".
When I resolve this service using NSD Manager on my mobile, I get the service name using NsdServiceInfo.getServiceName() and log it. I also create an object that wraps the NsdServiceInfo object and add it to an ArrayAdapter for a ListView.
Both the log message and the list view display the string "Den\\032TV". It looks like the space has been substituted with a "substitute" character (value 26 or octal 032), and that the string has then been escaped to "Den\032TV" and then further escaped to "Den\\032TV".
To me this is really bizarre behaviour. Why is NSD Manager not returning the string "as is". Avahi has no problems with it. And even if the space is being substituted for some reason I cannot fathom, why is then being escaped? Twice?
Also note that the space character has value 32, so that maybe it's not an octal value, but then why the preceding "0"?
Can anyone help me figure out how to get the real value?
According to http://www.ietf.org/rfc/rfc6763.txt.
Note that nslookup escapes spaces as "\032" for display purposes, but a graphical DNS-SD browser should not.
so "\032" is no java escape character and protocol specific.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With