#endif
#ifndef HAVE_USELOCALE
-#define LC_NUMERIC_MASK 0
+#define LC_NUMERIC_MASK 0
+#define LC_MESSAGES_MASK 0
typedef void *locale_t;
static inline locale_t uselocale(locale_t loc)
{
#include <vlc_common.h>
#include <stdarg.h> /* va_list for BSD */
-
+#include <locale.h>
#include <errno.h> /* errno */
#ifdef WIN32
QUEUE.i_sub = 0;
QUEUE.pp_sub = NULL;
+ /* C locale to get error messages in English in the logs */
+ bank->locale = newlocale (LC_MESSAGES_MASK, "C", (locale_t)0);
+
#ifdef UNDER_CE
QUEUE.logfile =
CreateFile( L"vlc-log.txt", GENERIC_WRITE,
#ifdef UNDER_CE
CloseHandle( QUEUE.logfile );
#endif
+ if (bank->locale != (locale_t)0)
+ freelocale (bank->locale);
vlc_dictionary_clear( &priv->msg_enabled_objects, NULL, NULL );
(p_this->i_flags & OBJECT_FLAGS_NODBG && i_type == VLC_MSG_DBG) )
return;
+ msg_bank_t *bank = &QUEUE;
+ locale_t locale = uselocale (bank->locale);
+
#ifndef __GLIBC__
/* Expand %m to strerror(errno) - only once */
char buf[strlen( psz_format ) + 2001], *ptr;
va_end( args );
fputs( "\n", stderr );
vlc_restorecancel (canc);
+ uselocale (locale);
return;
}
+ uselocale (locale);
msg_item_t * p_item = malloc (sizeof (*p_item));
if (p_item == NULL)
PrintMsg( p_this, p_item );
- msg_bank_t *bank = &QUEUE;
vlc_rwlock_rdlock (&bank->lock);
for (int i = 0; i < bank->i_sub; i++)
{