A string is a sequence of Unicode code points wrapped with quotation marks(U+0022). All characters may be placed within the quotation marks except for the
characters that must be escaped: quotation mark (U+0022), reverse solidus(U+005C), and the control characters U+0000 to U+001F. There are two-character
escape sequence representations of some characters.
所以你不能直接传递0x0A或0x0C编码。这是被禁止的!规格建议使用的转义序列用于从一些明确定义的代码U+0000来U+001F:\f represents the form feed character (U+000C). \n represents the line feed character (U+000A).
由于大多数编程语言都\用于引用,你应该转义转义语法(双转义 - 一次用于语言/平台,一次用于Json本身):jsonStr = "{ \"name\": \"Multi\\nline.\" }";