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
ed263ae4
Commit
ed263ae4
authored
Oct 16, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Oct 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add support for detecting the user locale preference from the system on Mac OS X.
parent
2f6e643d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
locale.c
dlls/kernel32/locale.c
+20
-1
No files found.
dlls/kernel32/locale.c
View file @
ed263ae4
...
...
@@ -31,6 +31,11 @@
#include <ctype.h>
#include <stdlib.h>
#ifdef __APPLE__
# include <CoreFoundation/CFLocale.h>
# include <CoreFoundation/CFString.h>
#endif
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
...
...
@@ -505,10 +510,20 @@ static LCID get_env_lcid( UINT *unix_cp, const char *env_str )
{
char
*
buf
,
*
lang
,
*
country
,
*
charset
,
*
dialect
,
*
next
;
LCID
ret
=
0
;
char
user_locale
[
50
]
=
{
0
};
#ifdef __APPLE__
CFLocaleRef
user_locale_ref
=
CFLocaleCopyCurrent
();
CFStringRef
user_locale_string_ref
=
CFLocaleGetIdentifier
(
user_locale_ref
);
CFStringGetCString
(
user_locale_string_ref
,
user_locale
,
sizeof
(
user_locale
),
kCFStringEncodingUTF8
);
CFRelease
(
user_locale_ref
);
#endif
if
(((
lang
=
getenv
(
"LC_ALL"
))
&&
*
lang
)
||
(
env_str
&&
(
lang
=
getenv
(
env_str
))
&&
*
lang
)
||
((
lang
=
getenv
(
"LANG"
))
&&
*
lang
))
((
lang
=
getenv
(
"LANG"
))
&&
*
lang
)
||
((
lang
=
user_locale
)
&&
*
lang
))
{
if
(
!
strcmp
(
lang
,
"POSIX"
)
||
!
strcmp
(
lang
,
"C"
))
goto
done
;
...
...
@@ -545,6 +560,10 @@ static LCID get_env_lcid( UINT *unix_cp, const char *env_str )
else
FIXME
(
"charset %s was not recognized
\n
"
,
charset
);
}
#ifdef __APPLE__
/* charset on Mac OS X is always UTF8 */
else
if
(
unix_cp
)
*
unix_cp
=
CP_UTF8
;
#endif
lang
=
next
;
}
while
(
lang
&&
!
ret
);
...
...
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