Commit 6136f4c0 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Encode non-ASCII characters outside comments

parent 39cc3749
/***************************************************************************** /*****************************************************************************
* m3u.c: a meta demux to parse pls, m3u, asx et b4s playlists * m3u.c: a meta demux to parse pls, m3u, asx et b4s playlists
***************************************************************************** *****************************************************************************
* Copyright (C) 2001-2004 the VideoLAN team * Copyright (C) 2001-2006 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Sigmund Augdal Helberg <dnumgis@videolan.org> * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
* Gildas Bazin <gbazin@videolan.org> * Gildas Bazin <gbazin@videolan.org>
* Clment Stenac <zorglub@via.ecp.fr> * Clément Stenac <zorglub@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -217,12 +217,17 @@ static void XMLSpecialChars ( char *str ) ...@@ -217,12 +217,17 @@ static void XMLSpecialChars ( char *str )
{ {
if( *src == '&' ) if( *src == '&' )
{ {
if( !strncasecmp( src, "&#xe0;", 6 ) ) *dst++ = ''; /* FIXME:
else if( !strncasecmp( src, "&#xee;", 6 ) ) *dst++ = ''; * - should probably accept any sequence, rather than only those
* commonly found in French.
* - output may have to be UTF-8 encoded (cannot assume Latin-1)
*/
if( !strncasecmp( src, "&#xe0;", 6 ) ) *dst++ = '\xe0';
else if( !strncasecmp( src, "&#xee;", 6 ) ) *dst++ = '\xee';
else if( !strncasecmp( src, "&apos;", 6 ) ) *dst++ = '\''; else if( !strncasecmp( src, "&apos;", 6 ) ) *dst++ = '\'';
else if( !strncasecmp( src, "&#xe8;", 6 ) ) *dst++ = ''; else if( !strncasecmp( src, "&#xe8;", 6 ) ) *dst++ = '\xe8';
else if( !strncasecmp( src, "&#xe9;", 6 ) ) *dst++ = ''; else if( !strncasecmp( src, "&#xe9;", 6 ) ) *dst++ = '\xe9';
else if( !strncasecmp( src, "&#xea;", 6 ) ) *dst++ = ''; else if( !strncasecmp( src, "&#xea;", 6 ) ) *dst++ = '\xea';
else else
{ {
*dst++ = '?'; *dst++ = '?';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment