> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# json.unescape

> 从 escaped string content 或 complete quoted JSON string literal 解码 JSON string escape sequences。输入会用 JSON string parser parse，而不是作为 full JSON document。

<div className="real-function-page">
  ```lua theme={null}
  json.unescape(text: string): string
  ```

  ## 参数

  <ParamField path={"text"} type={"string"} required>
    Escaped JSON string content，或 first and last bytes 为 quotes 的 complete quoted JSON string literal。function 使用 string type checking 读取此 argument。
  </ParamField>

  ## 返回值

  <ResponseField name={"text"} type={"string"}>
    Decoded string。Supported escapes 包括 "、\、/、\b、\f、\n、\r、\t，以及带 surrogate-pair handling 的 \uXXXX。Invalid escapes、unescaped control characters、unterminated strings，以及 quoted literal 后的 trailing characters 会抛出带 near-position suffix 的 Luau error。
  </ResponseField>

  ## 示例

  从 escaped content 或 quoted JSON string literal 解码 JSON string escapes。

  ```lua theme={null}
  local escaped = json.escape("Real Docs" .. string.char(10) .. "Docs")
  local restored = json.unescape(escaped)

  print(restored)
  ```
</div>
