Commit bf31a776 authored by Gildas Bazin's avatar Gildas Bazin

* src/libvlc.c: use UTF-8 internally on win32.
parent d8280a94
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* libvlc.c: main libvlc source * libvlc.c: main libvlc source
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2002 VideoLAN * Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.c,v 1.92 2003/07/01 12:56:47 sam Exp $ * $Id: libvlc.c,v 1.93 2003/07/19 14:22:08 gbazin Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -350,7 +350,8 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] ) ...@@ -350,7 +350,8 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
textdomain( PACKAGE ); textdomain( PACKAGE );
#if defined( SYS_BEOS ) || defined ( SYS_DARWIN ) #if defined( SYS_BEOS ) || defined ( SYS_DARWIN ) || \
( defined( WIN32 ) && !defined( HAVE_INCLUDED_GETTEXT ) )
/* BeOS only support UTF8 strings */ /* BeOS only support UTF8 strings */
/* Mac OS X prefers UTF8 */ /* Mac OS X prefers UTF8 */
bind_textdomain_codeset( PACKAGE, "UTF-8" ); bind_textdomain_codeset( PACKAGE, "UTF-8" );
...@@ -1014,20 +1015,6 @@ static void SetLanguage ( char const *psz_lang ) ...@@ -1014,20 +1015,6 @@ static void SetLanguage ( char const *psz_lang )
char psz_tmp[1024]; char psz_tmp[1024];
#endif #endif
# if defined( HAVE_INCLUDED_GETTEXT ) && !defined( HAVE_LC_MESSAGES )
if( *psz_lang )
{
/* We set LC_ALL manually because it is the only way to set
* the language at runtime under eg. Windows. Beware that this
* makes the environment unconsistent when libvlc is unloaded and
* should probably be moved to a safer place like vlc.c. */
static char psz_lcall[20];
snprintf( psz_lcall, 19, "LC_ALL=%s", psz_lang );
psz_lcall[19] = '\0';
putenv( psz_lcall );
}
# endif
if( psz_lang && !*psz_lang ) if( psz_lang && !*psz_lang )
{ {
# if defined( HAVE_LC_MESSAGES ) # if defined( HAVE_LC_MESSAGES )
...@@ -1035,23 +1022,25 @@ static void SetLanguage ( char const *psz_lang ) ...@@ -1035,23 +1022,25 @@ static void SetLanguage ( char const *psz_lang )
# endif # endif
setlocale( LC_CTYPE, psz_lang ); setlocale( LC_CTYPE, psz_lang );
} }
else else if( psz_lang )
{ {
#ifdef SYS_BEOS
static char psz_lcall[20];
#endif
setlocale( LC_ALL, psz_lang );
#ifdef SYS_DARWIN #ifdef SYS_DARWIN
/* I need that under Darwin, please check it doesn't disturb /* I need that under Darwin, please check it doesn't disturb
* other platforms. --Meuuh */ * other platforms. --Meuuh */
setenv( "LANG", psz_lang, 1 ); setenv( "LANG", psz_lang, 1 );
#endif
#ifdef SYS_BEOS #elif defined( SYS_BEOS ) || defined( WIN32 )
/* I need this under BeOS... */ /* We set LC_ALL manually because it is the only way to set
* the language at runtime under eg. Windows. Beware that this
* makes the environment unconsistent when libvlc is unloaded and
* should probably be moved to a safer place like vlc.c. */
static char psz_lcall[20];
snprintf( psz_lcall, 19, "LC_ALL=%s", psz_lang ); snprintf( psz_lcall, 19, "LC_ALL=%s", psz_lang );
psz_lcall[19] = '\0'; psz_lcall[19] = '\0';
putenv( psz_lcall ); putenv( psz_lcall );
#endif #endif
setlocale( LC_ALL, psz_lang );
} }
/* Specify where to find the locales for current domain */ /* Specify where to find the locales for current domain */
...@@ -1071,7 +1060,8 @@ static void SetLanguage ( char const *psz_lang ) ...@@ -1071,7 +1060,8 @@ static void SetLanguage ( char const *psz_lang )
/* Set the default domain */ /* Set the default domain */
textdomain( PACKAGE ); textdomain( PACKAGE );
#if defined( SYS_BEOS ) || defined ( SYS_DARWIN ) #if defined( SYS_BEOS ) || defined ( SYS_DARWIN ) || \
( defined( WIN32 ) && !defined( HAVE_INCLUDED_GETTEXT ) )
/* BeOS only support UTF8 strings */ /* BeOS only support UTF8 strings */
/* Mac OS X prefers UTF8 */ /* Mac OS X prefers UTF8 */
bind_textdomain_codeset( PACKAGE, "UTF-8" ); bind_textdomain_codeset( PACKAGE, "UTF-8" );
......
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