else
AC_CHECK_FUNCS(textdomain,,[
AC_CHECK_LIB(intl,textdomain,
- LDFLAGS_vlc="${LDFLAGS_vlc} ${LIBINTL}"
- LDFLAGS_plugins="${LDFLAGS_plugins} ${LIBINTL}",,
+ LDFLAGS_vlc="${LDFLAGS_vlc} ${LIBINTL}",,
${LIBINTL}
)
])
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.64 2003/05/20 16:20:33 zorglub Exp $
+ * $Id: vlc_common.h,v 1.65 2003/05/25 17:27:13 massiot Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
(defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gnome_main)||\
defined(MODULE_NAME_IS_gnome2)||defined(MODULE_NAME_IS_gnome2_main))
/* Declare nothing: gnome.h will do it for us */
-#elif defined( ENABLE_NLS ) && defined( HAVE_INCLUDED_GETTEXT )
+#elif defined( ENABLE_NLS )
+#if defined( HAVE_INCLUDED_GETTEXT )
# include "libintl.h"
+#else
+# include <libintl.h>
+#endif
# undef _
#if defined( __BORLANDC__ )
#define _(String) vlc_dgettext (PACKAGE_TARNAME, String)
# define _(String) vlc_dgettext (PACKAGE, String)
#endif
# define N_(String) ((char*)(String))
-#elif defined( ENABLE_NLS ) && defined( HAVE_GETTEXT )
-# include <libintl.h>
-# undef _
-# define _(String) dgettext (PACKAGE, String)
-# define N_(String) ((char*)(String))
#else
# define _(String) ((char*)(String))
# define N_(String) ((char*)(String))
* controls.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.m,v 1.38 2003/05/11 18:41:27 hartman Exp $
+ * $Id: controls.m,v 1.39 2003/05/25 17:27:13 massiot Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
{
config_PutPsz( p_intf, "filter", "deinterlace" );
config_PutPsz( p_intf, "deinterlace-mode",
- [[sender title] lossyCString] );
+ [[sender title] UTF8String] );
}
else
{
if( psz_filter != NULL )
{
- if( strcmp( psz_filter, [[o_mi title] lossyCString] ) == 0 )
+ if( strcmp( psz_filter, [[o_mi title] UTF8String] ) == 0 )
{
[o_mi setState: NSOnState];
}
* info.m: MacOS X info panel
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: info.m,v 1.5 2003/03/18 02:28:53 hartman Exp $
+ * $Id: info.m,v 1.6 2003/05/25 17:27:13 massiot Exp $
*
* Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
*
input_info_t * p_info;
/* Add a category */
- o_title = [NSString stringWithCString: p_category->psz_name];
+ o_title = [NSString stringWithUTF8String: p_category->psz_name];
[o_selector addItemWithTitle: o_title];
/* Create empty content string */
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.85 2003/05/20 18:53:03 hartman Exp $
+ * $Id: intf.m,v 1.86 2003/05/25 17:27:13 massiot Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
- (id)init
{
/* default encoding: ISO-8859-1 */
- i_encoding = NSISOLatin1StringEncoding;
+ i_encoding = NSUTF8StringEncoding;
return( [super init] );
}
- (void)initIntlSupport
{
- char *psz_lang = getenv( "LANG" );
-
- if( psz_lang == NULL )
- {
- return;
- }
-
- if( strncmp( psz_lang, "pl", 2 ) == 0 )
- {
- i_encoding = NSISOLatin2StringEncoding;
- }
- else if( strncmp( psz_lang, "ja", 2 ) == 0 )
- {
- i_encoding = NSJapaneseEUCStringEncoding;
- }
- else if( strncmp( psz_lang, "ru", 2 ) == 0 )
- {
-#define CFSENC2NSSENC(e) CFStringConvertEncodingToNSStringEncoding(e)
- i_encoding = CFSENC2NSSENC( kCFStringEncodingKOI8_R );
-#undef CFSENC2NSSENC
- }
}
- (NSString *)localizedString:(char *)psz
if( psz != NULL )
{
- UInt32 uiLength = (UInt32)strlen( psz );
- NSData * o_data = [NSData dataWithBytes: psz length: uiLength];
- o_str = [[[NSString alloc] initWithData: o_data
- encoding: i_encoding] autorelease];
+ o_str = [[[NSString alloc] initWithUTF8String: psz] autorelease];
+ }
+ if ( o_str == NULL )
+ {
+ msg_Err( p_intf, "could not translate: %s", psz );
}
return( o_str );
input_OffsetToTime( p_input, psz_time, p_area->i_tell );
- o_time = [NSString stringWithCString: psz_time];
+ o_time = [NSString stringWithUTF8String: psz_time];
[o_timefield setStringValue: o_time];
}
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
#undef p_area
- o_time = [NSString stringWithCString: psz_time];
+ o_time = [NSString stringWithUTF8String: psz_time];
[o_timefield setStringValue: o_time];
}
* open.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: open.m,v 1.34 2003/05/20 18:53:03 hartman Exp $
+ * $Id: open.m,v 1.35 2003/05/25 17:27:13 massiot Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
if (([o_file_sub_ckbox state] == NSOnState) && !([subPath isEqualTo: @""]))
{
- config_PutPsz( p_intf, "sub-file", strdup( [subPath cString] ) );
+ config_PutPsz( p_intf, "sub-file", strdup( [subPath UTF8String] ) );
if ( [o_file_sub_override state] )
{
config_PutInt( p_intf, "sub-delay", (int)( [o_file_sub_delay intValue] * 10 ) );
* output.m: MacOS X Output Dialog
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: output.m,v 1.5 2003/05/22 14:40:07 hartman Exp $
+ * $Id: output.m,v 1.6 2003/05/25 17:27:13 massiot Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
- (IBAction)outputCloseSheet:(id)sender
{
intf_thread_t * p_intf = [NSApp getIntf];
- config_PutPsz( p_intf, "sout", [o_mrl lossyCString] );
+ config_PutPsz( p_intf, "sout", [o_mrl UTF8String] );
[o_output_sheet orderOut:sender];
[NSApp endSheet: o_output_sheet];
* prefs.h: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: prefs.h,v 1.6 2003/05/20 15:23:25 hartman Exp $
+ * $Id: prefs.h,v 1.7 2003/05/25 17:27:13 massiot Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
{ \
[obj setModuleName: mname]; \
[obj setConfigType: ctype]; \
- [obj setConfigName: [NSString stringWithCString: cname]]; \
+ [obj setConfigName: [NSString stringWithUTF8String: cname]]; \
}
* prefs.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: prefs.m,v 1.26 2003/05/24 20:54:27 gbazin Exp $
+ * $Id: prefs.m,v 1.27 2003/05/25 17:27:13 massiot Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj at users.sf.net>
int i_type = [o_vlc_config configType];
NSString *o_name = [o_vlc_config configName];
- char *psz_name = (char *)[o_name lossyCString];
+ char *psz_name = (char *)[o_name UTF8String];
switch( i_type )
{
o_value = [o_vlc_config titleOfSelectedItem];
psz_value = [o_value isEqualToString: _NS("Auto") ] ? "" :
- (char *)[o_value lossyCString];
+ (char *)[o_value UTF8String];
config_PutPsz( p_intf, psz_name, psz_value );
}
break;
NSString *o_value;
o_value = [o_vlc_config stringValue];
- psz_value = (char *)[o_value lossyCString];
+ psz_value = (char *)[o_value UTF8String];
config_PutPsz( p_intf, psz_name, psz_value );
}
}
/* Enumerate config options and add corresponding config boxes */
- o_module_name = [NSString stringWithCString: p_parser->psz_object_name];
+ o_module_name = [NSString stringWithUTF8String: p_parser->psz_object_name];
p_item = p_parser->p_config;
i_pos = 0;
char *psz_module_name;
int i_index;
- psz_module_name = (char *)[o_module_name lossyCString];
+ psz_module_name = (char *)[o_module_name UTF8String];
/* look for module */
p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.87 2003/05/21 15:40:03 hartman Exp $
+ * $Id: libvlc.c,v 1.88 2003/05/25 17:27:13 massiot Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
textdomain( PACKAGE );
+#if defined( SYS_BEOS ) || defined ( SYS_DARWIN )
+ /* BeOS only support UTF8 strings */
+ /* Mac OS X prefers UTF8 */
+ bind_textdomain_codeset( PACKAGE, "UTF-8" );
+#endif
+
module_EndBank( p_vlc );
module_InitBank( &libvlc );
module_LoadMain( &libvlc );
/* Set the default domain */
textdomain( PACKAGE );
-#ifdef SYS_BEOS
+#if defined( SYS_BEOS ) || defined ( SYS_DARWIN )
/* BeOS only support UTF8 strings */
+ /* Mac OS X prefers UTF8 */
bind_textdomain_codeset( PACKAGE, "UTF-8" );
#endif