Skip to content

Commit

Permalink
help: print UTF-8 BOM in vlc-help.txt on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Denis-Courmont committed Oct 25, 2013
1 parent 4c835cb commit 6791063
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/config/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,8 +695,6 @@ static void Version( void )
*****************************************************************************/
static void ShowConsole( void )
{
FILE *f_help = NULL;

if( getenv( "PWD" ) ) return; /* Cygwin shell or Wine */

if( !AllocConsole() ) return;
Expand All @@ -710,14 +708,13 @@ static void ShowConsole( void )
freopen( "CONOUT$", "w", stderr );
freopen( "CONIN$", "r", stdin );

f_help = fopen( "vlc-help.txt", "wt" );
if( f_help != NULL )
if( freopen( "vlc-help.txt", "wt", stdout ) != NULL )
{
fclose( f_help );
freopen( "vlc-help.txt", "wt", stdout );
utf8_fprintf( stderr, _("\nDumped content to vlc-help.txt file.\n") );
fputs( "\xEF\xBB\xBF", stdout );
fprintf( stderr, _("\nDumped content to vlc-help.txt file.\n") );
}
else freopen( "CONOUT$", "w", stdout );
else
freopen( "CONOUT$", "w", stdout );
}

/*****************************************************************************
Expand Down

0 comments on commit 6791063

Please sign in to comment.