Why can't I detect a wifi SSID with unicode characters on Android?

让人想犯罪 __ 提交于 2020-01-15 05:38:08

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/9831055/why-cant-i-detect-a-wifi-ssid-with-unicode-characters-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!