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 ) ...@@ -174,16 +174,10 @@ int config_LoadConfigFile( vlc_object_t *p_this )
if (file == NULL) if (file == NULL)
return VLC_EGENERIC; return VLC_EGENERIC;
/* Look for UTF-8 Byte Order Mark */ /* Skip UTF-8 Byte Order Mark if present */
char * (*convert) (const char *) = strdupnull;
char bom[3]; char bom[3];
if (fread (bom, 1, 3, file) != 3 || memcmp (bom, "\xEF\xBB\xBF", 3))
if ((fread (bom, 1, 3, file) != 3)
|| memcmp (bom, "\xEF\xBB\xBF", 3))
{
convert = FromLocaleDup;
rewind (file); /* no BOM, rewind */ rewind (file); /* no BOM, rewind */
}
char *line = NULL; char *line = NULL;
size_t bufsize; size_t bufsize;
...@@ -243,7 +237,7 @@ int config_LoadConfigFile( vlc_object_t *p_this ) ...@@ -243,7 +237,7 @@ int config_LoadConfigFile( vlc_object_t *p_this )
default: default:
free ((char *)item->value.psz); free ((char *)item->value.psz);
item->value.psz = convert (psz_option_value); item->value.psz = strdupnull (psz_option_value);
break; 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