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
71144728
Commit
71144728
authored
Oct 19, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add support for multi-byte characters in _mbctoupper_l.
parent
3861c1e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
4 deletions
+34
-4
mbcs.c
dlls/msvcrt/mbcs.c
+26
-4
string.c
dlls/msvcrt/tests/string.c
+8
-0
No files found.
dlls/msvcrt/mbcs.c
View file @
71144728
...
...
@@ -494,12 +494,34 @@ unsigned int CDECL _mbctolower(unsigned int c)
*/
unsigned
int
CDECL
_mbctoupper_l
(
unsigned
int
c
,
_locale_t
locale
)
{
if
(
_ismbblead_l
(
c
,
locale
))
unsigned
char
str
[
2
],
ret
[
2
];
pthreadmbcinfo
mbcinfo
;
if
(
!
locale
)
mbcinfo
=
get_mbcinfo
();
else
mbcinfo
=
locale
->
mbcinfo
;
if
(
c
>
0xff
)
{
FIXME
(
"Handle MBC chars
\n
"
);
return
c
;
if
(
!
_ismbblead_l
((
c
>>
8
)
&
0xff
,
locale
))
return
c
;
str
[
0
]
=
c
>>
8
;
str
[
1
]
=
c
;
switch
(
__crtLCMapStringA
(
mbcinfo
->
mblcid
,
LCMAP_UPPERCASE
,
(
char
*
)
str
,
2
,
(
char
*
)
ret
,
2
,
mbcinfo
->
mbcodepage
,
0
))
{
case
0
:
return
c
;
case
1
:
return
ret
[
0
];
default:
return
ret
[
1
]
+
(
ret
[
0
]
<<
8
);
}
}
return
_toupper_l
(
c
,
locale
);
/* ASCII CP or SB char */
return
mbcinfo
->
mbctype
[
c
+
1
]
&
_SBLOW
?
mbcinfo
->
mbcasemap
[
c
]
:
c
;
}
/*********************************************************************
...
...
dlls/msvcrt/tests/string.c
View file @
71144728
...
...
@@ -2839,6 +2839,7 @@ static void test__mbsupr_s(void)
{
errno_t
ret
;
unsigned
char
buffer
[
20
];
int
cp
=
_getmbcp
();
if
(
!
p_mbsupr_s
)
{
...
...
@@ -2890,6 +2891,13 @@ static void test__mbsupr_s(void)
"Expected the output buffer to be
\"
ABCDEFGH
\\
0ijklmnop
\"
, got
\"
%s
\"\n
"
,
buffer
);
_setmbcp
(
936
);
memcpy
(
buffer
,
"
\xa2\xa1\xa2\xa2
q"
,
sizeof
(
"
\xa2\xa1\xa2\xa2
q"
));
ret
=
p_mbsupr_s
(
buffer
,
sizeof
(
buffer
));
ok
(
ret
==
0
,
"Expected _mbsupr_s to return 0, got %d
\n
"
,
ret
);
ok
(
!
memcmp
(
buffer
,
"
\xa2\xf1\xa2\xf2
Q"
,
sizeof
(
"
\xa2\xf1\xa2\xf2
Q"
)),
"got %s
\n
"
,
debugstr_a
((
char
*
)
buffer
));
_setmbcp
(
cp
);
}
static
void
test__mbslwr_s
(
void
)
...
...
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