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
c25958fb
Commit
c25958fb
authored
Dec 16, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FromLatin1: converts from
ISO-8859
-1 to
UTF-8
parent
43ae5255
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
include/vlc_charset.h
include/vlc_charset.h
+27
-0
No files found.
include/vlc_charset.h
View file @
c25958fb
...
@@ -81,6 +81,33 @@ static inline char *FromWide (const wchar_t *wide)
...
@@ -81,6 +81,33 @@ static inline char *FromWide (const wchar_t *wide)
}
}
#endif
#endif
/**
* Converts a nul-terminated string from ISO-8859-1 to UTF-8.
*/
static
inline
char
*
FromLatin1
(
const
char
*
latin
)
{
char
*
str
=
malloc
(
2
*
strlen
(
latin
)
+
1
),
*
utf8
=
str
;
unsigned
char
c
;
if
(
str
==
NULL
)
return
NULL
;
while
((
c
=
*
(
latin
++
))
!=
'\0'
)
{
if
(
c
>=
0x80
)
{
*
(
utf8
++
)
=
0xC0
|
(
c
>>
6
);
*
(
utf8
++
)
=
0x80
|
(
c
&
0x3F
);
}
else
*
(
utf8
++
)
=
c
;
}
*
(
utf8
++
)
=
'\0'
;
utf8
=
realloc
(
str
,
utf8
-
str
);
return
utf8
?
utf8
:
str
;
}
VLC_EXPORT
(
const
char
*
,
GetFallbackEncoding
,
(
void
)
LIBVLC_USED
);
VLC_EXPORT
(
const
char
*
,
GetFallbackEncoding
,
(
void
)
LIBVLC_USED
);
VLC_EXPORT
(
double
,
us_strtod
,
(
const
char
*
,
char
**
)
LIBVLC_USED
);
VLC_EXPORT
(
double
,
us_strtod
,
(
const
char
*
,
char
**
)
LIBVLC_USED
);
...
...
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