特殊空格

ofstream fo("log");
 11     ucs_char_t ucs_buf[10];
 12     ucs_buf[0] = 0x61;
 13     ucs_buf[1] = 0x62;
 14     ucs_buf[2] = 0x65;
 15     ucs_buf[3] = 0xa0;
 16     ucs_buf[4] = 0x4d;
 17     ucs_buf[5] = 0x58;
 18     ucs_buf[6] = 0xa0;
 19     ucs_buf[7] = 0x6211;
 20     ucs_buf[8] = 0;
 21     char char_buf[20];
 22     ucs_uc_to_utf8_buf(char_buf, ucs_buf,20);
 23     string str(char_buf);
 24     cout << str <> tok) {
 33         cout << tok <

需要将普通空格(0x20)替换为特殊空格(0xa0),但是stringstream也不会处理这个特殊空格

output:

abe MX 我
stringstream
abe MX 我




你可能感兴趣的:(c++)