Why can't I detect a wifi SSID with unicode ch

2019-07-15 07:40发布

I have a wifi AP with an SSID that's a string of unicode characters (ex: "ԱԲԳԴԵԶԷԸԹԺԻԼ") that I want my Android device to connect to. When my device (Nexus One) detects the hotspot, the SSID looks like this: "܍܍܍܍܍܍܍܍" and does not recognize it. Any idea how to fix this?

2条回答
三岁会撩人
2楼-- · 2019-07-15 07:55

I've wrote an app "WiFi Connection Manager" to fix this problem. However, I don't understand any Armenian, so that the result may not be displayed correctly. You can still connect to the Access Point even if the names are displayed incorrectly with my app.

You may find it in the Android Market.

Or you can download it here.

查看更多
混吃等死
3楼-- · 2019-07-15 07:59

The SSID field in a 802.11 packet has 32 bytes. I believe that Android devices (as well as other devices) choose to interpret each byte as an individual character (this is probably also part of the 802.11 standard). This is why SSIDs are limited to 32 characters.

Now since we only use a single byte to represent each character, we only have 8 bits to use. Using a two's complement system (probably used) the highest number we can represent is 127 (2 ^ (8-1)).

Standard ASCII characters can be represented with a single byte, each corresponding to a decimal value between 0 and 127. Unicode characters on the other hand, require anywhere from 1 to 4 bytes to represent. Thus if the 802.11 specification was modified to include 4 byte Unicode characters in the SSID field, you'd only be able to use a maximum of 8 characters in your SSID. I guess somewhere along the line someone decided to favour 32 characters from a smaller pool, over 8 characters from a larger pool.

You could possibly get around this by writing a custom driver on the device to interpret the 32 byte SSID field as Unicode characters, but I wouldn't recommend it.

As mentioned in the comments, Unicode characters can be encoded as UTF-8 so my earlier answer is not valid.

查看更多
登录 后发表回答