---
name: "audit_value_needs_encoding"
section: "3"
platform: "linux"
package: "audit"
version: "4.2.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/audit_value_needs_encoding"
---

# audit\_value\_needs\_encoding(3)

check a string to see if it needs encoding

## NAME

audit\_value\_needs\_encoding - check a string to see if it needs encoding

## SYNOPSIS

```
#include <libaudit.h>
```

**int audit\_value\_needs\_encoding(const char \****str***, unsigned int** *size***);**

## DESCRIPTION

**audit\_value\_needs\_encoding**() checks *size* bytes from *str* to see if the value must be encoded before it is logged in an audit name/value field. Specifically, this function checks for a double-quote, any byte in the range 0x00 through 0x20, or any byte in the range 0x7F through 0xFF. The 0x00 through 0x20 range includes C0 control bytes and space.

*str* is the byte string to check. It does not have to be NUL-terminated and may contain embedded NUL bytes. *size* is the number of bytes to check from *str*. If *str* is NULL, encoding is not needed.

## RETURN VALUE

The return value if encoding is needed is 1. If not needed is 0.

## SEE ALSO

[**audit\_encode\_nv\_string**(3)](/audit_encode_nv_string/3.md), [**audit\_encode\_value**(3)](/audit_encode_value/3.md).

## AUTHOR

Steve Grubb
