1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/**
@file uemf_utf.h
@brief Prototypes for functions that manipulate UTF and various types of text.
*/
/*
File: uemf_utf.h
Version: 0.0.1
Date: 04-DEC-2012
Author: David Mathog, Biology Division, Caltech
email: mathog@caltech.edu
Copyright: 2012 David Mathog and California Institute of Technology (Caltech)
*/
#ifndef _UEMF_UTF_
#define _UEMF_UTF_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <stdbool.h>
#include "uemf_endian.h"
void wchar8show(const char *src);
void wchar16show(const uint16_t *src);
void wchar32show(const uint32_t *src);
void wchartshow(const wchar_t *src);
size_t wchar16len(const uint16_t *src);
size_t wchar32len(const uint32_t *src);
void wchar16strncpy(uint16_t *dst, const uint16_t *src, size_t nchars);
void wchar16strncpypad(uint16_t *dst, const uint16_t *src, size_t nchars);
uint16_t *U_Utf8ToUtf16le( const char *src, size_t max, size_t *len );
uint32_t *U_Utf8ToUtf32le( const char *src, size_t max, size_t *len );
uint32_t *U_Latin1ToUtf32le( const char *src, size_t max, size_t *len );
uint16_t *U_Utf32leToUtf16le( const uint32_t *src, size_t max, size_t *len );
char *U_Utf32leToUtf8( const uint32_t *src, size_t max, size_t *len );
uint32_t *U_Utf16leToUtf32le( const uint16_t *src, size_t max, size_t *len );
char *U_Utf16leToUtf8( const uint16_t *src, size_t max, size_t *len );
char *U_Utf16leToLatin1( const uint16_t *src, size_t max, size_t *len );
char *U_Utf8ToLatin1( const char *src, size_t max, size_t *len );
char *U_Latin1ToUtf8( const char *src, size_t max, size_t *len );
uint16_t U_Utf16le(const uint16_t src);
int U_Utf16leEdit( uint16_t *src, uint16_t find, uint16_t replace );
char *U_strdup(const char *s);
#ifdef __cplusplus
}
#endif
#endif /* _UEMF_UTF_ */
|