Java: detect control characters which are not correct for JSON

前端 未结 4 735
花落未央
花落未央 2021-02-07 11:11

I am reinventing the wheel and creating my own JSON parse methods in Java.

I am going by the (very nice!) documentation on json.org. The only part I am unsure about is w

4条回答
  •  借酒劲吻你
    2021-02-07 11:54

    Even if it's not very specific, I would assume that they refer to the "control" character category from the Unicode specification.

    In Java, you can check if a character c is a Unicode control character with the following expression: Character.getType(c) == Character.CONTROL.

提交回复
热议问题