Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FAKE Chinese text bug #8

Merged
merged 1 commit into from
Oct 8, 2016
Merged

Fix FAKE Chinese text bug #8

merged 1 commit into from
Oct 8, 2016

Conversation

nosami
Copy link
Contributor

@nosami nosami commented Oct 7, 2016

See
fsprojects/FAKE#1196,
fsprojects/FAKE#1212,
fsprojects/FAKE#1213 &
fsprojects/FAKE#1194

Not sure of the ramifications of this change, but this fixes the
encoding issues in FAKE on Mono for me.

l.Head.Encoding was
System.IO.StringWriter(new System.Text.StringBuilder()).Encoding
which evaluates to utf-16 on both Windows and on Mono
/cc:@forki

See
fsprojects/FAKE#1196,
fsprojects/FAKE#1212,
fsprojects/FAKE#1213 &
fsprojects/FAKE#1194

Not sure of the ramifications of this change, but this fixes the
encoding issues in FAKE for me.

l.Head.Encoding was
`System.IO.StringWriter(new System.Text.StringBuilder()).Encoding`
which evaluates to utf-16
/cc:@forki
@forki
Copy link

forki commented Oct 7, 2016

Wow

@nosami nosami closed this Oct 7, 2016
@nosami
Copy link
Contributor Author

nosami commented Oct 7, 2016

OK. I might have been a little premature with this fix.
The only way I can guarantee that there is no Chinese output in FAKE is to add System.Console.OutputEncoding <- System.Text.Encoding.UTF8 to the top of build.fsx. Not sure why.

@nosami
Copy link
Contributor Author

nosami commented Oct 7, 2016

Even this doesn't work inside FAKE :-

session.EvalInteraction "System.Console.OutputEncoding <- System.Text.Encoding.UTF8"
session.EvalScript pathToBuildFsx

but adding the same line to build.fsx manually does work, which makes me think the issue is in Yaaf somewhere.

@nosami nosami reopened this Oct 7, 2016
@nosami
Copy link
Contributor Author

nosami commented Oct 7, 2016

False alarm - it does work. I was invoking ./build.sh which was using the wrong FAKE.exe

@forki
Copy link

forki commented Oct 8, 2016

I'm temporarily pointing FAKE's paket.dependencies to this fork. Thanks for investigating

@matthid
Copy link
Owner

matthid commented Oct 8, 2016

I don't really understand how this fixes the problem. How does it even matter what the wrapper class returns? This feels wrong. At the very least there should be a comment explaining this.

@matthid
Copy link
Owner

matthid commented Oct 8, 2016

I'm using Console.SetOut that might be somehow related...

@matthid matthid merged commit 146557b into matthid:develop Oct 8, 2016
@matthid
Copy link
Owner

matthid commented Oct 8, 2016

Merged as I don't know how this can have any effect. Documentation says this property is only to help XML writers: https://msdn.microsoft.com/en-us/library/system.io.textwriter.encoding%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

@matthid
Copy link
Owner

matthid commented Oct 8, 2016

Please test again https://www.nuget.org/packages/Yaaf.FSharp.Scripting/1.7.1 and report back if it fixed the problem.

Thanks for the analysis and the PR.

@nosami
Copy link
Contributor Author

nosami commented Oct 8, 2016

Thanks for merging. I don't understand why this fix works either, but it does!

@forki
Copy link

forki commented Oct 9, 2016

it worked! fsprojects/Paket#1948

Thanks so much!

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.

3 participants