Tatsh NFO Viewer 0.2.0
A simple NFO viewer.
Loading...
Searching...
No Matches
cp437.h File Reference
#include <stddef.h>
Include dependency graph for cp437.h:

Go to the source code of this file.

Functions

char * cp437_to_utf8 (const unsigned char *input, size_t length)

Function Documentation

◆ cp437_to_utf8()

char * cp437_to_utf8 ( const unsigned char * input,
size_t length )

Decode an IBM437 (CP437) encoded byte buffer into a newly allocated, NUL-terminated UTF-8 string.

Every CP437 byte maps to a single Unicode code point in the Basic Multilingual Plane, so each input byte expands to at most three UTF-8 bytes.

Parameters
inputPointer to the CP437 bytes. May be NULL only when length is 0.
lengthNumber of bytes to read from input.
Returns
A heap-allocated UTF-8 string that the caller must release with free(), or NULL if allocation fails.