# List of characters that must be escaped?

**URL:** <https://discuss.elastic.co/t/list-of-characters-that-must-be-escaped/159613>\
**Category:** Elasticsearch\
**Created:** [December 5, 2018, 10:27pm UTC](https://discuss.elastic.co/t/list-of-characters-that-must-be-escaped/159613 "2018-12-05T22:27:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Allan](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Matthew\_Allan](https://discuss.elastic.co/u/Matthew_Allan)\
**Post date:** [December 5, 2018, 10:27pm UTC](https://discuss.elastic.co/t/list-of-characters-that-must-be-escaped/159613/1 "2018-12-05T22:27:11Z")

</div>

Hello,

While indexing some user provided content I have come across some unicode characters that cannot be indexed without escaping them first. For example:

```
DELETE /my_index

PUT /my_index
{
  "mappings": {
    "thing": {
      "properties": {
        "content": {
          "type": "text"
        }
      }
    }
  }
}

POST /my_index/thing/1
{
  "content": "hello "
}

```

This results in the following error on 5.6:

```
{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "failed to parse [content]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse [content]",
    "caused_by": {
      "type": "json_parse_exception",
      "reason": "Illegal unquoted character ((CTRL-CHAR, code 9)): has to be escaped using backslash to be included in string value\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@6a67109; line: 2, column: 22]"
    }
  },
  "status": 400
}

```

The example above is using the unicode character [Information Separator Three](http://www.fileformat.info/info/unicode/char/001d/index.htm). Is there a list anywhere of which characters must be escaped before indexing? It doesn't seen to include entire unicode 'other, control character' as I can index [U+0080](http://www.fileformat.info/info/unicode/char/0080/index.htm) without issue.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 2, 2019, 10:27pm UTC](https://discuss.elastic.co/t/list-of-characters-that-must-be-escaped/159613/2 "2019-01-02T22:27:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
