From aalub at mail.ru Fri Dec 29 11:41:03 2017 From: aalub at mail.ru (Andrei) Date: Fri, 29 Dec 2017 11:41:03 +0000 Subject: [D-runtime] localized readln() reads nothing in MS Windows console application Message-ID: Since D language proclaims using Unicode in string type it seems natural that the following statement reading localized input (say, Russian) throws exception "std.utf.UTFException... Invalid UTF-8 sequence": auto response=readln().strip(); because the result is ubyte[] containing raw values above 127 unconverted to UTF8. Experienced programmers advise to use SetConsoleCP(65001) Windows function to set up console application, which seems to be the solution, but it brings an unexpected result: while the user feeds the readln() function with ASCII (below 128) input it works perfect, and when [s]he inputs localized text - it returns empty line and any consequent readln()s do not wait for user's input and immediately return empty string too. It seems to me a runtime function issue - or do I something wrong?