Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
20faccf7
Commit
20faccf7
authored
Oct 26, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MMS: use ToCharset()
parent
f8471e1d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
27 deletions
+19
-27
modules/access/mms/buffer.c
modules/access/mms/buffer.c
+19
-27
No files found.
modules/access/mms/buffer.c
View file @
20faccf7
...
@@ -108,34 +108,26 @@ void var_buffer_addmemory( var_buffer_t *p_buf, void *p_mem, int i_mem )
...
@@ -108,34 +108,26 @@ void var_buffer_addmemory( var_buffer_t *p_buf, void *p_mem, int i_mem )
void
var_buffer_addUTF16
(
var_buffer_t
*
p_buf
,
const
char
*
p_str
)
void
var_buffer_addUTF16
(
var_buffer_t
*
p_buf
,
const
char
*
p_str
)
{
{
unsigned
int
i
;
uint16_t
*
p_out
;
if
(
!
p_str
)
size_t
i_out
;
{
var_buffer_add16
(
p_buf
,
0
);
if
(
p_str
!=
NULL
)
}
#ifdef WORDS_BIGENDIAN
p_out
=
ToCharset
(
"UTF-16BE"
,
p_str
,
&
i_out
);
#else
p_out
=
ToCharset
(
"UTF-16LE"
,
p_str
,
&
i_out
);
#endif
else
else
{
p_out
=
NULL
;
vlc_iconv_t
iconv_handle
;
if
(
p_out
==
NULL
)
size_t
i_in
=
strlen
(
p_str
);
i_out
=
0
;
size_t
i_out
=
i_in
*
4
;
char
*
psz_out
,
*
psz_tmp
;
i_out
/=
2
;
for
(
size_t
i
=
0
;
i
<
i_out
;
i
++
)
psz_out
=
psz_tmp
=
xmalloc
(
i_out
+
1
);
var_buffer_add16
(
p_buf
,
p_out
[
i
]
);
iconv_handle
=
vlc_iconv_open
(
"UTF-16LE"
,
"UTF-8"
);
free
(
p_out
);
vlc_iconv
(
iconv_handle
,
&
p_str
,
&
i_in
,
&
psz_tmp
,
&
i_out
);
vlc_iconv_close
(
iconv_handle
);
var_buffer_add16
(
p_buf
,
0
);
psz_tmp
[
0
]
=
'\0'
;
psz_tmp
[
1
]
=
'\0'
;
for
(
i
=
0
;
;
i
+=
2
)
{
uint16_t
v
=
GetWLE
(
&
psz_out
[
i
]
);
var_buffer_add16
(
p_buf
,
v
);
if
(
!
v
)
break
;
}
free
(
psz_out
);
}
}
}
void
var_buffer_free
(
var_buffer_t
*
p_buf
)
void
var_buffer_free
(
var_buffer_t
*
p_buf
)
...
...
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