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
16d57370
Commit
16d57370
authored
Apr 04, 2011
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Apr 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: MB_ERR_INVALID_CHARS makes an error when the undefined byte character is used.
parent
79d7cd76
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
codepage.c
dlls/kernel32/tests/codepage.c
+0
-1
mbtowc.c
libs/wine/mbtowc.c
+11
-2
No files found.
dlls/kernel32/tests/codepage.c
View file @
16d57370
...
...
@@ -385,7 +385,6 @@ static void test_undefined_byte_char(void)
ret
=
MultiByteToWideChar
(
testset
[
i
].
codepage
,
MB_ERR_INVALID_CHARS
,
testset
[
i
].
str
,
-
1
,
NULL
,
0
);
if
(
testset
[
i
].
is_error
)
{
todo_wine
ok
(
ret
==
0
&&
GetLastError
()
==
ERROR_NO_UNICODE_TRANSLATION
,
"ret is %d, GetLastError is %u (cp %d)
\n
"
,
ret
,
GetLastError
(),
testset
[
i
].
codepage
);
...
...
libs/wine/mbtowc.c
View file @
16d57370
...
...
@@ -39,6 +39,13 @@ static int get_decomposition( WCHAR src, WCHAR *dst, unsigned int dstlen )
return
res
;
}
/* check the code whether it is in Unicode Private Use Area (PUA). */
/* MB_ERR_INVALID_CHARS raises an error converting from 1-byte character to PUA. */
static
inline
int
is_private_use_area_char
(
WCHAR
code
)
{
return
(
code
>=
0xe000
&&
code
<=
0xf8ff
);
}
/* check src string for invalid chars; return non-zero if invalid char found */
static
inline
int
check_invalid_chars_sbcs
(
const
struct
sbcs_table
*
table
,
int
flags
,
const
unsigned
char
*
src
,
unsigned
int
srclen
)
...
...
@@ -49,7 +56,8 @@ static inline int check_invalid_chars_sbcs( const struct sbcs_table *table, int
+
(
def_unicode_char
&
0xff
)];
while
(
srclen
)
{
if
(
cp2uni
[
*
src
]
==
def_unicode_char
&&
*
src
!=
def_char
)
break
;
if
((
cp2uni
[
*
src
]
==
def_unicode_char
&&
*
src
!=
def_char
)
||
is_private_use_area_char
(
cp2uni
[
*
src
]))
break
;
src
++
;
srclen
--
;
}
...
...
@@ -167,7 +175,8 @@ static inline int check_invalid_chars_dbcs( const struct dbcs_table *table,
src
++
;
srclen
--
;
}
else
if
(
cp2uni
[
*
src
]
==
def_unicode_char
&&
*
src
!=
def_char
)
break
;
else
if
((
cp2uni
[
*
src
]
==
def_unicode_char
&&
*
src
!=
def_char
)
||
is_private_use_area_char
(
cp2uni
[
*
src
]))
break
;
src
++
;
srclen
--
;
}
...
...
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