Skip to content

Commit

Permalink
Merge pull request #4 from mlandres/master
Browse files Browse the repository at this point in the history
link against libncursesw.6  to have widechar and thread support
  • Loading branch information
tgoettlicher committed Jun 21, 2012
2 parents 6ebb2c3 + 304a690 commit e4294f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
13 changes: 11 additions & 2 deletions PROJECTINFO.cmake
Expand Up @@ -6,9 +6,18 @@ SET( BASELIB "yui" ) # don't change this

SET( SUBDIRS src )
SET( PLUGINNAME "ncurses" )
SET( LIB_DEPS Curses )
SET( LIB_DEPS )
SET( INTERNAL_DEPS Libyui )
SET( LIB_LINKER ncurses ncursesw panelw )
SET( LIB_LINKER )
SET( URL "http://github.com/libyui/" )
SET( SUMMARY "Libyui - Character Based User Interface" )
SET( DESCRIPTION "This package contains the character based (ncurses) user interface\ncomponent for libYUI.\n" )

# using ncurses6:
SET ( NCURSES_CFLAGS "-I/usr/include/ncurses6" )
SET ( NCURSES_LIBS "-L/usr/lib64/ncurses6 -lncursesw -lpanelw" )

SET ( CMAKE_CXX_FLAGS "${NCURSES_CFLAGS} ${CMAKE_CXX_FLAGS}" )
SET ( CMAKE_C_FLAGS "${NCURSES_CFLAGS} ${CMAKE_C_FLAGS}" )
SET ( CMAKE_SHARED_LINKER_FLAGS "${NCURSES_LIBS} ${CMAKE_SHARED_LINKER_FLAGS}" )
ADD_DEFINITIONS( "-DNCURSES_INTERNALS=1" )
7 changes: 2 additions & 5 deletions src/YNCursesUI.cc
Expand Up @@ -65,23 +65,20 @@ YNCursesUI::YNCursesUI( bool withThreads )

if ( getenv( "LANG" ) != NULL )
{
setlocale ( LC_CTYPE, "" );
string language = getenv( "LANG" );
string encoding = nl_langinfo( CODESET );

// setlocale ( LC_ALL, "" ) is called in WMFInterpreter::WFMInterpreter;
yuiMilestone() << "getenv LANG: " << language << " encoding: " << encoding << std::endl;

// Explicitly set LC_CTYPE so that it won't be changed if setenv( LANG ) is called elsewhere.
// (it's not enough to call setlocale( LC_CTYPE, .. ), set env. variable LC_CTYPE!)

string locale = setlocale( LC_CTYPE, NULL );
setenv( "LC_CTYPE", locale.c_str(), 1 );

yuiMilestone() << "setenv LC_CTYPE: " << locale << " encoding: " << encoding << std::endl;

// The encoding of a terminal (xterm, konsole etc.) can never change; the encoding
// of the "real" console is changed in setConsoleFont().
NCstring::setTerminalEncoding( encoding );

app()->setLanguage( language, encoding );
}

Expand Down

0 comments on commit e4294f3

Please sign in to comment.