src/AwkHandler.h
branchv_0
changeset 10 f911910fd68f
parent 7 46db0e6e548b
child 11 f515d14794e0
equal deleted inserted replaced
9:b064f1b3676e 10:f911910fd68f
   153 				throw cli::RelpipeCLIException(L"Unable to fork Writer process.", cli::CLI::EXIT_CODE_UNEXPECTED_ERROR); // TODO: better exceptions?
   153 				throw cli::RelpipeCLIException(L"Unable to fork Writer process.", cli::CLI::EXIT_CODE_UNEXPECTED_ERROR); // TODO: better exceptions?
   154 			} else if (writerPid == 0) {
   154 			} else if (writerPid == 0) {
   155 				// Writer child process
   155 				// Writer child process
   156 				closeOrThrow(awkInputWriterFD);
   156 				closeOrThrow(awkInputWriterFD);
   157 
   157 
       
   158 				locale::global(locale("")); // needed for processing unicode texts, otherwise getline() stopped working on first line with non-ascii characters; TODO: move somewhere else?
       
   159 				
   158 				__gnu_cxx::stdio_filebuf<wchar_t> awkOutputReaderBuffer(awkOutputReaderFD, std::ios::in);
   160 				__gnu_cxx::stdio_filebuf<wchar_t> awkOutputReaderBuffer(awkOutputReaderFD, std::ios::in);
   159 				std::wistream awkOutputReader(&awkOutputReaderBuffer);
   161 				std::wistream awkOutputReader(&awkOutputReaderBuffer);
   160 
   162 
   161 				relationalWriter->startRelation(L"writer_debug",{
   163 				relationalWriter->startRelation(L"writer_debug",{
   162 					{L"message", writer::TypeId::STRING},
   164 					{L"message", writer::TypeId::STRING},