Difference between “+” and “%A0” - urlencoding?

大城市里の小女人 提交于 2019-11-29 13:43:37

%A0 indicates a NBSP (U+00A0). + indicates a normal space (U+0020). The NBSP displays as a replacement character (U+FFFD) because the encoding of the character does not match the encoding of the page, so its byte sequence is not valid for the page.

A quick Googling shows that %A0 is the non-breaking space character or   in html. A + is the form-encoding for a standard space character.

Source

The problem you're having is that the second "space" is not really a space, it's a character that that font doesn't have a glyph (I think that's the term) to represent (hence the black box with the question mark). %A0 is the escape code for that character. Your code is technically handling it correctly, I think the problem is with whatever is generating the string in the first place.

If I refer to the chart on this page, %A0 is not a space. %20 is the space caracter's encoded value.

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