From 1fc960f6720e8f49039c0b81734d4e5bc582a700 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Thu, 25 Jan 2018 09:31:59 +0100 Subject: [PATCH] UTF-8 fix for Solaris --- include/final/fvterm.h | 4 ++-- src/fvterm.cpp | 25 ++++++++++++++----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/include/final/fvterm.h b/include/final/fvterm.h index d646038d..24840297 100644 --- a/include/final/fvterm.h +++ b/include/final/fvterm.h @@ -413,9 +413,9 @@ class FVTerm : public FTerm #if defined(__sun) && defined(__SVR4) static int appendOutputBuffer (char); -#else - static int appendOutputBuffer (int); #endif + static int appendOutputBuffer (int); + // Data Members static std::queue* output_buffer; diff --git a/src/fvterm.cpp b/src/fvterm.cpp index ada4495f..417c5888 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -3003,17 +3003,7 @@ inline void FVTerm::appendOutputBuffer (const char s[]) //---------------------------------------------------------------------- int FVTerm::appendOutputBuffer (char ch) { - output_buffer->push(ch); - - if ( output_buffer->size() >= TERMINAL_OUTPUT_BUFFER_SIZE ) - flush_out(); - - return ch; -} -#else -//---------------------------------------------------------------------- -int FVTerm::appendOutputBuffer (int ch) -{ + // This method is required by tputs under Solaris output_buffer->push(ch); if ( output_buffer->size() >= TERMINAL_OUTPUT_BUFFER_SIZE ) @@ -3022,3 +3012,16 @@ int FVTerm::appendOutputBuffer (int ch) return ch; } #endif + +//---------------------------------------------------------------------- +int FVTerm::appendOutputBuffer (int ch) +{ + // append method for unicode character + output_buffer->push(ch); + + if ( output_buffer->size() >= TERMINAL_OUTPUT_BUFFER_SIZE ) + flush_out(); + + return ch; +} +