FreeRDP
TestUnicodeConversion.c File Reference
#include <stdio.h>
#include <winpr/crt.h>
#include <winpr/error.h>
#include <winpr/windows.h>

Functions

void string_hexdump (BYTE *data, int length)
 
int convert_utf8_to_utf16 (BYTE *lpMultiByteStr, BYTE *expected_lpWideCharStr, int expected_cchWideChar)
 
int convert_utf16_to_utf8 (BYTE *lpWideCharStr, BYTE *expected_lpMultiByteStr, int expected_cbMultiByte)
 
BOOL test_unicode_uppercasing (BYTE *lower, BYTE *upper)
 
BOOL test_ConvertFromUnicode_wrapper ()
 
BOOL test_ConvertToUnicode_wrapper ()
 
int TestUnicodeConversion (int argc, char *argv[])
 

Variables

static BYTE c_cedilla_UTF8 [] = "\xC3\xA7\x00"
 
static BYTE c_cedilla_UTF16 [] = "\xE7\x00\x00\x00"
 
static int c_cedilla_cchWideChar = 2
 
static int c_cedilla_cbMultiByte = 3
 
static BYTE en_Hello_UTF8 [] = "Hello\0"
 
static BYTE en_Hello_UTF16 [] = "\x48\x00\x65\x00\x6C\x00\x6C\x00\x6F\x00\x00\x00"
 
static int en_Hello_cchWideChar = 6
 
static int en_Hello_cbMultiByte = 6
 
static BYTE en_HowAreYou_UTF8 [] = "How are you?\0"
 
static BYTE en_HowAreYou_UTF16 []
 
static int en_HowAreYou_cchWideChar = 13
 
static int en_HowAreYou_cbMultiByte = 13
 
static BYTE fr_Hello_UTF8 [] = "Allo\0"
 
static BYTE fr_Hello_UTF16 [] = "\x41\x00\x6C\x00\x6C\x00\x6F\x00\x00\x00"
 
static int fr_Hello_cchWideChar = 5
 
static int fr_Hello_cbMultiByte = 5
 
static BYTE fr_HowAreYou_UTF8 [] = "\x43\x6F\x6D\x6D\x65\x6E\x74\x20\xC3\xA7\x61\x20\x76\x61\x3F\x00"
 
static BYTE fr_HowAreYou_UTF16 []
 
static int fr_HowAreYou_cchWideChar = 15
 
static int fr_HowAreYou_cbMultiByte = 16
 
static BYTE ru_Hello_UTF8 [] = "\xD0\x97\xD0\xB4\xD0\xBE\xD1\x80\xD0\xBE\xD0\xB2\xD0\xBE\x00"
 
static BYTE ru_Hello_UTF16 [] = "\x17\x04\x34\x04\x3E\x04\x40\x04\x3E\x04\x32\x04\x3E\x04\x00\x00"
 
static int ru_Hello_cchWideChar = 8
 
static int ru_Hello_cbMultiByte = 15
 
static BYTE ru_HowAreYou_UTF8 [] = "\xD0\x9A\xD0\xB0\xD0\xBA\x20\xD0\xB4\xD0\xB5\xD0\xBB\xD0\xB0\x3F\x00"
 
static BYTE ru_HowAreYou_UTF16 []
 
static int ru_HowAreYou_cchWideChar = 10
 
static int ru_HowAreYou_cbMultiByte = 17
 
static BYTE ar_Hello_UTF8 []
 
static BYTE ar_Hello_UTF16 []
 
static int ar_Hello_cchWideChar = 13
 
static int ar_Hello_cbMultiByte = 24
 
static BYTE ar_HowAreYou_UTF8 []
 
static BYTE ar_HowAreYou_UTF16 []
 
static int ar_HowAreYou_cchWideChar = 10
 
static int ar_HowAreYou_cbMultiByte = 18
 
static BYTE ch_Hello_UTF8 [] = "\xE4\xBD\xA0\xE5\xA5\xBD\x00"
 
static BYTE ch_Hello_UTF16 [] = "\x60\x4F\x7D\x59\x00\x00"
 
static int ch_Hello_cchWideChar = 3
 
static int ch_Hello_cbMultiByte = 7
 
static BYTE ch_HowAreYou_UTF8 [] = "\xE4\xBD\xA0\xE5\xA5\xBD\xE5\x90\x97\x00"
 
static BYTE ch_HowAreYou_UTF16 [] = "\x60\x4F\x7D\x59\x17\x54\x00\x00"
 
static int ch_HowAreYou_cchWideChar = 4
 
static int ch_HowAreYou_cbMultiByte = 10
 
static BYTE ru_Administrator_lower []
 
static BYTE ru_Administrator_upper []
 

Function Documentation

int convert_utf16_to_utf8 ( BYTE lpWideCharStr,
BYTE expected_lpMultiByteStr,
int  expected_cbMultiByte 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int convert_utf8_to_utf16 ( BYTE lpMultiByteStr,
BYTE expected_lpWideCharStr,
int  expected_cchWideChar 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void string_hexdump ( BYTE data,
int  length 
)

Here is the caller graph for this function:

BOOL test_ConvertFromUnicode_wrapper ( )

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL test_ConvertToUnicode_wrapper ( )

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL test_unicode_uppercasing ( BYTE lower,
BYTE upper 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int TestUnicodeConversion ( int  argc,
char *  argv[] 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int ar_Hello_cbMultiByte = 24
static
int ar_Hello_cchWideChar = 13
static
BYTE ar_Hello_UTF16[]
static
Initial value:
= "\x27\x06\x44\x06\x33\x06\x44\x06\x27\x06\x45\x06\x20\x00\x39\x06"
"\x44\x06\x4A\x06\x43\x06\x45\x06\x00\x00"
BYTE ar_Hello_UTF8[]
static
Initial value:
= "\xD8\xA7\xD9\x84\xD8\xB3\xD9\x84\xD8\xA7\xD9\x85\x20\xD8\xB9\xD9"
"\x84\xD9\x8A\xD9\x83\xD9\x85\x00"
int ar_HowAreYou_cbMultiByte = 18
static
int ar_HowAreYou_cchWideChar = 10
static
BYTE ar_HowAreYou_UTF16[]
static
Initial value:
= "\x43\x06\x4A\x06\x41\x06\x20\x00\x2D\x06\x27\x06\x44\x06\x43\x06"
"\x1F\x06\x00\x00"
BYTE ar_HowAreYou_UTF8[]
static
Initial value:
= "\xD9\x83\xD9\x8A\xD9\x81\x20\xD8\xAD\xD8\xA7\xD9\x84\xD9\x83\xD8"
"\x9F\x00"
int c_cedilla_cbMultiByte = 3
static
int c_cedilla_cchWideChar = 2
static
BYTE c_cedilla_UTF16[] = "\xE7\x00\x00\x00"
static
BYTE c_cedilla_UTF8[] = "\xC3\xA7\x00"
static
int ch_Hello_cbMultiByte = 7
static
int ch_Hello_cchWideChar = 3
static
BYTE ch_Hello_UTF16[] = "\x60\x4F\x7D\x59\x00\x00"
static
BYTE ch_Hello_UTF8[] = "\xE4\xBD\xA0\xE5\xA5\xBD\x00"
static
int ch_HowAreYou_cbMultiByte = 10
static
int ch_HowAreYou_cchWideChar = 4
static
BYTE ch_HowAreYou_UTF16[] = "\x60\x4F\x7D\x59\x17\x54\x00\x00"
static
BYTE ch_HowAreYou_UTF8[] = "\xE4\xBD\xA0\xE5\xA5\xBD\xE5\x90\x97\x00"
static
int en_Hello_cbMultiByte = 6
static
int en_Hello_cchWideChar = 6
static
BYTE en_Hello_UTF16[] = "\x48\x00\x65\x00\x6C\x00\x6C\x00\x6F\x00\x00\x00"
static
BYTE en_Hello_UTF8[] = "Hello\0"
static
int en_HowAreYou_cbMultiByte = 13
static
int en_HowAreYou_cchWideChar = 13
static
BYTE en_HowAreYou_UTF16[]
static
Initial value:
= "\x48\x00\x6F\x00\x77\x00\x20\x00\x61\x00\x72\x00\x65\x00\x20\x00"
"\x79\x00\x6F\x00\x75\x00\x3F\x00\x00\x00"
BYTE en_HowAreYou_UTF8[] = "How are you?\0"
static
int fr_Hello_cbMultiByte = 5
static
int fr_Hello_cchWideChar = 5
static
BYTE fr_Hello_UTF16[] = "\x41\x00\x6C\x00\x6C\x00\x6F\x00\x00\x00"
static
BYTE fr_Hello_UTF8[] = "Allo\0"
static
int fr_HowAreYou_cbMultiByte = 16
static
int fr_HowAreYou_cchWideChar = 15
static
BYTE fr_HowAreYou_UTF16[]
static
Initial value:
= "\x43\x00\x6F\x00\x6D\x00\x6D\x00\x65\x00\x6E\x00\x74\x00\x20\x00"
"\xE7\x00\x61\x00\x20\x00\x76\x00\x61\x00\x3F\x00\x00\x00"
BYTE fr_HowAreYou_UTF8[] = "\x43\x6F\x6D\x6D\x65\x6E\x74\x20\xC3\xA7\x61\x20\x76\x61\x3F\x00"
static
BYTE ru_Administrator_lower[]
static
Initial value:
=
"\xd0\x90\xd0\xb4\xd0\xbc\xd0\xb8\xd0\xbd\xd0\xb8\xd1\x81\xd1\x82\xd1\x80\xd0\xb0\xd1\x82\xd0\xbe\xd1\x80\x00"
BYTE ru_Administrator_upper[]
static
Initial value:
=
"\xd0\x90\xd0\x94\xd0\x9c\xd0\x98\xd0\x9d\xd0\x98\xd0\xa1\xd0\xa2\xd0\xa0\xd0\x90\xd0\xa2\xd0\x9e\xd0\xa0\x00"
int ru_Hello_cbMultiByte = 15
static
int ru_Hello_cchWideChar = 8
static
BYTE ru_Hello_UTF16[] = "\x17\x04\x34\x04\x3E\x04\x40\x04\x3E\x04\x32\x04\x3E\x04\x00\x00"
static
BYTE ru_Hello_UTF8[] = "\xD0\x97\xD0\xB4\xD0\xBE\xD1\x80\xD0\xBE\xD0\xB2\xD0\xBE\x00"
static
int ru_HowAreYou_cbMultiByte = 17
static
int ru_HowAreYou_cchWideChar = 10
static
BYTE ru_HowAreYou_UTF16[]
static
Initial value:
= "\x1A\x04\x30\x04\x3A\x04\x20\x00\x34\x04\x35\x04\x3B\x04\x30\x04"
"\x3F\x00\x00\x00"
BYTE ru_HowAreYou_UTF8[] = "\xD0\x9A\xD0\xB0\xD0\xBA\x20\xD0\xB4\xD0\xB5\xD0\xBB\xD0\xB0\x3F\x00"
static