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
6e7701ae
Commit
6e7701ae
authored
May 26, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
May 27, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Use ntdll for UTF8 conversion.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
cccec04f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
clipboard.c
dlls/winemac.drv/clipboard.c
+11
-5
No files found.
dlls/winemac.drv/clipboard.c
View file @
6e7701ae
...
...
@@ -808,7 +808,11 @@ static void *import_utf8_to_unicodetext(CFDataRef data, size_t *ret_size)
dst
[
j
++
]
=
0
;
if
((
ret
=
malloc
(
j
*
sizeof
(
WCHAR
))))
*
ret_size
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
dst
,
j
,
ret
,
j
)
*
sizeof
(
WCHAR
);
{
DWORD
dst_size
;
RtlUTF8ToUnicodeN
(
ret
,
j
*
sizeof
(
WCHAR
),
&
dst_size
,
dst
,
j
);
*
ret_size
=
dst_size
;
}
free
(
dst
);
}
...
...
@@ -1031,10 +1035,12 @@ static CFDataRef export_html(void *data, size_t size)
static
CFDataRef
export_unicodetext_to_utf8
(
void
*
data
,
size_t
size
)
{
CFMutableDataRef
ret
;
INT
dst_len
;
WCHAR
*
src
=
data
;
DWORD
dst_len
=
0
;
dst_len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
data
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
dst_len
)
dst_len
--
;
/* Leave off null terminator. */
/* Leave off null terminator. */
if
(
size
>=
sizeof
(
WCHAR
)
&&
!
src
[
size
/
sizeof
(
WCHAR
)
-
1
])
size
-=
sizeof
(
WCHAR
);
RtlUnicodeToUTF8N
(
NULL
,
0
,
&
dst_len
,
src
,
size
);
ret
=
CFDataCreateMutable
(
NULL
,
dst_len
);
if
(
ret
)
{
...
...
@@ -1043,7 +1049,7 @@ static CFDataRef export_unicodetext_to_utf8(void *data, size_t size)
CFDataSetLength
(
ret
,
dst_len
);
dst
=
(
LPSTR
)
CFDataGetMutableBytePtr
(
ret
);
WideCharToMultiByte
(
CP_UTF8
,
0
,
data
,
-
1
,
dst
,
dst_len
,
NULL
,
NULL
);
RtlUnicodeToUTF8N
(
dst
,
dst_len
,
&
dst_len
,
src
,
size
);
/* Remove carriage returns */
for
(
i
=
0
,
j
=
0
;
i
<
dst_len
;
i
++
)
...
...
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