# PCDATA invalid Char value

Source: https://xmlvalid.com/errors/pcdata-invalid-char-value

> A control character that XML 1.0 does not allow.

Example message: `PCDATA invalid Char value 1`

## Why it happens

- Characters below U+0020 other than tab, newline and carriage return, often from a database field, a log line or a binary value written into XML.
- The value in the message is the character code: 1 is U+0001, 12 a form feed, 0 a NUL byte.

## How to fix it

- Remove the characters or replace them with a space when the XML is produced. They cannot be escaped: `&#1;` is not allowed in XML 1.0 either. Binary data belongs in Base64.

## Example that fails

```xml
<note>ab</note>
```

## Fixed

```xml
<note>a b</note>
```
