Difference between “+” and “

后端 未结 4 1817
礼貌的吻别
礼貌的吻别 2020-12-19 02:07

I am url encoding a string of text to pass along to a function. However, it encodes the second space in a double-space as \"%A0\". This means that when I decode the string

相关标签:
4条回答
  • 2020-12-19 02:20

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

    0 讨论(0)
  • 2020-12-19 02:23

    %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.

    0 讨论(0)
  • 2020-12-19 02:25

    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

    0 讨论(0)
  • 2020-12-19 02:36

    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.

    0 讨论(0)
提交回复
热议问题