It's all about the answers!

Ask a question

REST API returen comments with &nbsp

Jia Jia Li (8058157192) | asked Jul 19 '16, 3:16 a.m.
Hi, with the following REST API to get comments of one workitem, if the comments has Chinese, the blank space returns with &nbsp. I think other special characters also will be transferred. If the comments only contain English, the black space shows well, not as &nbsp.


This will introduce more work to deal with the return data from REST API. I want to know why this occur, and is there a way or REST API attribute to get Chinese comments without escaping?

One answer

permanent link
Donald Nong (14.5k614) | answered Jul 20 '16, 12:13 a.m.
They are different spaces, one is "non-breaking space", and the other normal "white space". Their codes (in any encoding) are different. Also note that when you use different Chinese input methods to type the "non-breaking space" (全角空格), the codes for the "non-breaking space" can be very different.

As for not escaping the special characters, I don't think it's a good idea since the content has to conform to certain specification.

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.