diff --git a/QRCoder/PayloadGenerator.cs b/QRCoder/PayloadGenerator.cs index c5df52fc..d3b83c13 100644 --- a/QRCoder/PayloadGenerator.cs +++ b/QRCoder/PayloadGenerator.cs @@ -29,12 +29,13 @@ public class WiFi : Payload /// Password of the WiFi network /// Authentification mode (WEP, WPA, WPA2) /// Set flag, if the WiFi network hides its SSID - public WiFi(string ssid, string password, Authentication authenticationMode, bool isHiddenSSID = false) + /// Set flag, if ssid/password is delivered as HEX string. Note: May not be supported on iOS devices. + public WiFi(string ssid, string password, Authentication authenticationMode, bool isHiddenSSID = false, bool escapeHexStrings = true) { this.ssid = EscapeInput(ssid); - this.ssid = isHexStyle(this.ssid) ? "\"" + this.ssid + "\"" : this.ssid; + this.ssid = escapeHexStrings && isHexStyle(this.ssid) ? "\"" + this.ssid + "\"" : this.ssid; this.password = EscapeInput(password); - this.password = isHexStyle(this.password) ? "\"" + this.password + "\"" : this.password; + this.password = escapeHexStrings && isHexStyle(this.password) ? "\"" + this.password + "\"" : this.password; this.authenticationMode = authenticationMode.ToString(); this.isHiddenSsid = isHiddenSSID; }