Skip to content

Fixed output for GUI#30

Closed
Aragas wants to merge 1 commit intoMCCTeam:Indevfrom
Aragas:Indev
Closed

Fixed output for GUI#30
Aragas wants to merge 1 commit intoMCCTeam:Indevfrom
Aragas:Indev

Conversation

@Aragas
Copy link
Contributor

@Aragas Aragas commented Jan 19, 2014

Basic Output for GUI were raw strings. So i fixed it.

@Aragas
Copy link
Contributor Author

Aragas commented Jan 19, 2014

Nevermind. Forget about coloring. Sorry.

@Aragas Aragas closed this Jan 19, 2014
@ORelio
Copy link
Member

ORelio commented Jan 19, 2014

Yep, strings are outputted with §c color tags because if they were removed the GUI could not handle coloring ;)

@Aragas
Copy link
Contributor Author

Aragas commented Jan 19, 2014

But i found here a bug. § won't properly show in my console output, i have another symbol, that i can't see.
So u just copied it from output and replaced §. I find that embarrassing - something is wrong here. Tried different encodings in StartInfo, doesn't helped. System language - Russian.
Check it - https://github.com/Aragas/RainMC/blob/master/RainMC/MinecraftClient/MinecraftClient.cs#L151

@ORelio
Copy link
Member

ORelio commented Jan 19, 2014

I see you are already using the right encoding:
StandardOutputEncoding = Encoding.GetEncoding(850);
But as you have a russian system language encoding may be different. Try reading this:
http://stackoverflow.com/questions/9041602/encoding-issue-when-capturing-console-application-output-in-a-test

@Aragas
Copy link
Contributor Author

Aragas commented Jan 21, 2014

Hm. Nothing helps. Tried convert StandartOutput.ReadLine() 850 codepage to Unicode, 866 - another cyrillic, ASCII and others codepages. The results - it doesn't show anything or it can't convert §. Weird.

@ORelio
Copy link
Member

ORelio commented Jan 21, 2014

Did you try to create a console application with this code?
Console.WriteLine(Console.Out.Encoding.CodePage);

@Aragas
Copy link
Contributor Author

Aragas commented Jan 21, 2014

Yep. 866. Thats why i tried it in ReadLine().

I think i have fixed it - have modified Main() method in Program, added in "//Basic Input/Output ?"
Console.OutputEncoding = Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.ANSICodePage);
And have modified rainmeter plugin StandardOutputEncoding = Encoding.GetEncoding(CultureInfo.CurrentCulture.TextInfo.ANSICodePage)

Tested - StandardOutput.ReadLine() contain §.

Is that acceptable? Should i make a pull request?

ORelio added a commit that referenced this pull request Jan 21, 2014
- Fix encoding when using a GUI on non-ascii langages (eg russian)
- See discussion in pull request #30 for more info
@ORelio
Copy link
Member

ORelio commented Jan 21, 2014

Nice! Just added this in this commit : 6e6fa6a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants