UTF-8 string delimiter

前端 未结 3 1307
悲&欢浪女
悲&欢浪女 2021-01-21 00:30

I am parsing a binary protocol which has UTF-8 strings interspersed among raw bytes. This particular protocol prefaces each UTF-8 string with a short (two bytes) indicating the

3条回答
  •  野性不改
    2021-01-21 00:52

    i would use a delimiter which starts with 0x11...... but if you send raw bytes you will have to exclude this delimiter from the data\messages processed ,this means that if there is a user input similar to that delimiter, you will have to convert it.

    if the user inputs any utf8 represented char you may simply send it as is.

提交回复
热议问题