Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
cd2892e8
Commit
cd2892e8
authored
May 18, 2007
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* src/text/strings.c: Add a lot of entities to the resolve_xml_special_chars function.
parent
63fb2db1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
167 additions
and
23 deletions
+167
-23
src/text/strings.c
src/text/strings.c
+167
-23
No files found.
src/text/strings.c
View file @
cd2892e8
...
...
@@ -246,30 +246,174 @@ void resolve_xml_special_chars( char *psz_value )
while
(
*
psz_value
)
{
if
(
!
strncmp
(
psz_value
,
"<"
,
4
)
)
if
(
*
psz_value
==
'&'
)
{
*
p_pos
=
'<'
;
psz_value
+=
4
;
}
else
if
(
!
strncmp
(
psz_value
,
">"
,
4
)
)
{
*
p_pos
=
'>'
;
psz_value
+=
4
;
}
else
if
(
!
strncmp
(
psz_value
,
"&"
,
5
)
)
{
*
p_pos
=
'&'
;
psz_value
+=
5
;
}
else
if
(
!
strncmp
(
psz_value
,
"""
,
6
)
)
{
*
p_pos
=
'\"'
;
psz_value
+=
6
;
}
else
if
(
!
strncmp
(
psz_value
,
"'"
,
6
)
)
{
*
p_pos
=
'\''
;
psz_value
+=
6
;
#define TRY_CHAR( src, len, dst ) \
if( !strncmp( psz_value, src, len ) ) \
{ \
*p_pos = dst; \
psz_value += len; \
}
#define TRY_LONGCHAR( src, len, dst ) \
if( !strncmp( psz_value, src, len ) ) \
{ \
strncpy( p_pos, dst, strlen( dst ) ); \
p_pos += strlen( dst ) - 1; \
psz_value += len; \
}
TRY_CHAR
(
"<"
,
4
,
'<'
)
else
TRY_CHAR
(
">"
,
4
,
'>'
)
else
TRY_CHAR
(
"&"
,
5
,
'&'
)
else
TRY_CHAR
(
"""
,
6
,
'"'
)
else
TRY_CHAR
(
"'"
,
6
,
'\''
)
else
if
(
psz_value
[
1
]
==
'#'
)
{
char
*
psz_end
;
int
i
=
strtol
(
psz_value
+
2
,
&
psz_end
,
10
);
if
(
*
psz_end
==
';'
)
{
if
(
i
>=
32
&&
i
<=
126
)
{
*
p_pos
=
(
char
)
i
;
psz_value
=
psz_end
+
1
;
}
else
{
/* Unhandled code, FIXME */
*
p_pos
=
*
psz_value
;
psz_value
++
;
}
}
else
{
/* Invalid entity number */
*
p_pos
=
*
psz_value
;
psz_value
++
;
}
}
else
TRY_LONGCHAR
(
"À"
,
8
,
"À"
)
else
TRY_LONGCHAR
(
"Á"
,
8
,
"Á"
)
else
TRY_LONGCHAR
(
"Â"
,
7
,
"Â"
)
else
TRY_LONGCHAR
(
"Ã"
,
8
,
"Ã"
)
else
TRY_LONGCHAR
(
"Ä"
,
6
,
"Ä"
)
else
TRY_LONGCHAR
(
"Å"
,
7
,
"Å"
)
else
TRY_LONGCHAR
(
"Æ"
,
7
,
"Æ"
)
else
TRY_LONGCHAR
(
"Ç"
,
8
,
"Ç"
)
else
TRY_LONGCHAR
(
"È"
,
8
,
"È"
)
else
TRY_LONGCHAR
(
"É"
,
8
,
"É"
)
else
TRY_LONGCHAR
(
"Ê"
,
7
,
"Ê"
)
else
TRY_LONGCHAR
(
"Ë"
,
6
,
"Ë"
)
else
TRY_LONGCHAR
(
"Ì"
,
8
,
"Ì"
)
else
TRY_LONGCHAR
(
"Í"
,
8
,
"Í"
)
else
TRY_LONGCHAR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
else
TRY_LONGCHAR
(
"í"
,
8
,
"í"
)
else
TRY_LONGCHAR
(
"î"
,
7
,
"î"
)
else
TRY_LONGCHAR
(
"ï"
,
6
,
"ï"
)
else
TRY_LONGCHAR
(
"ð"
,
5
,
"ð"
)
else
TRY_LONGCHAR
(
"ñ"
,
8
,
"ñ"
)
else
TRY_LONGCHAR
(
"ò"
,
8
,
"ò"
)
else
TRY_LONGCHAR
(
"ó"
,
8
,
"ó"
)
else
TRY_LONGCHAR
(
"ô"
,
7
,
"ô"
)
else
TRY_LONGCHAR
(
"õ"
,
8
,
"õ"
)
else
TRY_LONGCHAR
(
"ö"
,
6
,
"ö"
)
else
TRY_LONGCHAR
(
"ø"
,
8
,
"ø"
)
else
TRY_LONGCHAR
(
"ù"
,
8
,
"ù"
)
else
TRY_LONGCHAR
(
"ú"
,
8
,
"ú"
)
else
TRY_LONGCHAR
(
"û"
,
7
,
"û"
)
else
TRY_LONGCHAR
(
"ü"
,
6
,
"ü"
)
else
TRY_LONGCHAR
(
"ý"
,
8
,
"ý"
)
else
TRY_LONGCHAR
(
"þ"
,
7
,
"þ"
)
else
TRY_LONGCHAR
(
"ÿ"
,
6
,
"ÿ"
)
else
TRY_LONGCHAR
(
"¡"
,
7
,
"¡"
)
else
TRY_LONGCHAR
(
"¤"
,
8
,
"¤"
)
else
TRY_LONGCHAR
(
"¢"
,
6
,
"¢"
)
else
TRY_LONGCHAR
(
"£"
,
7
,
"£"
)
else
TRY_LONGCHAR
(
"¥"
,
5
,
"¥"
)
else
TRY_LONGCHAR
(
"¦"
,
8
,
"¦"
)
else
TRY_LONGCHAR
(
"§"
,
6
,
"§"
)
else
TRY_LONGCHAR
(
"¨"
,
5
,
"¨"
)
else
TRY_LONGCHAR
(
"©"
,
6
,
"©"
)
else
TRY_LONGCHAR
(
"ª"
,
6
,
"ª"
)
else
TRY_LONGCHAR
(
"«"
,
7
,
"«"
)
else
TRY_LONGCHAR
(
"¬"
,
5
,
"¬"
)
else
TRY_LONGCHAR
(
"­"
,
5
,
""
)
else
TRY_LONGCHAR
(
"®"
,
5
,
"®"
)
else
TRY_LONGCHAR
(
"™"
,
7
,
"™"
)
else
TRY_LONGCHAR
(
"¯"
,
6
,
"¯"
)
else
TRY_LONGCHAR
(
"°"
,
5
,
"°"
)
else
TRY_LONGCHAR
(
"±"
,
8
,
"±"
)
else
TRY_LONGCHAR
(
"²"
,
6
,
"²"
)
else
TRY_LONGCHAR
(
"³"
,
6
,
"³"
)
else
TRY_LONGCHAR
(
"´"
,
7
,
"´"
)
else
TRY_LONGCHAR
(
"µ"
,
7
,
"µ"
)
else
TRY_LONGCHAR
(
"¶"
,
6
,
"¶"
)
else
TRY_LONGCHAR
(
"·"
,
8
,
"·"
)
else
TRY_LONGCHAR
(
"¸"
,
7
,
"¸"
)
else
TRY_LONGCHAR
(
"¹"
,
6
,
"¹"
)
else
TRY_LONGCHAR
(
"º"
,
6
,
"º"
)
else
TRY_LONGCHAR
(
"»"
,
7
,
"»"
)
else
TRY_LONGCHAR
(
"¼"
,
8
,
"¼"
)
else
TRY_LONGCHAR
(
"½"
,
8
,
"½"
)
else
TRY_LONGCHAR
(
"¾"
,
8
,
"¾"
)
else
TRY_LONGCHAR
(
"¿"
,
8
,
"¿"
)
else
TRY_LONGCHAR
(
"×"
,
7
,
"×"
)
else
TRY_LONGCHAR
(
"÷"
,
8
,
"÷"
)
else
TRY_LONGCHAR
(
"Œ"
,
7
,
"Œ"
)
else
TRY_LONGCHAR
(
"œ"
,
7
,
"œ"
)
else
TRY_LONGCHAR
(
"Š"
,
8
,
"Š"
)
else
TRY_LONGCHAR
(
"š"
,
8
,
"š"
)
else
TRY_LONGCHAR
(
"Ÿ"
,
6
,
"Ÿ"
)
else
TRY_LONGCHAR
(
"ˆ"
,
6
,
"ˆ"
)
else
TRY_LONGCHAR
(
"˜"
,
7
,
"˜"
)
else
TRY_LONGCHAR
(
"–"
,
7
,
"–"
)
else
TRY_LONGCHAR
(
"—"
,
7
,
"—"
)
else
TRY_LONGCHAR
(
"‘"
,
7
,
"‘"
)
else
TRY_LONGCHAR
(
"’"
,
7
,
"’"
)
else
TRY_LONGCHAR
(
"‚"
,
7
,
"‚"
)
else
TRY_LONGCHAR
(
"“"
,
7
,
"“"
)
else
TRY_LONGCHAR
(
"”"
,
7
,
"”"
)
else
TRY_LONGCHAR
(
"„"
,
7
,
"„"
)
else
TRY_LONGCHAR
(
"†"
,
8
,
"†"
)
else
TRY_LONGCHAR
(
"‡"
,
8
,
"‡"
)
else
TRY_LONGCHAR
(
"…"
,
8
,
"…"
)
else
TRY_LONGCHAR
(
"‰"
,
8
,
"‰"
)
else
TRY_LONGCHAR
(
"‹"
,
8
,
"‹"
)
else
TRY_LONGCHAR
(
"›"
,
8
,
"›"
)
else
TRY_LONGCHAR
(
"€"
,
6
,
"€"
)
else
{
*
p_pos
=
*
psz_value
;
psz_value
++
;
}
}
else
{
...
...
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