FreeRDP
|
#include <winpr/wtypes.h>
#include <winpr/string.h>
#include <winpr/assert.h>
#include "unicode.h"
#include "../log.h"
Macros | |
#define | TAG WINPR_TAG("unicode") |
#define | UNI_REPLACEMENT_CHAR (uint32_t)0x0000FFFD |
#define | UNI_MAX_BMP (uint32_t)0x0000FFFF |
#define | UNI_MAX_UTF16 (uint32_t)0x0010FFFF |
#define | UNI_MAX_UTF32 (uint32_t)0x7FFFFFFF |
#define | UNI_MAX_LEGAL_UTF32 (uint32_t)0x0010FFFF |
#define | UNI_SUR_HIGH_START (uint32_t)0xD800 |
#define | UNI_SUR_HIGH_END (uint32_t)0xDBFF |
#define | UNI_SUR_LOW_START (uint32_t)0xDC00 |
#define | UNI_SUR_LOW_END (uint32_t)0xDFFF |
Enumerations | |
enum | ConversionResult { conversionOK , sourceExhausted , targetExhausted , sourceIllegal } |
enum | ConversionFlags { strictConversion = 0 , lenientConversion } |
Functions | |
static ConversionResult | winpr_ConvertUTF16toUTF8_Internal (const uint16_t **sourceStart, const uint16_t *sourceEnd, uint8_t **targetStart, uint8_t *targetEnd, ConversionFlags flags) |
static bool | isLegalUTF8 (const uint8_t *source, int length) |
static ConversionResult | winpr_ConvertUTF8toUTF16_Internal (const uint8_t **sourceStart, const uint8_t *sourceEnd, uint16_t **targetStart, uint16_t *targetEnd, ConversionFlags flags) |
static int | winpr_ConvertUTF8toUTF16 (const uint8_t *src, int cchSrc, uint16_t *dst, int cchDst) |
static int | winpr_ConvertUTF16toUTF8 (const uint16_t *src, int cchSrc, uint8_t *dst, int cchDst) |
int | int_MultiByteToWideChar (UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar) |
int | int_WideCharToMultiByte (UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar) |
Variables | |
static const int | halfShift = 10 |
static const uint32_t | halfBase = 0x0010000UL |
static const uint32_t | halfMask = 0x3FFUL |
static const char | trailingBytesForUTF8 [256] |
static const uint32_t | offsetsFromUTF8 [6] |
static const uint8_t | firstByteMark [7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC } |
#define TAG WINPR_TAG("unicode") |
#define UNI_MAX_BMP (uint32_t)0x0000FFFF |
#define UNI_MAX_LEGAL_UTF32 (uint32_t)0x0010FFFF |
#define UNI_MAX_UTF16 (uint32_t)0x0010FFFF |
#define UNI_MAX_UTF32 (uint32_t)0x7FFFFFFF |
#define UNI_REPLACEMENT_CHAR (uint32_t)0x0000FFFD |
#define UNI_SUR_HIGH_END (uint32_t)0xDBFF |
#define UNI_SUR_HIGH_START (uint32_t)0xD800 |
#define UNI_SUR_LOW_END (uint32_t)0xDFFF |
#define UNI_SUR_LOW_START (uint32_t)0xDC00 |
enum ConversionFlags |
enum ConversionResult |
int int_MultiByteToWideChar | ( | UINT | CodePage, |
DWORD | dwFlags, | ||
LPCSTR | lpMultiByteStr, | ||
int | cbMultiByte, | ||
LPWSTR | lpWideCharStr, | ||
int | cchWideChar | ||
) |
WinPR: Windows Portable Runtime Unicode Conversion (CRT)
Copyright 2022 Armin Novak anova Copyright 2022 Thincast Technologies GmbH k@th incas t.co m
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
int int_WideCharToMultiByte | ( | UINT | CodePage, |
DWORD | dwFlags, | ||
LPCWSTR | lpWideCharStr, | ||
int | cchWideChar, | ||
LPSTR | lpMultiByteStr, | ||
int | cbMultiByte, | ||
LPCSTR | lpDefaultChar, | ||
LPBOOL | lpUsedDefaultChar | ||
) |
|
static |
|
static |
|
static |
|
static |
WinPR built-in Unicode API
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |