Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
beca6ada
Commit
beca6ada
authored
Oct 12, 2000
by
Hidenori Takeshima
Committed by
Alexandre Julliard
Oct 12, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for cp936.
parent
3f2b2d5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
19 deletions
+66
-19
codepage.c
graphics/x11drv/codepage.c
+66
-19
No files found.
graphics/x11drv/codepage.c
View file @
beca6ada
...
...
@@ -19,7 +19,7 @@
DEFAULT_DEBUG_CHANNEL
(
text
);
/***********************************************************************
* IsLegalDBCSChar for cp932/936/949/950
* IsLegalDBCSChar for cp932/936/949/950
/euc
*/
static
inline
int
IsLegalDBCSChar_cp932
(
BYTE
lead
,
BYTE
trail
)
...
...
@@ -45,13 +45,6 @@ int IsLegalDBCSChar_cp949( BYTE lead, BYTE trail )
}
static
inline
int
IsLegalDBCSChar_euckr
(
BYTE
lead
,
BYTE
trail
)
{
return
(
(
lead
>=
(
BYTE
)
0xa1
&&
lead
<=
(
BYTE
)
0xfe
)
&&
(
trail
>=
(
BYTE
)
0xa1
&&
trail
<=
(
BYTE
)
0xfe
)
);
}
static
inline
int
IsLegalDBCSChar_cp950
(
BYTE
lead
,
BYTE
trail
)
{
return
(
(
lead
>=
(
BYTE
)
0x81
&&
lead
<=
(
BYTE
)
0xfe
)
&&
...
...
@@ -59,8 +52,16 @@ int IsLegalDBCSChar_cp950( BYTE lead, BYTE trail )
(
trail
>=
(
BYTE
)
0xa1
&&
trail
<=
(
BYTE
)
0xfe
)
)
);
}
static
inline
int
IsLegalDBCSChar_euc
(
BYTE
lead
,
BYTE
trail
)
{
return
(
(
lead
>=
(
BYTE
)
0xa1
&&
lead
<=
(
BYTE
)
0xfe
)
&&
(
trail
>=
(
BYTE
)
0xa1
&&
trail
<=
(
BYTE
)
0xfe
)
);
}
/***********************************************************************
* DBCSCharToXChar2b for cp932/
949
* DBCSCharToXChar2b for cp932/
euc
*/
static
inline
...
...
@@ -93,7 +94,7 @@ void DBCSCharToXChar2b_cp932( XChar2b* pch, BYTE lead, BYTE trail )
}
static
inline
void
DBCSCharToXChar2b_euc
kr
(
XChar2b
*
pch
,
BYTE
lead
,
BYTE
trail
)
void
DBCSCharToXChar2b_euc
(
XChar2b
*
pch
,
BYTE
lead
,
BYTE
trail
)
{
pch
->
byte1
=
lead
&
(
BYTE
)
0x7f
;
pch
->
byte2
=
trail
&
(
BYTE
)
0x7f
;
...
...
@@ -120,7 +121,11 @@ static WORD X11DRV_enum_subfont_charset_cp932( UINT index )
static
WORD
X11DRV_enum_subfont_charset_cp936
(
UINT
index
)
{
FIXME
(
"please implement X11DRV_enum_subfont_charset_cp936!
\n
"
);
switch
(
index
)
{
case
0
:
return
ANSI_CHARSET
;
}
return
DEFAULT_CHARSET
;
}
...
...
@@ -235,8 +240,50 @@ static XChar2b* X11DRV_unicode_to_char2b_cp932( fontObject* pfo,
static
XChar2b
*
X11DRV_unicode_to_char2b_cp936
(
fontObject
*
pfo
,
LPCWSTR
lpwstr
,
UINT
count
)
{
FIXME
(
"please implement X11DRV_unicode_to_char2b_cp936!
\n
"
);
return
NULL
;
XChar2b
*
str2b
;
XChar2b
*
str2b_dst
;
BYTE
*
str
;
BYTE
*
str_src
;
UINT
i
;
char
ch
=
pfo
->
fs
->
default_char
;
if
(
!
(
str2b
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
sizeof
(
XChar2b
)
)))
return
NULL
;
if
(
!
(
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
*
2
)))
{
HeapFree
(
GetProcessHeap
(),
0
,
str2b
);
return
NULL
;
}
WideCharToMultiByte
(
936
,
0
,
lpwstr
,
count
,
str
,
count
*
2
,
&
ch
,
NULL
);
str_src
=
str
;
str2b_dst
=
str2b
;
for
(
i
=
0
;
i
<
count
;
i
++
,
str_src
++
,
str2b_dst
++
)
{
if
(
IsLegalDBCSChar_cp936
(
*
str_src
,
*
(
str_src
+
1
)
)
)
{
if
(
IsLegalDBCSChar_euc
(
*
str_src
,
*
(
str_src
+
1
)
)
)
{
DBCSCharToXChar2b_euc
(
str2b_dst
,
*
str_src
,
*
(
str_src
+
1
)
);
}
else
{
/* FIXME */
str2b_dst
->
byte1
=
0
;
str2b_dst
->
byte2
=
0
;
}
str_src
++
;
}
else
{
str2b_dst
->
byte1
=
0
;
str2b_dst
->
byte2
=
*
str_src
;
}
}
HeapFree
(
GetProcessHeap
(),
0
,
str
);
return
str2b
;
}
static
XChar2b
*
X11DRV_unicode_to_char2b_cp949
(
fontObject
*
pfo
,
...
...
@@ -264,9 +311,9 @@ static XChar2b* X11DRV_unicode_to_char2b_cp949( fontObject* pfo,
{
if
(
IsLegalDBCSChar_cp949
(
*
str_src
,
*
(
str_src
+
1
)
)
)
{
if
(
IsLegalDBCSChar_euc
kr
(
*
str_src
,
*
(
str_src
+
1
)
)
)
if
(
IsLegalDBCSChar_euc
(
*
str_src
,
*
(
str_src
+
1
)
)
)
{
DBCSCharToXChar2b_euc
kr
(
str2b_dst
,
*
str_src
,
*
(
str_src
+
1
)
);
DBCSCharToXChar2b_euc
(
str2b_dst
,
*
str_src
,
*
(
str_src
+
1
)
);
}
else
{
...
...
@@ -608,10 +655,10 @@ const X11DRV_CP X11DRV_cptable[X11DRV_CPTABLE_COUNT] =
{
/* CP936 */
X11DRV_enum_subfont_charset_cp936
,
X11DRV_unicode_to_char2b_cp936
,
X11DRV_DrawString_
normal
,
/* FIXME */
X11DRV_TextWidth_
normal
,
/* FIXME */
X11DRV_DrawText_
normal
,
/* FIXME */
X11DRV_TextExtents_
normal
,
/* FIXME */
X11DRV_DrawString_
dbcs
,
X11DRV_TextWidth_
dbcs_2fonts
,
X11DRV_DrawText_
dbcs_2fonts
,
X11DRV_TextExtents_
dbcs_2fonts
,
X11DRV_GetTextMetricsA_normal
,
/* FIXME */
},
{
/* CP949 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment