Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
94459b88
Commit
94459b88
authored
May 21, 2008
by
James Hawkins
Committed by
Alexandre Julliard
May 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mlang: Only return the locale language name if no country name exists.
parent
67daa7f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletion
+34
-1
mlang.c
dlls/mlang/mlang.c
+3
-0
Makefile.in
dlls/mlang/tests/Makefile.in
+1
-1
mlang.c
dlls/mlang/tests/mlang.c
+30
-0
No files found.
dlls/mlang/mlang.c
View file @
94459b88
...
...
@@ -704,10 +704,13 @@ static inline INT lcid_to_rfc1766A( LCID lcid, LPSTR rfc1766, INT len )
static
inline
INT
lcid_to_rfc1766W
(
LCID
lcid
,
LPWSTR
rfc1766
,
INT
len
)
{
INT
n
=
GetLocaleInfoW
(
lcid
,
LOCALE_SISO639LANGNAME
,
rfc1766
,
len
);
INT
save
=
n
;
if
(
n
)
{
rfc1766
[
n
-
1
]
=
'-'
;
n
+=
GetLocaleInfoW
(
lcid
,
LOCALE_SISO3166CTRYNAME
,
rfc1766
+
n
,
len
-
n
);
if
(
n
==
save
)
rfc1766
[
n
-
1
]
=
'\0'
;
LCMapStringW
(
LOCALE_USER_DEFAULT
,
LCMAP_LOWERCASE
,
rfc1766
,
n
,
rfc1766
,
len
);
return
n
;
}
...
...
dlls/mlang/tests/Makefile.in
View file @
94459b88
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
mlang.dll
IMPORTS
=
uuid ole32 gdi32 kernel32
IMPORTS
=
uuid ole
aut32 ole
32 gdi32 kernel32
CTESTS
=
\
mlang.c
...
...
dlls/mlang/tests/mlang.c
View file @
94459b88
...
...
@@ -44,6 +44,17 @@
#define TRACE_2 OutputDebugStringA
static
CHAR
string1
[
MAX_PATH
],
string2
[
MAX_PATH
];
#define ok_w2(format, szString1, szString2) \
\
if (lstrcmpW(szString1, szString2) != 0) \
{ \
WideCharToMultiByte(CP_ACP, 0, szString1, -1, string1, MAX_PATH, NULL, NULL); \
WideCharToMultiByte(CP_ACP, 0, szString2, -1, string2, MAX_PATH, NULL, NULL); \
ok(0, format, string1, string2); \
}
static
BOOL
(
WINAPI
*
pGetCPInfoExA
)(
UINT
,
DWORD
,
LPCPINFOEXA
);
static
void
test_multibyte_to_unicode_translations
(
IMultiLanguage2
*
iML2
)
...
...
@@ -734,6 +745,24 @@ static void test_GetLcidFromRfc1766(IMultiLanguage2 *iML2)
ok
(
lcid
==
0x409
,
"got wrong lcid: %04x
\n
"
,
lcid
);
}
static
void
test_GetRfc1766FromLcid
(
IMultiLanguage2
*
iML2
)
{
HRESULT
hr
;
BSTR
rfcstr
;
LCID
lcid
;
static
WCHAR
kok
[]
=
{
'k'
,
'o'
,
'k'
,
0
};
hr
=
IMultiLanguage2_GetLcidFromRfc1766
(
iML2
,
&
lcid
,
kok
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
hr
=
IMultiLanguage2_GetRfc1766FromLcid
(
iML2
,
lcid
,
&
rfcstr
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok_w2
(
"Expected
\"
%s
\"
, got
\"
%s
\"
n"
,
kok
,
rfcstr
);
SysFreeString
(
rfcstr
);
}
START_TEST
(
mlang
)
{
IMultiLanguage2
*
iML2
=
NULL
;
...
...
@@ -752,6 +781,7 @@ START_TEST(mlang)
test_rfc1766
(
iML2
);
test_GetLcidFromRfc1766
(
iML2
);
test_GetRfc1766FromLcid
(
iML2
);
test_EnumCodePages
(
iML2
,
0
);
test_EnumCodePages
(
iML2
,
MIMECONTF_MIME_LATEST
);
...
...
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