The nbsp
(non breaking space)'s binary format in utf-8 encoding is c2a0
.
Create a sample.txt this way :input it is a test
then ctrl+v+u a0
,then you get the sample test file.
xxd sample.txt
00000000: 6974 2069 7320 6120 7465 7374 c2a0 0a it is a test....
Now show the current encoding with set encoding
,it is encoding=utf-8
,i want to replace the nbsp
with none string,it make me confused that
:%s/\%uc2\%ua0//
"the above command can't replace nbsp with none string in utf-8 encoding
:%s/\%ua0//
"%s/\%ua0// can replace it
In utf-8 encoding why %s/\%ua0//
can replace nbsp with none string instead of %s/\%uc2\%ua0//
?