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
21acb71e
Commit
21acb71e
authored
Dec 09, 2009
by
Ken Thomases
Committed by
Alexandre Julliard
Dec 10, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: On Mac, construct locale string from language and country codes.
Don't rely on CFLocaleGetIdentifier(), whose result may not be sensible to the C library.
parent
317d95a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
locale.c
dlls/kernel32/locale.c
+16
-5
No files found.
dlls/kernel32/locale.c
View file @
21acb71e
...
...
@@ -2929,16 +2929,27 @@ void LOCALE_Init(void)
CFArrayRef
preferred_locales
,
all_locales
;
CFStringRef
user_language_string_ref
=
NULL
;
char
user_locale
[
50
];
char
*
p
;
CFLocaleRef
user_locale_ref
=
CFLocaleCopyCurrent
();
CFStringRef
user_locale_string_ref
=
CFLocaleGetIdentifier
(
user_locale_ref
);
CFStringRef
user_locale_lang_ref
=
CFLocaleGetValue
(
user_locale_ref
,
kCFLocaleLanguageCode
);
CFStringRef
user_locale_country_ref
=
CFLocaleGetValue
(
user_locale_ref
,
kCFLocaleCountryCode
);
CFStringRef
user_locale_string_ref
;
if
(
user_locale_country_ref
)
{
user_locale_string_ref
=
CFStringCreateWithFormat
(
NULL
,
NULL
,
CFSTR
(
"%@_%@.UTF-8"
),
user_locale_lang_ref
,
user_locale_country_ref
);
}
else
{
user_locale_string_ref
=
CFStringCreateWithFormat
(
NULL
,
NULL
,
CFSTR
(
"%@.UTF-8"
),
user_locale_lang_ref
);
}
CFStringGetCString
(
user_locale_string_ref
,
user_locale
,
sizeof
(
user_locale
),
kCFStringEncodingUTF8
);
CFRelease
(
user_locale_ref
);
/* Strip modifiers because setlocale() can't parse them. */
if
((
p
=
strchr
(
user_locale
,
'@'
)))
*
p
=
0
;
if
(
!
strchr
(
user_locale
,
'.'
))
strcat
(
user_locale
,
".UTF-8"
);
CFRelease
(
user_locale_string_ref
);
unix_cp
=
CP_UTF8
;
/* default to utf-8 even if we don't get a valid locale */
setenv
(
"LANG"
,
user_locale
,
0
);
TRACE
(
"setting locale to '%s'
\n
"
,
user_locale
);
...
...
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