Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to connect to a WLAN in case the SSID contains a '&' in its name #22

Open
jomanu85 opened this issue Oct 16, 2016 · 2 comments

Comments

@jomanu85
Copy link

I was trying to connect to my WLAN, which got an '&' in its name.... But it simply never worked...
After a while (was already getting my head around the Managed Wifi API) I got the Idea to try it with a SSID Name not containing any special characters... et voila, this worked.

So in order to get the Simple Wifi API to work also with more exotic SSIDs simply add a HttpUtility.HtmlEncode() around the name in ProfileFactory.cs.

string name = HttpUtility.HtmlEncode(Encoding.ASCII.GetString(network.dot11Ssid.SSID, 0, (int)network.dot11Ssid.SSIDLength));

Hope this is usefull to anybody :)

@k00ala
Copy link

k00ala commented Nov 12, 2016

THX, i had to include the namespace:
using System.Net;

And i used the class WebUtility because my application is no webapplication ;)
string name = WebUtility.HtmlEncode(Encoding.ASCII.GetString(network.dot11Ssid.SSID, 0, (int)network.dot11Ssid.SSIDLength));

@TheObliterator
Copy link

See #45. I opted to use SecurityElement.Escape as this only escapes XML affected characters.

However, I found escaping the ssid name on its own wasn't sufficient for more exotic SSIDs (even using full html entity encoding). To fix connection for those, I had to also include the hex key in the profile to connect to those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants