Bug 30878 - System.Console.Out is returning invalid text
Summary: System.Console.Out is returning invalid text
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System (show other bugs)
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-06-07 17:32 UTC by Scot Haynes
Modified: 2015-06-08 09:18 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 30878 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Scot Haynes 2015-06-07 17:32:41 UTC
I have been trying to use Nunit to test a C# console app. As part of my [TestFixtureSetup] I have redirected the console output to a string writer as follows;
			// Initialize string builder to replace console
			System.Console.Clear();
			m_testingSB = new StringBuilder();
			m_testingConsole = new StringWriter(m_testingSB);

			// swap normal output console with testing console - to reuse 
			// it later
			m_normalOutput = System.Console.Out;
			System.Console.SetOut(m_testingConsole);
When the output is written to the output stream I am not getting the same output I would see in the console. An example of what is being written to the stream is "畓瑢瑯污›ꏂ⸰㔶⠊潎漠晦牥\u2073癡楡慬汢⥥吊瑯污瀠楲散›ꏂ⸰㔶\n"

It therefore looks like there may be a bug in the mono code which is returning different character sets in the output stream. Is there something I'm missing in my code or is there a bug in mono.
Comment 1 Chris Hamons 2015-06-08 09:18:59 UTC
MonoMac is the open source bindings to write desktop applications on Mac. This bug is misfiled. I'll move it to the correct location.