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)

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


Attachments

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.

Note You need to log in before you can comment on or make changes to this bug.