Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
ec3d77bc
Commit
ec3d77bc
authored
Mar 17, 2021
by
Dmitry Timoshkov
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wine/debug.h: Make wine_dbgstr_wn use UTF-8 for output. (eterbug #14134)
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
parent
5edc3adb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
locale.c
dlls/ntdll/locale.c
+13
-0
debug.h
include/wine/debug.h
+37
-2
No files found.
dlls/ntdll/locale.c
View file @
ec3d77bc
...
...
@@ -946,6 +946,19 @@ NTSTATUS WINAPI RtlUnicodeToUTF8N( char *dst, DWORD dstlen, DWORD *reslen, const
}
/******************************************************************
* ntdll_wcstoumbs
*/
int
ntdll_wcstoumbs
(
const
WCHAR
*
src
,
DWORD
srclen
,
char
*
dst
,
DWORD
dstlen
,
BOOL
strict
)
{
DWORD
reslen
;
/* Assume UTF-8 is always the target encoding */
RtlUnicodeToUTF8N
(
dst
,
dstlen
,
&
reslen
,
src
,
srclen
*
sizeof
(
WCHAR
)
);
return
reslen
;
}
/******************************************************************************
* RtlIsNormalizedString (NTDLL.@)
*/
...
...
include/wine/debug.h
View file @
ec3d77bc
...
...
@@ -223,6 +223,15 @@ static inline int __wine_dbg_cdecl wine_dbg_log( enum __wine_debug_class cls,
return
ret
;
}
#ifdef _NTSYSTEM_
extern
int
ntdll_wcstoumbs
(
const
WCHAR
*
,
DWORD
,
char
*
,
DWORD
,
BOOL
);
#else
#ifndef NTSTATUS
typedef
LONG
NTSTATUS
;
#endif
NTSYSAPI
NTSTATUS
WINAPI
RtlMultiByteToUnicodeN
(
WCHAR
*
,
DWORD
,
DWORD
*
,
const
char
*
,
DWORD
);
NTSYSAPI
NTSTATUS
WINAPI
RtlUnicodeToUTF8N
(
LPSTR
,
DWORD
,
DWORD
*
,
LPCWSTR
,
DWORD
);
#endif
static
inline
const
char
*
wine_dbgstr_an
(
const
char
*
str
,
int
n
)
{
static
const
char
hex
[
16
]
=
{
'0'
,
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'a'
,
'b'
,
'c'
,
'd'
,
'e'
,
'f'
};
...
...
@@ -246,12 +255,27 @@ static inline const char *wine_dbgstr_an( const char *str, int n )
case
'"'
:
*
dst
++
=
'\\'
;
*
dst
++
=
'"'
;
break
;
case
'\\'
:
*
dst
++
=
'\\'
;
*
dst
++
=
'\\'
;
break
;
default:
if
(
c
<
' '
||
c
>=
127
)
if
(
c
<
' '
)
{
*
dst
++
=
'\\'
;
*
dst
++
=
'x'
;
*
dst
++
=
hex
[(
c
>>
4
)
&
0x0f
];
*
dst
++
=
hex
[
c
&
0x0f
];
}
else
if
(
c
>=
127
)
{
#if defined _NTSYSTEM_ || defined WINE_UNIX_LIB
*
dst
++
=
'\\'
;
*
dst
++
=
'x'
;
*
dst
++
=
hex
[(
c
>>
4
)
&
0x0f
];
*
dst
++
=
hex
[
c
&
0x0f
];
#else
WCHAR
wc
;
DWORD
reslen
;
RtlMultiByteToUnicodeN
(
&
wc
,
sizeof
(
wc
),
&
reslen
,
(
const
char
*
)
&
c
,
1
);
RtlUnicodeToUTF8N
(
dst
,
4
,
&
reslen
,
&
wc
,
sizeof
(
wc
));
dst
+=
reslen
;
#endif
}
else
*
dst
++
=
c
;
}
...
...
@@ -291,7 +315,7 @@ static inline const char *wine_dbgstr_wn( const WCHAR *str, int n )
case
'"'
:
*
dst
++
=
'\\'
;
*
dst
++
=
'"'
;
break
;
case
'\\'
:
*
dst
++
=
'\\'
;
*
dst
++
=
'\\'
;
break
;
default:
if
(
c
<
' '
||
c
>=
127
)
if
(
c
<
' '
)
{
*
dst
++
=
'\\'
;
*
dst
++
=
hex
[(
c
>>
12
)
&
0x0f
];
...
...
@@ -299,6 +323,17 @@ static inline const char *wine_dbgstr_wn( const WCHAR *str, int n )
*
dst
++
=
hex
[(
c
>>
4
)
&
0x0f
];
*
dst
++
=
hex
[
c
&
0x0f
];
}
else
if
(
c
>=
127
)
{
DWORD
reslen
;
#if defined _NTSYSTEM_ || defined WINE_UNIX_LIB
reslen
=
ntdll_wcstoumbs
(
&
c
,
1
,
dst
,
4
,
FALSE
);
#else
RtlUnicodeToUTF8N
(
dst
,
4
,
&
reslen
,
&
c
,
sizeof
(
c
));
#endif
dst
+=
reslen
;
}
else
*
dst
++
=
(
char
)
c
;
}
}
...
...
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