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
c4af6088
Commit
c4af6088
authored
Sep 23, 2016
by
Akihiro Sagawa
Committed by
Alexandre Julliard
Sep 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Implement LCMAP_HIRAGANA.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
659e161d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
locale.c
dlls/kernel32/locale.c
+16
-2
locale.c
dlls/kernel32/tests/locale.c
+6
-2
No files found.
dlls/kernel32/locale.c
View file @
c4af6088
...
...
@@ -3192,8 +3192,10 @@ INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src, INT srclen, LPW
SetLastError
(
ERROR_INVALID_FLAGS
);
return
0
;
}
if
((
flags
&
(
NORM_IGNORENONSPACE
|
NORM_IGNORESYMBOLS
))
&&
(
flags
&
~
(
NORM_IGNORENONSPACE
|
NORM_IGNORESYMBOLS
)))
if
(((
flags
&
(
NORM_IGNORENONSPACE
|
NORM_IGNORESYMBOLS
))
&&
(
flags
&
~
(
NORM_IGNORENONSPACE
|
NORM_IGNORESYMBOLS
)))
||
((
flags
&
LCMAP_HIRAGANA
)
&&
(
flags
&
(
LCMAP_SIMPLIFIED_CHINESE
|
LCMAP_TRADITIONAL_CHINESE
))))
{
SetLastError
(
ERROR_INVALID_FLAGS
);
return
0
;
...
...
@@ -3268,6 +3270,18 @@ INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src, INT srclen, LPW
srclen
-=
len
;
}
if
(
flags
&
LCMAP_HIRAGANA
)
{
/* map katakana to hiragana, e.g. U+30A1 -> U+3041.
we can't use C3_KATAKANA as some characters can't map to hiragana */
for
(
len
=
dst_ptr
-
dst
,
dst_ptr
=
dst
;
len
;
len
--
,
dst_ptr
++
)
{
if
((
*
dst_ptr
>=
0x30A1
&&
*
dst_ptr
<=
0x30F6
)
||
*
dst_ptr
==
0x30FD
||
*
dst_ptr
==
0x30FE
)
*
dst_ptr
-=
0x60
;
}
}
done:
if
(
srclen
)
{
...
...
dlls/kernel32/tests/locale.c
View file @
c4af6088
...
...
@@ -2206,6 +2206,10 @@ static const DWORD lcmap_invalid_flags[] = {
LCMAP_LOWERCASE
|
NORM_IGNORESYMBOLS
,
LCMAP_UPPERCASE
|
NORM_IGNORENONSPACE
,
LCMAP_LOWERCASE
|
NORM_IGNORENONSPACE
,
LCMAP_HIRAGANA
|
NORM_IGNORENONSPACE
,
LCMAP_HIRAGANA
|
NORM_IGNORESYMBOLS
,
LCMAP_HIRAGANA
|
LCMAP_SIMPLIFIED_CHINESE
,
LCMAP_HIRAGANA
|
LCMAP_TRADITIONAL_CHINESE
,
};
static
void
test_LCMapStringA
(
void
)
...
...
@@ -2433,14 +2437,14 @@ static void test_lcmapstring_unicode(lcmapstring_wrapper func_ptr, const char *f
japanese_text
,
-
1
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
));
ok
(
ret
==
lstrlenW
(
hiragana_text
)
+
1
,
"%s ret %d, error %d, expected value %d
\n
"
,
func_name
,
ret
,
GetLastError
(),
lstrlenW
(
hiragana_text
)
+
1
);
todo_wine
ok
(
!
lstrcmpW
(
buf
,
hiragana_text
),
"%s string compare mismatch
\n
"
,
func_name
);
ok
(
!
lstrcmpW
(
buf
,
hiragana_text
),
"%s string compare mismatch
\n
"
,
func_name
);
buf
[
0
]
=
0x30f5
;
/* KATAKANA LETTER SMALL KA */
ret
=
func_ptr
(
LCMAP_HIRAGANA
,
buf
,
1
,
buf2
,
1
);
ok
(
ret
==
1
,
"%s ret %d, error %d, expected value 1
\n
"
,
func_name
,
ret
,
GetLastError
());
/* U+3095: HIRAGANA LETTER SMALL KA was added in Unicode 3.2 */
todo_wine
ok
(
buf2
[
0
]
==
0x3095
||
broken
(
buf2
[
0
]
==
0x30f5
/* Vista and earlier versions */
),
ok
(
buf2
[
0
]
==
0x3095
||
broken
(
buf2
[
0
]
==
0x30f5
/* Vista and earlier versions */
),
"%s expected %04x, got %04x
\n
"
,
func_name
,
0x3095
,
buf2
[
0
]);
/* test LCMAP_KATAKANA | LCMAP_LOWERCASE */
...
...
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