FreeRDP
utf.c File Reference
#include "utf.h"
#include <winpr/endian.h>

Macros

#define UNI_SUR_HIGH_START   (DWORD)0xD800
 
#define UNI_SUR_HIGH_END   (DWORD)0xDBFF
 
#define UNI_SUR_LOW_START   (DWORD)0xDC00
 
#define UNI_SUR_LOW_END   (DWORD)0xDFFF
 

Functions

ConversionResult ConvertUTF32toUTF16 (const DWORD **sourceStart, const DWORD *sourceEnd, WCHAR **targetStart, WCHAR *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF16toUTF32 (const WCHAR **sourceStart, const WCHAR *sourceEnd, DWORD **targetStart, DWORD *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF16toUTF8 (const WCHAR **sourceStart, const WCHAR *sourceEnd, BYTE **targetStart, BYTE *targetEnd, ConversionFlags flags)
 
static BOOL isLegalUTF8 (const BYTE *source, int length)
 
BOOL isLegalUTF8Sequence (const BYTE *source, const BYTE *sourceEnd)
 
ConversionResult ConvertUTF8toUTF16 (const BYTE **sourceStart, const BYTE *sourceEnd, WCHAR **targetStart, WCHAR *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF32toUTF8 (const DWORD **sourceStart, const DWORD *sourceEnd, BYTE **targetStart, BYTE *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF8toUTF32 (const BYTE **sourceStart, const BYTE *sourceEnd, DWORD **targetStart, DWORD *targetEnd, ConversionFlags flags)
 

Variables

static const int halfShift = 10
 
static const DWORD halfBase = 0x0010000UL
 
static const DWORD halfMask = 0x3FFUL
 
static const char trailingBytesForUTF8 [256]
 
static const DWORD offsetsFromUTF8 [6]
 
static const BYTE firstByteMark [7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }
 

Macro Definition Documentation

#define UNI_SUR_HIGH_END   (DWORD)0xDBFF
#define UNI_SUR_HIGH_START   (DWORD)0xD800
#define UNI_SUR_LOW_END   (DWORD)0xDFFF
#define UNI_SUR_LOW_START   (DWORD)0xDC00

Function Documentation

ConversionResult ConvertUTF16toUTF32 ( const WCHAR **  sourceStart,
const WCHAR *  sourceEnd,
DWORD **  targetStart,
DWORD *  targetEnd,
ConversionFlags  flags 
)
ConversionResult ConvertUTF16toUTF8 ( const WCHAR **  sourceStart,
const WCHAR *  sourceEnd,
BYTE **  targetStart,
BYTE targetEnd,
ConversionFlags  flags 
)

Here is the caller graph for this function:

ConversionResult ConvertUTF32toUTF16 ( const DWORD **  sourceStart,
const DWORD *  sourceEnd,
WCHAR **  targetStart,
WCHAR *  targetEnd,
ConversionFlags  flags 
)
ConversionResult ConvertUTF32toUTF8 ( const DWORD **  sourceStart,
const DWORD *  sourceEnd,
BYTE **  targetStart,
BYTE targetEnd,
ConversionFlags  flags 
)
ConversionResult ConvertUTF8toUTF16 ( const BYTE **  sourceStart,
const BYTE sourceEnd,
WCHAR **  targetStart,
WCHAR *  targetEnd,
ConversionFlags  flags 
)

Here is the call graph for this function:

Here is the caller graph for this function:

ConversionResult ConvertUTF8toUTF32 ( const BYTE **  sourceStart,
const BYTE sourceEnd,
DWORD **  targetStart,
DWORD *  targetEnd,
ConversionFlags  flags 
)

Here is the call graph for this function:

static BOOL isLegalUTF8 ( const BYTE source,
int  length 
)
static

Here is the caller graph for this function:

BOOL isLegalUTF8Sequence ( const BYTE source,
const BYTE sourceEnd 
)

Here is the call graph for this function:

Variable Documentation

const BYTE firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }
static
const DWORD halfBase = 0x0010000UL
static
const DWORD halfMask = 0x3FFUL
static
const int halfShift = 10
static
const DWORD offsetsFromUTF8[6]
static
Initial value:
= { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
0x03C82080UL, 0xFA082080UL, 0x82082080UL
}
const char trailingBytesForUTF8[256]
static
Initial value:
=
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5
}