Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
a1730242
Commit
a1730242
authored
Apr 03, 2006
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fix FindFallbackEncoding on Mac OS X.
* More distintinctive debug messages on the selection of charset.
parent
6f0d9e49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
modules/codec/subsdec.c
modules/codec/subsdec.c
+4
-4
src/misc/charset.c
src/misc/charset.c
+19
-5
No files found.
modules/codec/subsdec.c
View file @
a1730242
...
...
@@ -200,7 +200,7 @@ static int OpenDecoder( vlc_object_t *p_this )
if
(
p_dec
->
fmt_in
.
subs
.
psz_encoding
&&
*
p_dec
->
fmt_in
.
subs
.
psz_encoding
)
{
msg_Dbg
(
p_dec
,
"using character encoding: %s"
,
msg_Dbg
(
p_dec
,
"using
demux suggested
character encoding: %s"
,
p_dec
->
fmt_in
.
subs
.
psz_encoding
);
if
(
strcmp
(
p_dec
->
fmt_in
.
subs
.
psz_encoding
,
"UTF-8"
)
)
p_sys
->
iconv_handle
=
vlc_iconv_open
(
"UTF-8"
,
p_dec
->
fmt_in
.
subs
.
psz_encoding
);
...
...
@@ -218,15 +218,15 @@ static int OpenDecoder( vlc_object_t *p_this )
"subsdec-autodetect-utf8"
);
p_sys
->
iconv_handle
=
vlc_iconv_open
(
"UTF-8"
,
psz_charset
);
msg_Dbg
(
p_dec
,
"using
default
character encoding: %s"
,
psz_charset
);
msg_Dbg
(
p_dec
,
"using
fallback
character encoding: %s"
,
psz_charset
);
}
else
if
(
!
strcmp
(
val
.
psz_string
,
"UTF-8"
)
)
{
msg_Dbg
(
p_dec
,
"using character encoding: UTF-8"
);
msg_Dbg
(
p_dec
,
"using
enforced
character encoding: UTF-8"
);
}
else
if
(
val
.
psz_string
)
{
msg_Dbg
(
p_dec
,
"using character encoding: %s"
,
val
.
psz_string
);
msg_Dbg
(
p_dec
,
"using
enforced
character encoding: %s"
,
val
.
psz_string
);
p_sys
->
iconv_handle
=
vlc_iconv_open
(
"UTF-8"
,
val
.
psz_string
);
if
(
p_sys
->
iconv_handle
==
(
vlc_iconv_t
)
-
1
)
{
...
...
src/misc/charset.c
View file @
a1730242
...
...
@@ -565,11 +565,25 @@ const char *FindFallbackEncoding( const char *locale )
*/
const
char
*
GetFallbackEncoding
(
void
)
{
#if HAVE_SETLOCALE
return
FindFallbackEncoding
(
setlocale
(
LC_CTYPE
,
NULL
)
);
#else
return
FindFallbackEncoding
(
NULL
);
#endif
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__
psz_lang
=
setlocale
(
LC_ALL
,
NULL
);
# endif
if
(
psz_lang
==
NULL
||
psz_lang
[
0
]
==
'\0'
)
{
psz_lang
=
getenv
(
"LC_ALL"
);
if
(
psz_lang
==
NULL
||
psz_lang
==
'\0'
)
{
psz_lang
=
getenv
(
"LC_CTYPE"
);
if
(
psz_lang
==
NULL
||
psz_lang
[
0
]
==
'\0'
)
psz_lang
=
getenv
(
"LANG"
);
}
}
return
FindFallbackEncoding
(
psz_lang
);
}
/**
...
...
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