Skip to content
Snippets Groups Projects
Commit fb270ddc authored by Alexandre Julliard's avatar Alexandre Julliard
Browse files

Added a bunch of code page tables for multibyte<->wide char

conversions (with the help of Dmitry Timoshkov).
parent 0072c881
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ LIBSUBDIRS = \
relay32 \
resources \
scheduler \
unicode \
win32 \
windows
......@@ -114,6 +115,7 @@ LIBOBJS = \
relay32/relay32.o \
resources/resources.o \
scheduler/scheduler.o \
unicode/unicode.o \
win32/win32.o \
windows/windows.o
......
......@@ -6301,6 +6301,7 @@ tools/Makefile
tools/cvdump/Makefile
tools/wrc/Makefile
tsx11/Makefile
unicode/Makefile
win32/Makefile
windows/Makefile
windows/ttydrv/Makefile
......@@ -6534,6 +6535,7 @@ tools/Makefile
tools/cvdump/Makefile
tools/wrc/Makefile
tsx11/Makefile
unicode/Makefile
win32/Makefile
windows/Makefile
windows/ttydrv/Makefile
......
......@@ -1095,6 +1095,7 @@ tools/Makefile
tools/cvdump/Makefile
tools/wrc/Makefile
tsx11/Makefile
unicode/Makefile
win32/Makefile
windows/Makefile
windows/ttydrv/Makefile
......
/*
* Wine internal Unicode definitions
*
* Copyright 2000 Alexandre Julliard
*/
#ifndef __WINE_UNICODE_H
#define __WINE_UNICODE_H
/* code page info common to SBCS and DBCS */
struct cp_info
{
unsigned int codepage; /* codepage id */
unsigned int char_size; /* char size (1 or 2 bytes) */
char def_char[2]; /* default char value */
unsigned short def_unicode_char; /* default Unicode char value */
const char *name; /* code page name */
};
struct sbcs_table
{
struct cp_info info;
const unsigned short *cp2uni; /* code page -> Unicode map */
const unsigned char *uni2cp_low; /* Unicode -> code page map */
const unsigned short *uni2cp_high;
};
struct dbcs_table
{
struct cp_info info;
const unsigned short *cp2uni; /* code page -> Unicode map */
const unsigned char *cp2uni_leadbytes;
const unsigned short *uni2cp_low; /* Unicode -> code page map */
const unsigned short *uni2cp_high;
unsigned char lead_bytes[12]; /* lead bytes ranges */
};
union cptable
{
struct cp_info info;
struct sbcs_table sbcs;
struct dbcs_table dbcs;
};
extern const union cptable *cp_get_table( unsigned int codepage );
extern const union cptable *cp_enum_table( unsigned int index );
extern int cp_mbstowcs( const union cptable *table, int flags,
const char *src, int srclen,
unsigned short *dst, int dstlen );
extern int cp_wcstombs( const union cptable *table, int flags,
const unsigned short *src, int srclen,
char *dst, int dstlen );
static inline int is_dbcs_leadbyte( const union cptable *table, unsigned char ch )
{
return (table->info.char_size == 2) && (table->dbcs.cp2uni_leadbytes[ch]);
}
#endif /* __WINE_UNICODE_H */
Makefile
DEFS = @DLLFLAGS@ -D__WINE__
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = unicode
CODEPAGES = \
037 \
424 \
437 \
500 \
737 \
775 \
850 \
852 \
855 \
856 \
857 \
860 \
861 \
862 \
863 \
864 \
865 \
866 \
869 \
874 \
875 \
878 \
932 \
936 \
949 \
950 \
1006 \
1026 \
1250 \
1251 \
1252 \
1253 \
1254 \
1255 \
1256 \
1257 \
1258 \
10000 \
10006 \
10007 \
10029 \
10079 \
10081 \
20866 \
28591 \
28592 \
28593 \
28594 \
28595 \
28596 \
28597 \
28598 \
28599
C_SRCS = \
cptable.c \
mbtowc.c \
wctomb.c \
$(CODEPAGES:%=c_%.c)
all: $(MODULE).o
@MAKE_RULES@
### Dependencies:
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment