Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
83cc55c7
Commit
83cc55c7
authored
May 14, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some users reported problems with subtitles encoding on Win32.
Probably a setlocale() breakage. Use GetACP() instead.
parent
4db8257a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
src/misc/charset.c
src/misc/charset.c
+15
-3
No files found.
src/misc/charset.c
View file @
83cc55c7
...
...
@@ -283,7 +283,7 @@ vlc_bool_t vlc_current_charset( char **psz_charset )
char
buf
[
2
+
10
+
1
];
/* Woe32 has a function returning the locale's codepage as a number. */
s
printf
(
buf
,
"CP%u"
,
GetACP
()
);
s
nprintf
(
buf
,
sizeof
(
buf
)
,
"CP%u"
,
GetACP
()
);
psz_codeset
=
buf
;
#elif defined OS2
...
...
@@ -312,7 +312,7 @@ vlc_bool_t vlc_current_charset( char **psz_charset )
psz_codeset
=
""
;
else
{
s
printf
(
buf
,
"CP%u"
,
cp
[
0
]
);
s
nprintf
(
buf
,
sizeof
(
buf
)
,
"CP%u"
,
cp
[
0
]
);
psz_codeset
=
buf
;
}
}
...
...
@@ -564,11 +564,12 @@ const char *FindFallbackEncoding( const char *locale )
*/
const
char
*
GetFallbackEncoding
(
void
)
{
#ifndef WIN32
const
char
*
psz_lang
=
NULL
;
/* Some systems (like Darwin, SunOS 4 or DJGPP) have only the C locale.
* Therefore we don't use setlocale here; it would return "C". */
# if
HAVE_SETLOCALE && !__APPLE__
# if
defined (HAVE_SETLOCALE) && !defined ( __APPLE__)
psz_lang
=
setlocale
(
LC_ALL
,
NULL
);
# endif
if
(
psz_lang
==
NULL
||
psz_lang
[
0
]
==
'\0'
)
...
...
@@ -583,6 +584,17 @@ const char *GetFallbackEncoding( void )
}
return
FindFallbackEncoding
(
psz_lang
);
#else
/*
* This should be thread-safe given GetACP() should always return
* the same result.
*/
static
char
buf
[
2
+
10
+
1
]
=
""
;
if
(
buf
[
0
]
==
0
)
snprintf
(
buf
,
sizeof
(
buf
),
"CP%u"
,
GetACP
()
);
return
buf
;
#endif
}
/**
...
...
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