This documentation is deprecated and will no longer be updated. Please use the official documentation at vanillapdf.readthedocs.io.
Vanilla.PDF  2.3.0
Cross-platform toolkit for creating and modifying PDF documents
Enumerations | Functions
c_text_string_encoding.h File Reference

Utilities for PDF text string encoding detection and PDFDocEncoding lookup. More...

#include "vanillapdf/c_export.h"
#include "vanillapdf/c_values.h"

Go to the source code of this file.

Enumerations

enum  TextStringEncodingType { TextStringEncodingType_Undefined = 0 , TextStringEncodingType_PDFDocEncoding , TextStringEncodingType_UTF16BE , TextStringEncodingType_UTF8 }
 Encoding types for PDF text strings (PDF spec 7.9.2.2). More...
 

Functions

error_type CALLING_CONVENTION TextStringEncoding_Detect (string_type data, size_type size, TextStringEncodingType *result)
 Detect the encoding of a PDF text string from its raw bytes.
 
error_type CALLING_CONVENTION TextStringEncoding_PDFDocEncodingByteToUnicode (uint8_t byte, uint32_t *codepoint)
 Map a single PDFDocEncoding byte to its Unicode code point.
 

Detailed Description

Utilities for PDF text string encoding detection and PDFDocEncoding lookup.

Enumeration Type Documentation

◆ TextStringEncodingType

Encoding types for PDF text strings (PDF spec 7.9.2.2).

PDF text strings can be encoded as PDFDocEncoding (no BOM), UTF-16BE (BOM 0xFEFF), or UTF-8 (BOM 0xEFBBBF).

Enumerator
TextStringEncodingType_PDFDocEncoding 

Single-byte encoding defined in PDF spec Table D.2. No byte order mark is present.

TextStringEncodingType_UTF16BE 

UTF-16 big-endian encoding. Indicated by byte order mark 0xFEFF at the start of the string.

TextStringEncodingType_UTF8 

UTF-8 encoding (PDF 2.0). Indicated by byte order mark 0xEFBBBF at the start of the string.