Commit 6e256bcc authored by Antoine Cellerier's avatar Antoine Cellerier

Disclaimer : this commit would need to be checked by someone

Change locale (LC_NUMERIC) in appropriate places so we always use the
user's locale when reading/writting floats to config (otherwise it would
read floats using C locale (float separator is . in C) and write them
using the user's local (float separator can be , instead of .))

If these changes aren't ok, then i think that the only solution would be
to always setlocale(LC_NUMERIC, "C") when handling config str<->float
conversions.
parent e43b548b
...@@ -332,8 +332,9 @@ bool Instance::OnInit() ...@@ -332,8 +332,9 @@ bool Instance::OnInit()
locale.Init( wxLANGUAGE_DEFAULT ); locale.Init( wxLANGUAGE_DEFAULT );
/* FIXME: The stream output mrl parsing uses ',' already so we want to /* FIXME: The stream output mrl parsing uses ',' already so we want to
* keep the default '.' for floating point numbers. */ * keep the default '.' for floating point numbers.
setlocale( LC_NUMERIC, "C" ); * XXX (dionoea 13/08/2005) : This breaks prefs handling for floats
* setlocale( LC_NUMERIC, "C" ); */
/* Load saved window settings */ /* Load saved window settings */
p_intf->p_sys->p_window_settings = new WindowSettings( p_intf ); p_intf->p_sys->p_window_settings = new WindowSettings( p_intf );
......
...@@ -529,6 +529,9 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -529,6 +529,9 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
/* /*
* Override default configuration with config file settings * Override default configuration with config file settings
*/ */
/* (dionoea 13/08/2005) : we need to load locale here in order to have
* coherent float encoding with subsequent SaveConfigFile calls */
setlocale( LC_NUMERIC, "" );
config_LoadConfigFile( p_vlc, NULL ); config_LoadConfigFile( p_vlc, NULL );
/* Hack: insert the help module here */ /* Hack: insert the help module here */
......
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