#include <dk.h>
#include <dktypes.h>
Go to the source code of this file.
Functions | |
unsigned char * | dkcp_open (dk_stream_t *s) |
Open codepage structure, read data from stream. | |
unsigned char | dkcp_convert (unsigned char *p, unsigned char c) |
Convert one character. | |
void | dkcp_fputs (FILE *o, unsigned char *p, char *s) |
Write string to file, do codepage conversions if necessary. |
A codepage is a table of 256 unsigned bytes used for byte replacements. On Windows systems the same text when printed to command prompt box looks differently than printed to file and viewed in a text editor. We can get both texts look equally applying codepage replacements before printing the texts.
unsigned char dkcp_convert | ( | unsigned char * | p, | |
unsigned char | c | |||
) |
Convert one character.
p | Pointer to the codepage structure. | |
c | Character to convert. |
void dkcp_fputs | ( | FILE * | o, | |
unsigned char * | p, | |||
char * | s | |||
) |
Write string to file, do codepage conversions if necessary.
o | Output file. | |
p | Pointer to codepage structure. | |
s | String to write. |
unsigned char* dkcp_open | ( | dk_stream_t * | s | ) |
Open codepage structure, read data from stream.
The codepage structure is created in dynamically allocated memory, use dk_delete() to release the memory.
s | Stream to read codepage from. |