blob: c709ecb8dfe2bd5a81d71c22770a9421ff06c619 [file] [log] [blame] [view]
## fi-0184: Unexpected control character {:#fi-0184}
String literals are not allowed to contain raw control characters (ASCII
characters from `0x00` to `0x1f`):
{% include "docs/reference/fidl/language/error-catalog/label/_bad.md" %}
```fidl
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/bad/fi-0184.noformat.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
Instead, use an escape sequence. In this case, `\t` is the right one:
{% include "docs/reference/fidl/language/error-catalog/label/_good.md" %}
```fidl
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0184-a.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
Alternatively, you can use a Unicode escape sequence. This works for any Unicode
code point:
{% include "docs/reference/fidl/language/error-catalog/label/_good.md" %}
```fidl
{% includecode gerrit_repo="fuchsia/fuchsia" gerrit_path="tools/fidl/fidlc/tests/fidl/good/fi-0184-b.test.fidl" exclude_regexp="\/\/ (Copyright 20|Use of|found in).*" %}
```
Raw control characters are not allowed in string literals because they are all
either whitespace or non-printable, so they would be confusing and hard to
notice if embedded directly in the FIDL source file.