According to documentation of the getSSID
method:
Returns the service set identifier (SSID) of the current 802.11 network. If the SSID can be decoded as UTF-8, it will be returned surrounded by double quotation marks. Otherwise, it is returned as a string of hex digits. The SSID may be {@code null} if there is no network currently connected.
Source code of this method does somewhat conform to the documentation (except of null
case), so I won't attach it here as a code snippet, but here it is for API 21.
It seems I can just remove double codes, but according to this SO question, getSSID()
method of WifiInfo
it can be said that implementation can vary between android versions.
Casual sources about SSID mention that it is alphanumeric, but I found a controversial statement: according to this source, SSID can contain double quotes, so it is a valid character.
As a result, UTF-8 encoded SSID can either be wrapped with double quotes or not to be.
Question: is here a reliable way to identify if SSID contain double quotes at both the end and the start, or it comes from android's getSSID
implementation?