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

config: assume UTF-8 vlcrc

8 and a half years should have been enough to transition.
parent 8309626d
......@@ -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;
}
}
......
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