support non-ascii texts v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 06 May 2019 17:46:49 +0200
branchv_0
changeset 10 f911910fd68f
parent 9 b064f1b3676e
child 11 f515d14794e0
support non-ascii texts
src/AwkHandler.h
--- a/src/AwkHandler.h	Mon May 06 16:06:57 2019 +0200
+++ b/src/AwkHandler.h	Mon May 06 17:46:49 2019 +0200
@@ -155,6 +155,8 @@
 				// Writer child process
 				closeOrThrow(awkInputWriterFD);
 
+				locale::global(locale("")); // needed for processing unicode texts, otherwise getline() stopped working on first line with non-ascii characters; TODO: move somewhere else?
+				
 				__gnu_cxx::stdio_filebuf<wchar_t> awkOutputReaderBuffer(awkOutputReaderFD, std::ios::in);
 				std::wistream awkOutputReader(&awkOutputReaderBuffer);