javascript - Difference between breaking and non breaking space ascii characters -


i have 2 identical strings in javascript spaces. when printed ascii values using str.charcodeat(n) showing values 32 , 160. googled values , showing me breaking , non breaking spaces. can explain behaviour.

the difference between normal (breaking) space , non-breaking space text display , typesetting software should not insert automatic line break in place of non-breaking space. (it if non-breaking space joins words before , after unsplittable word.) contrast, regular space treated possible place break line.

having said that, code 160 outside of range of regular (7-bit) ascii. interpretation of 160 non-breaking space (or nbsp) character comes latin1 (iso8859-1) character set. (in extended ascii, code nbsp character 255!)

references:


Comments