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
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
genres.c
tools/wrc/genres.c
+15
-12
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 )
...
@@ -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
)
static
void
put_string
(
const
string_t
*
str
,
int
isterm
,
language_t
lang
)
{
{
int
cnt
,
codepage
;
int
cnt
;
if
(
win32
)
if
(
win32
)
{
{
string_t
*
newstr
;
codepage
=
get_language_codepage
(
lang
);
if
(
str
->
type
==
str_char
)
newstr
=
convert_string_unicode
(
str
,
codepage
);
if
(
str
->
type
==
str_char
&&
check_valid_utf8
(
str
,
codepage
))
{
{
print_location
(
&
str
->
loc
);
int
codepage
=
get_language_codepage
(
lang
);
warning
(
"string
\"
%s
\"
seems to be UTF-8 but codepage %u is in use, maybe use --utf8?
\n
"
,
string_t
*
newstr
=
convert_string_unicode
(
str
,
codepage
);
str
->
str
.
cstr
,
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
);
}
str
=
newstr
;
}
}
if
(
!
isterm
)
put_word
(
new
str
->
size
);
if
(
!
isterm
)
put_word
(
str
->
size
);
for
(
cnt
=
0
;
cnt
<
new
str
->
size
;
cnt
++
)
for
(
cnt
=
0
;
cnt
<
str
->
size
;
cnt
++
)
{
{
WCHAR
c
=
new
str
->
str
.
wstr
[
cnt
];
WCHAR
c
=
str
->
str
.
wstr
[
cnt
];
if
(
isterm
&&
!
c
)
break
;
if
(
isterm
&&
!
c
)
break
;
put_word
(
c
);
put_word
(
c
);
}
}
if
(
isterm
)
put_word
(
0
);
if
(
isterm
)
put_word
(
0
);
free_string
(
newstr
);
}
}
else
else
{
{
...
...
tools/wrc/utils.c
View file @
701ed259
...
@@ -385,6 +385,7 @@ int get_language_codepage( language_t lang )
...
@@ -385,6 +385,7 @@ int get_language_codepage( language_t lang )
const
NLS_LOCALE_LCID_INDEX
*
entry
;
const
NLS_LOCALE_LCID_INDEX
*
entry
;
if
(
!
lang
)
return
1252
;
if
(
!
lang
)
return
1252
;
if
(
lang
==
MAKELANGID
(
LANG_ENGLISH
,
SUBLANG_DEFAULT
))
return
1252
;
if
(
!
locale_table
)
load_locale_nls
();
if
(
!
locale_table
)
load_locale_nls
();
if
(
!
(
entry
=
find_lcid_entry
(
lang
)))
return
-
1
;
if
(
!
(
entry
=
find_lcid_entry
(
lang
)))
return
-
1
;
return
get_locale_data
(
entry
->
idx
)
->
idefaultansicodepage
;
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