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
c8de6d5a
Commit
c8de6d5a
authored
Mar 26, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Use iconv transliteration instead of custom code
- Supposedly fix a memleak - Fix a few warnings
parent
f9a94a39
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
23 deletions
+9
-23
modules/control/http/http.c
modules/control/http/http.c
+6
-3
modules/control/http/util.c
modules/control/http/util.c
+3
-20
No files found.
modules/control/http/http.c
View file @
c8de6d5a
...
...
@@ -167,10 +167,13 @@ static int Open( vlc_object_t *p_this )
if
(
strcmp
(
psz_src
,
"UTF-8"
)
)
{
p_sys
->
iconv_from_utf8
=
vlc_iconv_open
(
psz_src
,
"UTF-8"
);
char
psz_encoding
[
strlen
(
psz_src
)
+
sizeof
(
"//translit"
)];
sprintf
(
psz_encoding
,
"%s//translit"
,
psz_src
);
p_sys
->
iconv_from_utf8
=
vlc_iconv_open
(
psz_encoding
,
"UTF-8"
);
if
(
p_sys
->
iconv_from_utf8
==
(
vlc_iconv_t
)
-
1
)
msg_Warn
(
p_intf
,
"unable to perform charset conversion to %s"
,
psz_
src
);
psz_
encoding
);
else
{
p_sys
->
iconv_to_utf8
=
vlc_iconv_open
(
"UTF-8"
,
psz_src
);
...
...
@@ -185,7 +188,7 @@ static int Open( vlc_object_t *p_this )
p_sys
->
iconv_from_utf8
=
p_sys
->
iconv_to_utf8
=
(
vlc_iconv_t
)
-
1
;
}
p_sys
->
psz_charset
=
strdup
(
psz_src
)
;
p_sys
->
psz_charset
=
psz_src
;
psz_src
=
NULL
;
/* determine file handler associations */
...
...
modules/control/http/util.c
View file @
c8de6d5a
...
...
@@ -357,26 +357,9 @@ char *E_(FromUTF8)( intf_thread_t *p_intf, char *psz_utf8 )
char
*
psz_out
=
psz_local
;
size_t
i_ret
;
char
psz_tmp
[
i_in
+
1
];
char
*
psz_in
=
psz_tmp
;
uint8_t
*
p
=
(
uint8_t
*
)
psz_tmp
;
const
char
*
psz_in
=
psz_tmp
;
strcpy
(
psz_tmp
,
psz_utf8
);
/* Fix Unicode quotes. If we are here we are probably converting
* to an inferior charset not understanding Unicode quotes. */
while
(
*
p
)
{
if
(
p
[
0
]
==
0xe2
&&
p
[
1
]
==
0x80
&&
p
[
2
]
==
0x99
)
{
*
p
=
'\''
;
memmove
(
&
p
[
1
],
&
p
[
3
],
strlen
((
char
*
)
&
p
[
3
])
+
1
);
}
if
(
p
[
0
]
==
0xe2
&&
p
[
1
]
==
0x80
&&
p
[
2
]
==
0x9a
)
{
*
p
=
'"'
;
memmove
(
&
p
[
1
],
&
p
[
3
],
strlen
((
char
*
)
&
p
[
3
])
+
1
);
}
p
++
;
}
i_in
=
strlen
(
psz_tmp
);
i_ret
=
vlc_iconv
(
p_sys
->
iconv_from_utf8
,
&
psz_in
,
&
i_in
,
...
...
@@ -403,7 +386,7 @@ char *E_(ToUTF8)( intf_thread_t *p_intf, char *psz_local )
if
(
p_sys
->
iconv_to_utf8
!=
(
vlc_iconv_t
)
-
1
)
{
char
*
psz_in
=
psz_local
;
c
onst
c
har
*
psz_in
=
psz_local
;
size_t
i_in
=
strlen
(
psz_in
);
size_t
i_out
=
i_in
*
6
;
char
*
psz_utf8
=
malloc
(
i_out
+
1
);
...
...
@@ -471,7 +454,7 @@ void E_(PlaylistListNode)( intf_thread_t *p_intf, playlist_t *p_pl,
E_
(
mvar_AppendNewVar
)(
itm
,
"ro"
,
"rw"
);
}
sprintf
(
value
,
"%
d"
,
p_node
->
input
.
i_duration
);
sprintf
(
value
,
"%
ld"
,
(
long
)
p_node
->
input
.
i_duration
);
E_
(
mvar_AppendNewVar
)(
itm
,
"duration"
,
value
);
E_
(
mvar_AppendVar
)(
s
,
itm
);
...
...
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