0

How can I configure /etc/wpa_supplicant/wpa_supplicant.conf to connect to a network that has an accent in its SSID? The name of the network is of form Réseau de XL1.

If I use sudo iwlist wlan0 scan|grep SSID I see the network appears as:

ESSID:"R\xC3\xA9seau de MP1"

At the moment I have the following the wpa_supplicant file (actual values modified):

network={
        ssid="Réseau de XL1"
        psk="!reseau_2014!"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        auth_alg=OPEN
}

Checking the encoding of '\xC3\xA9' this suggests it is a UTF8 representation of 'é', but I am not sure if wpa_supplicant is interpreting it as UTF8?

4
  • 1
    You can code an ssid as a hex string. ssid=52C3A973656175206465204D5031 no quotes.
    – Dougie
    Sep 16, 2019 at 15:44
  • Interesting. How would I get the ssid as a hex string?
    – Andre M
    Sep 16, 2019 at 15:49
  • I converted that string from your iw list command with od and after echoing it into a file with hexedit.
    – Dougie
    Sep 16, 2019 at 15:52
  • google ascii to hex converter
    – jsotola
    Sep 16, 2019 at 18:22

2 Answers 2

2

You should be able to code it in hex as

ssid=52C3A973656175206465204D5031

You can generate the hex value with echo "Réseau de XL1" | xxd -p | tr a-z A-Z

2
  • Should probably clarify how to generate the hex. For example: echo "Réseau de XL1" | xxd -p | tr a-z A-Z, paying attention to the resultant values, since in one instance I did get an issue due to UTF-8 combining characters.
    – Andre M
    Sep 16, 2019 at 16:06
  • This iwlist wlan0 scan | awk -F"\"" '/ESSID:/ {print $2}' | xxd -p | tr a-z A-Z is the most automatic way to generate the hex ssid.
    – Dougie
    Sep 16, 2019 at 21:14
1

Just replying to myself following some testing.

  • Escaping the network name appears to work: R\xC3\xA9seau de MP1
  • In my local setup using hexdump -C I see the encoding is UTF8 (probably a side effect of using a UTF8 based terminal)
  • Also looking at the docs, for the network block, I see:
# ssid: SSID (mandatory); network name in one of the optional formats:
#   - an ASCII string with double quotation
#   - a hex string (two characters per octet of SSID)
#   - a printf-escaped ASCII string P"<escaped string>"

So I ended up with:

network={
        # ssid: Réseau de XL1
        ssid="R\xC3\xA9seau de XL1"
        psk="!reseau_2014!"
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        auth_alg=OPEN
}

Based on the docs I'll stick with the escaping, since that is probably safer in terms of various possible terminal encodings, even if UTF8 is likely predominate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.