Search code examples
delphiunicodeconsoledelphi-5

read unicode output of console application


I've console app. written in Delphi 2010. It's output is Unicode supported. (I used UTF8Encode and SetConsoleOutputCP(CP_UTF8) for this). When I run the program from command prompt it works fine.
Now I want to read the output from another program which was created in Delphi 5. I use this method. But I've problems with unicode characters.
Does anyone have a recommendation to read the unicode output of console app. from Delphi 5?


Solution

  • I've changed somethings as follows and it works fine :
    In console application, I didn't use SetConsoleOutputCP(CP_UTF8). Only use string output...
    And at the other program (Delphi 5), I use this function without use OemToChar(Buffer,Buffer)