Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
unicode.h
Go to the documentation of this file.
1/*
2 * This file is part of the Ultibo project, https://ultibo.org/
3 *
4 * The MIT License (MIT)
5 *
6 * Copyright (c) 2026 Garry Wood <garry@softoz.com.au>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 */
26#ifndef _ULTIBO_UNICODE_H
27#define _ULTIBO_UNICODE_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include "ultibo/globaltypes.h"
34#include "ultibo/globalconst.h"
35#include "ultibo/locale.h"
36
38
45int STDCALL MultiByteToWideChar(unsigned int codepage, uint32_t dwflags, char *lpmultibytestr, int cbmultibyte, WCHAR *lpwidecharstr, int cchwidechar);
46
53int STDCALL WideCharToMultiByte(unsigned int codepage, uint32_t dwflags, WCHAR *lpwidecharstr, int cchwidechar, char *lpmultibytestr, int cbmultibyte, char *lpdefaultchar, BOOL *lpuseddefaultchar);
54
55int STDCALL CompareString(LCID locale, uint32_t dwcmpflags, char *lpstring1, int cchcount1, char *lpstring2, int cchcount2);
56
63int STDCALL CompareStringA(LCID locale, uint32_t dwcmpflags, char *lpstring1, int cchcount1, char *lpstring2, int cchcount2);
64
70int STDCALL CompareStringW(LCID locale, uint32_t dwcmpflags, WCHAR *lpstring1, int cchcount1, WCHAR *lpstring2, int cchcount2);
71
72char * STDCALL CharUpper(char *lpsz);
73
81char * STDCALL CharUpperA(char *lpsz);
82
90
91uint32_t STDCALL CharUpperBuff(char *lpsz, uint32_t cchlength);
92
97uint32_t STDCALL CharUpperBuffA(char *lpsz, uint32_t cchlength);
98
102uint32_t STDCALL CharUpperBuffW(WCHAR *lpsz, uint32_t cchlength);
103
104char * STDCALL CharLower(char *lpsz);
105
113char * STDCALL CharLowerA(char *lpsz);
114
122
123uint32_t STDCALL CharLowerBuff(char *lpsz, uint32_t cchlength);
124
129uint32_t STDCALL CharLowerBuffA(char *lpsz, uint32_t cchlength);
130
134uint32_t STDCALL CharLowerBuffW(WCHAR *lpsz, uint32_t cchlength);
135
136BOOL STDCALL AnsiToOem(char *lpszsrc, char *lpszdst);
137BOOL STDCALL AnsiToOemBuff(char *lpszsrc, char *lpszdst, uint32_t cchdstlength);
138BOOL STDCALL OemToAnsi(char *lpszsrc, char *lpszdst);
139BOOL STDCALL OemToAnsiBuff(char *lpszsrc, char *lpszdst, uint32_t cchdstlength);
140
141BOOL STDCALL CharToOem(char *lpszsrc, char *lpszdst);
142
147BOOL STDCALL CharToOemA(char *lpszsrc, char *lpszdst);
148
153BOOL STDCALL CharToOemW(WCHAR *lpszsrc, char *lpszdst);
154
155BOOL STDCALL OemToChar(char *lpszsrc, char *lpszdst);
156
161BOOL STDCALL OemToCharA(char *lpszsrc, char *lpszdst);
162
167BOOL STDCALL OemToCharW(char *lpszsrc, WCHAR *lpszdst);
168
169BOOL STDCALL CharToOemBuff(char *lpszsrc, char *lpszdst, uint32_t cchdstlength);
170
175BOOL STDCALL CharToOemBuffA(char *lpszsrc, char *lpszdst, uint32_t cchdstlength);
176
181BOOL STDCALL CharToOemBuffW(WCHAR *lpszsrc, char *lpszdst, uint32_t cchdstlength);
182
183BOOL STDCALL OemToCharBuff(char *lpszsrc, char *lpszdst, uint32_t cchdstlength);
184
189BOOL STDCALL OemToCharBuffA(char *lpszsrc, char *lpszdst, uint32_t cchdstlength);
190
195BOOL STDCALL OemToCharBuffW(char *lpszsrc, WCHAR *lpszdst, uint32_t cchdstlength);
196
197#ifdef __cplusplus
198}
199#endif
200
201#endif // _ULTIBO_UNICODE_H
#define STDCALL
Definition globaltypes.h:45
_Bool BOOL
Built in Boolean type (1 byte) (Redeclared here for flexibility).
Definition globaltypes.h:55
wchar_t WCHAR
Standard WideChar type (2 bytes) (Redeclared here for flexibility).
Definition globaltypes.h:58
uint32_t LCID
To Do.
Definition locale.h:383
BOOL STDCALL OemToCharBuffA(char *lpszsrc, char *lpszdst, uint32_t cchdstlength)
OEM to ANSI conversion (Char to Char).
BOOL STDCALL CharToOemA(char *lpszsrc, char *lpszdst)
ANSI to OEM conversion (Char to Char).
int STDCALL CompareStringW(LCID locale, uint32_t dwcmpflags, WCHAR *lpstring1, int cchcount1, WCHAR *lpstring2, int cchcount2)
Unicode compare of two strings for equivalence. If both strings are equal returns CSTR_EQUAL,...
uint32_t STDCALL CharLowerBuffA(char *lpsz, uint32_t cchlength)
Upper to Lower case conversion in ANSI code page (Char).
BOOL STDCALL AnsiToOem(char *lpszsrc, char *lpszdst)
BOOL STDCALL OemToAnsiBuff(char *lpszsrc, char *lpszdst, uint32_t cchdstlength)
BOOL STDCALL OemToCharBuff(char *lpszsrc, char *lpszdst, uint32_t cchdstlength)
uint32_t STDCALL CharUpperBuffW(WCHAR *lpsz, uint32_t cchlength)
Lower to Upper case conversion in Unicode (WideChar).
int STDCALL WideCharToMultiByte(unsigned int codepage, uint32_t dwflags, WCHAR *lpwidecharstr, int cchwidechar, char *lpmultibytestr, int cbmultibyte, char *lpdefaultchar, BOOL *lpuseddefaultchar)
Unicode string to SBCS/DBCS OEM or ANSI string.
BOOL STDCALL OemToAnsi(char *lpszsrc, char *lpszdst)
BOOL STDCALL CharToOemW(WCHAR *lpszsrc, char *lpszdst)
Unicode to OEM conversion (WideChar to Char).
int STDCALL MultiByteToWideChar(unsigned int codepage, uint32_t dwflags, char *lpmultibytestr, int cbmultibyte, WCHAR *lpwidecharstr, int cchwidechar)
SBCS/DBCS OEM or ANSI string to Unicode string.
uint32_t STDCALL CharLowerBuffW(WCHAR *lpsz, uint32_t cchlength)
Upper to Lower case conversion in Unicode (WideChar).
BOOL STDCALL OemToChar(char *lpszsrc, char *lpszdst)
BOOL STDCALL OemToCharBuffW(char *lpszsrc, WCHAR *lpszdst, uint32_t cchdstlength)
OEM to Unicode conversion (Char to WideChar).
char *STDCALL CharUpperA(char *lpsz)
Lower to Upper case conversion in ANSI code page (Char).
uint32_t STDCALL CharUpperBuffA(char *lpsz, uint32_t cchlength)
Lower to Upper case conversion in ANSI code page (Char).
BOOL STDCALL OemToCharW(char *lpszsrc, WCHAR *lpszdst)
OEM to Unicode conversion (Char to WideChar).
BOOL STDCALL OemToCharA(char *lpszsrc, char *lpszdst)
OEM to ANSI conversion (Char to Char).
BOOL STDCALL CharToOemBuffA(char *lpszsrc, char *lpszdst, uint32_t cchdstlength)
ANSI to OEM conversion (Char to Char).
char *STDCALL CharLower(char *lpsz)
uint32_t STDCALL CharUpperBuff(char *lpsz, uint32_t cchlength)
char *STDCALL CharUpper(char *lpsz)
char *STDCALL CharLowerA(char *lpsz)
Upper to Lower case conversion in ANSI code page (Char).
BOOL STDCALL AnsiToOemBuff(char *lpszsrc, char *lpszdst, uint32_t cchdstlength)
BOOL STDCALL CharToOem(char *lpszsrc, char *lpszdst)
BOOL STDCALL CharToOemBuffW(WCHAR *lpszsrc, char *lpszdst, uint32_t cchdstlength)
Unicode to OEM conversion (WideChar to Char).
WCHAR *STDCALL CharUpperW(WCHAR *lpsz)
Lower to Upper case conversion in Unicode (WideChar).
int STDCALL CompareString(LCID locale, uint32_t dwcmpflags, char *lpstring1, int cchcount1, char *lpstring2, int cchcount2)
uint32_t STDCALL CharLowerBuff(char *lpsz, uint32_t cchlength)
WCHAR *STDCALL CharLowerW(WCHAR *lpsz)
Upper to Lower case conversion in Unicode (WideChar).
int STDCALL CompareStringA(LCID locale, uint32_t dwcmpflags, char *lpstring1, int cchcount1, char *lpstring2, int cchcount2)
ANSI compare of two strings for equivalence. If both strings are equal returns CSTR_EQUAL,...
BOOL STDCALL CharToOemBuff(char *lpszsrc, char *lpszdst, uint32_t cchdstlength)