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

Work-around wxWidgets overriding the LC_NUMERIC setting (closes #406)

In any case, that's ugly and thread-safe. The proper solution would
be to reimplement an atof() version that is locale-independant and
use in the many places that expect C/American float numbers. Even
then, there might be some buggy underlying libraries breakage
(e.g. Live555 ?).

Tested on Linux (both UTF-8 and Latin-x locales).
Needs testing on Win32.
parent 711eb066
...@@ -332,8 +332,25 @@ bool Instance::OnInit() ...@@ -332,8 +332,25 @@ bool Instance::OnInit()
{ {
/* Initialization of i18n stuff. /* Initialization of i18n stuff.
* Usefull for things we don't have any control over, like wxWidgets * Usefull for things we don't have any control over, like wxWidgets
* provided facilities (eg. open file dialog) */ * provided facilities (eg. open file dialog)
locale.Init( wxLANGUAGE_DEFAULT ); *
* FIXME FIXME FIXME
* Note that gettext is already initialized by the VLC core, that it
* handles charset conversion and that we DO NOT want wxWidgets to set
* our LC_NUMERIC to non-C. However, it always does it anyway :-(
* Strangely, when calling the "obsoleted" locale.Init() prototype
* setlocale( LC_NUMERIC, "C" ) afterward works, while it is not the
* case with the newer locale.Init() prototype.
*
* In any case, that's ugly and thread-safe. The proper solution would
* be to reimplement an atof() version that is locale-independant and
* use in the many places that expect C/American float numbers. Even
* then, there might be some buggy underlying libraries breakage
* (e.g. Live555).
*/
//locale.Init( wxLANGUAGE_DEFAULT, wxLOCALE_LOAD_DEFAULT );
locale.Init( NULL, NULL, NULL, true, false );
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 );
......
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