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
701ed259
Commit
701ed259
authored
Apr 04, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrc: Avoid loading locale.nls when not necessary.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2d2dba53
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
genres.c
tools/wrc/genres.c
+12
-9
utils.c
tools/wrc/utils.c
+1
-0
No files found.
tools/wrc/genres.c
View file @
701ed259
...
...
@@ -177,29 +177,32 @@ static int parse_accel_string( const string_t *key, int flags )
*/
static
void
put_string
(
const
string_t
*
str
,
int
isterm
,
language_t
lang
)
{
int
cnt
,
codepage
;
int
cnt
;
if
(
win32
)
{
string_t
*
newstr
;
codepage
=
get_language_codepage
(
lang
);
newstr
=
convert_string_unicode
(
str
,
codepage
);
if
(
str
->
type
==
str_char
&&
check_valid_utf8
(
str
,
codepage
))
if
(
str
->
type
==
str_char
)
{
int
codepage
=
get_language_codepage
(
lang
);
string_t
*
newstr
=
convert_string_unicode
(
str
,
codepage
);
if
(
check_valid_utf8
(
str
,
codepage
))
{
print_location
(
&
str
->
loc
);
warning
(
"string
\"
%s
\"
seems to be UTF-8 but codepage %u is in use, maybe use --utf8?
\n
"
,
str
->
str
.
cstr
,
codepage
);
}
if
(
!
isterm
)
put_word
(
newstr
->
size
);
for
(
cnt
=
0
;
cnt
<
newstr
->
size
;
cnt
++
)
str
=
newstr
;
}
if
(
!
isterm
)
put_word
(
str
->
size
);
for
(
cnt
=
0
;
cnt
<
str
->
size
;
cnt
++
)
{
WCHAR
c
=
new
str
->
str
.
wstr
[
cnt
];
WCHAR
c
=
str
->
str
.
wstr
[
cnt
];
if
(
isterm
&&
!
c
)
break
;
put_word
(
c
);
}
if
(
isterm
)
put_word
(
0
);
free_string
(
newstr
);
}
else
{
...
...
tools/wrc/utils.c
View file @
701ed259
...
...
@@ -385,6 +385,7 @@ int get_language_codepage( language_t lang )
const
NLS_LOCALE_LCID_INDEX
*
entry
;
if
(
!
lang
)
return
1252
;
if
(
lang
==
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_DEFAULT
))
return
1252
;
if
(
!
locale_table
)
load_locale_nls
();
if
(
!
(
entry
=
find_lcid_entry
(
lang
)))
return
-
1
;
return
get_locale_data
(
entry
->
idx
)
->
idefaultansicodepage
;
...
...
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