[vlc-commits] config: assume UTF-8 vlcrc
Rémi Denis-Courmont
git at videolan.org
Sat Jun 13 17:56:22 CEST 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jun 12 23:16:17 2015 +0300| [a6e49e68a0f8772999bbcf2918da2f2ec117e83d] | committer: Rémi Denis-Courmont
config: assume UTF-8 vlcrc
8 and a half years should have been enough to transition.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a6e49e68a0f8772999bbcf2918da2f2ec117e83d
---
src/config/file.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/config/file.c b/src/config/file.c
index b445698..3c1712a 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -174,16 +174,10 @@ int config_LoadConfigFile( vlc_object_t *p_this )
if (file == NULL)
return VLC_EGENERIC;
- /* Look for UTF-8 Byte Order Mark */
- char * (*convert) (const char *) = strdupnull;
+ /* Skip UTF-8 Byte Order Mark if present */
char bom[3];
-
- if ((fread (bom, 1, 3, file) != 3)
- || memcmp (bom, "\xEF\xBB\xBF", 3))
- {
- convert = FromLocaleDup;
+ if (fread (bom, 1, 3, file) != 3 || memcmp (bom, "\xEF\xBB\xBF", 3))
rewind (file); /* no BOM, rewind */
- }
char *line = NULL;
size_t bufsize;
@@ -243,7 +237,7 @@ int config_LoadConfigFile( vlc_object_t *p_this )
default:
free ((char *)item->value.psz);
- item->value.psz = convert (psz_option_value);
+ item->value.psz = strdupnull (psz_option_value);
break;
}
}
More information about the vlc-commits
mailing list